MultiPowUpload 1.5 control documentation

MultiPowUpload object events 



MultiPowUpload_onSelect event

MultiPowUpload_onListChange event

MultiPowUpload_onStart event

MultiPowUpload_onComplete event

MultiPowUpload_onError event

MultiPowUpload_onCompleteAbsolute event

MultiPowUpload_onProgress event

MultiPowUpload_onMovieLoad event

MultiPowUpload_onLoadVars event

MultiPowUpload_onLoaderProgress event

MultiPowUpload_onSelect (MultiPowUpload_onSelect event listener)

function MultiPowUpload_onSelect() {}

Invoked when the user selects a file to upload from the file-browsing dialog box. (This dialog box is displayed when you call browseFiles()) When the user selects a file and confirms the operation (for example, by clicking OK), the properties of the fileList array are populated.

When MultiPowUpload_onSelect is invoked after a browseFiles() call, Java Script can read all of the FileReference object's properties in fileList array.

Example

MultiPowUpload_onListChange (MultiPowUpload_onListChange event listener)

function MultiPowUpload_onListChange() {}

Invoked when list with files for upload or download changes as a result if user adds new files, removes existing or selects items.

Example

MultiPowUpload_onStart (MultiPowUpload_onStart event listener)

function MultiPowUpload_onStart(type:String, fileIndex:Integer) {}

Invoked for each file right away after start of upload or download operation.

Parameters

type:String - The string represents type of process. Possible values: "upload" or "download"

fileIndex:Integer - An index of uploaded file in fileList array.

Example

MultiPowUpload_onComplete (MultiPowUpload_onComplete event listener)

function MultiPowUpload_onComplete(type:String, fileIndex:Integer) {}

Invoked for each file when the upload or download operation has successfully completed. Successful completion means that the entire file has been uploaded or downloaded.

Parameters

type:String - The string represents type of process. Possible values: "upload" or "download"

fileIndex:Integer - An index of uploaded file in fileList array.

Example

MultiPowUpload_onError (MultiPowUpload_onError event listener)

function MultiPowUpload_onError(error:String) {}

Invoked when an upload fails because of an HTTP or security error or when an input/output error occurs.

Parameters

error:String - The error that caused this upload to fail. For example, an httpError of 404 indicates that a page is not found. HTTP error values can be found in sections 10.4 and 10.5 of the HTTP specification at ftp://ftp.isi.edu/in-notes/rfc2616.txt

Example

MultiPowUpload_onCompleteAbsolute (MultiPowUpload_onCompleteAbsolute event listener)

function MultiPowUpload_onCompleteAbsolute(type:String, uploadedBytes:Integer) {}

Invoked when the upload or download operation of all files has successfully completed. Successful completion means that the entire files list has been uploaded or downloaded.

Parameters

type:String - The string represents type of process. Possible values: "upload" or "download"

uploadedBytes:Integer - The number of bytes transmitted

Example

MultiPowUpload_onProgress(MultiPowUpload_onProgress event listener)

function MultiPowUpload_onProgress(type:String, fileIndex:Integer, fileBytesLoaded:Integer, fileBytesLength:Integer, totalBytesLoaded:Integer, totalBytesLength:Integer) {}

Invoked periodically during the file upload or download operation. The MultiPowUpload_onProgress listener is invoked while the Flash transmits bytes to a server, and it is periodically invoked during the transmission, even if the transmission is ultimately not successful. To determine if and when the file transmission is successful and complete, use MultiPowUpload_onComplete.

In some cases, MultiPowUpload_onProgress listeners are not invoked; for example, if the file being transmitted is very small, or if the upload or download happens very quickly.

File upload progress cannot be determined on Macintosh platforms earlier than OS X 10.3. The MultiPowUpload_onProgress event is called during the upload operation, but the value of the fileBytesLoaded parameter is -1, indicating that the progress cannot be determined.

Parameters

type:String - The string represents type of process. Possible values: "upload" or "download"

fileIndex:Integer - An index of uploaded file in fileList array.

fileBytesLoaded:Number - The number of bytes transmitted so far of single file.

fileBytesLength:Number - The total size of the file to be transmitted, in bytes.

totalBytesLoaded:Number - The number of bytes transmitted so far.

totalBytesLength:Number - The total size of the files in fileList to be transmitted, in bytes.

Example

MultiPowUpload_onMovieLoad (MultiPowUpload_onMovieLoad event listener)

function MultiPowUpload_onMovieLoad() {}

Invokes when Flash Movie loaded and if browser supports ExternalInterface.

Using this event you can check if it is possible to use Flash functions from JavaScript code and when Flash is ready for this.

The ExternalInterface class is an application programming interface that enables straightforward communication between Flash and the Java Script. From JavaScript on the HTML page, you can call Flash functions or Flash can rise events in Java Script code.

ExternalInterface is supported in the following combinations of browser and operating system:

Browser

Operating System

Internet Explorer 5.0 and higher

 Windows 

 

Netscape 8.0 and higher

 Windows 

 Macintosh 

Mozilla 1.7.5 and higher

 Windows 

 Macintosh 

Firefox 1.0 and higher

 Windows 

 Macintosh 

Safari 1.3 and higher

 

 Macintosh 

ExternalInterface requires the user's web browser to support either ActiveX or the NPRuntime API that is exposed by some browsers for plugin scripting. See http://www.mozilla.org/projects/plugins/npruntime.html.

Example

MultiPowUpload_onLoadVars (MultiPowUpload_onLoadVars event listener)

function MultiPowUpload_onLoadVars(response:String) {}

Invoked after sendAndLoadVars method call and return information from the server.

Parameters

response:String - The string containing the downloaded variables.

Example

The following example uploads 2 variables to server side ASP.NET script and shows server response.

formproc.aspx file code:

MultiPowUpload_onLoaderProgress(MultiPowUpload_onLoaderProgress event listener)

function MultiPowUpload_onLoaderProgress(bytesLoaded:Integer, bytesTotal:Integer) {}

Invoked periodically during the image download operation then Flash is in ImageLoader mode.

In some cases, MultiPowUpload_onLoaderProgress listeners are not invoked; for example, if the file being transmitted is very small, or if download happens very quickly.

File upload progress cannot be determined on Macintosh platforms earlier than OS X 10.3. The MultiPowUpload_onLoaderProgress event is called during the upload operation, but the value of the bytesLoaded parameter is -1, indicating that the progress cannot be determined.

Parameters

bytesLoaded:Number - The number of bytes transmitted so far.

bytesTotal:Number - The total size to be transmitted, in bytes.

Example