MultiPowUpload 3.1 Events |
![]() ![]() |
MultiPowUpload events
For more information on how to use MultiPowUpload events see How to section.
In the list below there are all available MultiPowUpload events.
onMovieLoad (onMovieLoad event listener)
function onMovieLoad() {}
It is invoked when MultiPowUpload is loaded and ready to work.
Using this event you can check if it is possible to use Flash functions from JavaScript code and when Flash is ready for it.
function MultiPowUpload_onMovieLoad()
{
window.alert("MultiPowUpload is loaded and your browser supports ExternalInterface!");
}
onAddFiles
function onAddFiles(ListItem[] files, ListItem[] ignoredFiles) {}
It is invoked when a user selects files for upload from the file-browsing dialog box.
files:ListItem[]
- Array of ListItem objects that represent added files.
ignoredFiles:ListItem[]
- Array of ListItem objects that represent ignored for some reason files. ListItem objects in this array are not added to the file list. But you may analyze ignored files or print out information about them to the user.
function MultiPowUpload_onAddFiles(addedFiles, ignoredFiles)
{
window.alert("You have selected "+addedFiles.length+" for upload! And "+ignoredFiles.length+" files were ignored");
}
onRemoveFiles
function onRemoveFiles(ListItem[] files) {}
It is invoked when a user removes one or several files from a list.
files:ListItem[]
- Array of ListItem objects that represent removed files.
function MultiPowUpload_onRemoveFiles(removedFiles)
{
window.alert("You have removed "+removedFiles.length+" from list!");
}
onSelectItems
function onSelectItems(ListItem[] files) {}
It is invoked when a user selects some files in the current File view (List or Thumbnails view). The event is invoked every time when the selection is changed.
files:ListItem[]
- Array of ListItem objects that represent selected files.
function MultiPowUpload_onSelectItems(selectedFiles)
{
window.alert("You have selected "+selectedFiles.length+" files in list!");
}
onListChange
function onListChange() {}
It is invoked when a list is changed: files added, removed, sorted, reordered.
function MultiPowUpload_onListChange()
{
window.alert("Something was changed in list ");
}
onClearList
function onClearList() {}
It is invoked when a user clicks "Clear" button and all files are removed from a list.
Note: onRemoveFiles event does not work when "clear list" button is clicked.
function MultiPowUpload_onClearList()
{
window.alert("All files removed from list! ");
}
onFileStart
function onFileStart(ListItem file) {}
It is invoked when upload process of file is started. This event is invoked for each file in the upload queue.
file:ListItem
-Instance of ListItem object that represent the file.
function MultiPowUpload_onFileStart(file)
{
window.alert("Uploading file: "+file.name);
}
onFileComplete
function onFileComplete(ListItem file) {}
It is invoked when upload process of file is completed. This event is invoked for each file in the upload queue.
file:ListItem
-Instance of ListItem object that represent the file.
function MultiPowUpload_onFileComplete(file)
{
window.alert("File upload complete: "+file.name);
}
onStart
function onStart() {}
It is invoked before the upload process is started.
function MultiPowUpload_onStart()
{
window.alert("Upload process started! ");
}
onProgress
function onProgress(ListItem file) {}
It is invoked periodically during the file upload operation. The onProgress
event is invoked while MultiPowUpload transmits bytes to a server, and it is periodically invoked during the transmission.
In some cases, MultiPowUpload_onProgress
event is not invoked; for example, if the transmitted file is very small, or if the upload goes very quickly.
file:ListItem
-Instance of ListItem - currently uploaded file.
function MultiPowUpload_onProgress(file)
{
window.alert("Uploading file"+file.name+"Total percent: "+MultiPowUpload.getProgressInfo().totalPercent);
}
onCancel
function onCancel() {}
It is invoked when the upload operation is cancelled.
function MultiPowUpload_onCancel()
{
window.alert("Upload process cancelled! ");
}
onComplete
function onComplete() {}
It is invoked when the upload operation has been completed sucessfully.
function MultiPowUpload_onComplete()
{
window.alert("Upload complete! ");
}
onServerResponse
function onServerResponse(ListItem file) {}
It is invoked when MultiPowUpload receives a response from server.
In some cases, MultiPowUpload_onResponse
event is not invoked; for example, when the server sends an empty response .
file:ListItem
-Instance of ListItem object.
function MultiPowUpload_onServerResponse(file)
{
window.alert("Response for file: "+file.name+" is : "+file.serverResponse);
}
onError
function onError(ListItem file, String message) {}
It is invoked when MultiPowUpload receives a response from server.
In some cases, MultiPowUpload_onResponse
event is not invoked; for example, when the server send an empty response .
file:ListItem
- Instance of ListItem object.
message:String
- Error message text.
function MultiPowUpload_onError(file, message)
{
window.alert("Error uploading file "+file.name+" : "+message);
}
onImageLoaded
function onImageLoaded(ListItem file) {}
It is invoked when MultiPowUpload loads an image file. The image file is loaded by MultiPowUpload when thumbnails are generated for preview in Thumbnails view mode (or File info window) or when thumbnails are generated for upload.
file:ListItem
- Instance of ListItem object.
function MultiPowUpload_onImageLoaded(file)
{
window.alert("Count of exif tags loaded: "+file.exif.length);
}
onThumbnailGenerateStart
function onThumbnailGenerateStart() {}
It is invoked when thumbnails generation process is started.
function MultiPowUpload_onThumbnailGenerateStart()
{
window.alert("Thumbnails being prepared for upload.");
}
onThumbnailGenerateProgress
function onThumbnailGenerateProgress(countCompleted:Integer, totalFiles:Integer, percent:Float) {}
It is invoked for each image file when thumbnail generation of a single file is completed.
countCompleted:String
- count of images that have already been processed.
totalFiles:Integer
- Total images count to be processed.
percent:Float
- Percent of completion.
function MultiPowUpload_onThumbnailGenerateProgress(countCompleted, totalFiles, percent)
{
window.alert(countCompleted + " of " + totalFiles+ " images processed.");
}
onThumbnailGenerateComplete
function onThumbnailGenerateComplete() {}
It is invoked when the thumbnails generation process is completed.
function MultiPowUpload_onThumbnailGenerateComplete()
{
window.alert("Thumbnails ready for upload.");
}
onThumbnailUploadStart
function onThumbnailUploadStart(ListItem file) {}
It is invoked when the file thumbnail upload process is started.
file:ListItem
- Instance of ListItem object.
function MultiPowUpload_onThumbnailUploadStart(file)
{
window.alert("Starting upload thumbnail of "+file.name);
}
onThumbnailUploadComplete
function onThumbnailUploadComplete(ListItem file, String response) {}
It is invoked when the current file thumbnail upload process has been completed.
file:ListItem
- Instance of ListItem object.
response:String
- Server response for current thumbnail upload.
function MultiPowUpload_onThumbnailUploadComplete(file, response)
{
window.alert("Thumbnail upload of "+file.name+" completed.");
}
onErrorMessage
function onErrorMessage(String message, Boolean displayed) {}
It is invoked every time when MultiPowUpload displays some error message. For example, when a user selects files with non-allowed file type. This event is helpfull if you use MultiPowUpload in the hidden mode, or if the size of MultiPowUpload is too small and error windows are not displayed.
message:String
- Error message text.
displayed:Boolean
- true if this message was displayed in Flash UI by MultiPowUpload, otherwise false. The messages may not be displayed whe n MultiPowUpload is in the hidden mode or the file size is too small (less then 75x75 pxels) or the value of showAlert parameter is set to false.
function MultiPowUpload_onErrorMessage(message, displayed)
{
if(!displayed)
window.alert(message);
}
onDebug
function onDebug(String message) {}
It is invoked every time when MultiPowUpload shows some debug messages. This event works only if the value of debug.enabled is set to true.
message:String
- Debug message text.
function MultiPowUpload_onDebug(message)
{
window.alert(message);
}
onLoadVarsError
function onLoadVarsError() {}
It is invoked if sendAndLoadVars
method call is unsucessful.
function MultiPowUpload_onLoadVarsError()
{
window.alert("error during sendAndLoadVars method execution ");
}