| uploadScript.as | |
| Variables | |
| bytesUploaded | Number of bytes that have been uploaded. |
| numUploads | Number of uploads in this session. |
| currentUpload | File that is currently being uploaded. |
| uploadFileRefList | File Reference List of files to be uploaded. |
| queue | Queue containing the files to upload. |
| eventHandled | Used to determine if the event has been handled in the event that multiple events will be thrown from one error. |
| Functions | |
| uploadFiles | Displays the file selector and initiates the file upload. |
| uploadSelectHandler | Called when a user selects files from the File Select box created in the uploadFiles function. |
| doUpload | Adds event listeners to the local file, formats the variables to be passed to the upload, and initiates the file upload. |
| uploadCompleteHandler | Called when a file upload is completed. |
| uploadOpenHandler | Called when a upload is initiated. |
| uploadHTTPStatusHandler | Displays an error alert, and sets the eventHandled variable to true. |
| uploadIoErrorHandler | Displays an error message and progresses to the next file. |
| cleanupFile | Removes the event listeners. |
| progressToNextFile | Triggers a cleanup on the current file, and initiates the upload of the next file. |
private var uploadFileRefList: FileReferenceList
File Reference List of files to be uploaded.
private var eventHandled: Boolean
Used to determine if the event has been handled in the event that multiple events will be thrown from one error.
private function uploadFiles():void
Displays the file selector and initiates the file upload.
private function uploadSelectHandler( event: Event ):void
Called when a user selects files from the File Select box created in the uploadFiles function. The function checks the files, adds them to the upload queue, and initiates the upload process.
private function doUpload( data: compu.UploadFile ):void
Adds event listeners to the local file, formats the variables to be passed to the upload, and initiates the file upload.
| file | Reference to the local file. |
private function uploadCompleteHandler ( event: Event ):void
Called when a file upload is completed. Updates the tile list, and progresses to the next file.
| event | Upload complete event. |
private function uploadOpenHandler( event: Event ):void
Called when a upload is initiated. Sets the direction of the progress bar. Primarily kept to ease if new functions have to be added on open.
| event | Event when file upload is opened. |
private function uploadHTTPStatusHandler( event: HTTPStatusEvent ):void
Displays an error alert, and sets the eventHandled variable to true. The error is cleaned up in the uploadIoErrorHandler function, as IO errors are thrown following http errors.
| event | HTTP Error Status event. |
private function uploadIoErrorHandler( event: Event ):void
Displays an error message and progresses to the next file.
| event | IO Error event. |
Number of bytes that have been uploaded.
private var bytesUploaded: Number
Number of uploads in this session.
private var numUploads: Number
File that is currently being uploaded.
private var currentUpload: compu.UploadFile
File Reference List of files to be uploaded.
private var uploadFileRefList: FileReferenceList
Queue containing the files to upload.
private var queue: ArrayCollection
Used to determine if the event has been handled in the event that multiple events will be thrown from one error.
private var eventHandled: Boolean
Displays the file selector and initiates the file upload.
private function uploadFiles():void
Called when a user selects files from the File Select box created in the uploadFiles function.
private function uploadSelectHandler( event: Event ):void
Adds event listeners to the local file, formats the variables to be passed to the upload, and initiates the file upload.
private function doUpload( data: compu.UploadFile ):void
Called when a file upload is completed.
private function uploadCompleteHandler ( event: Event ):void
Called when a upload is initiated.
private function uploadOpenHandler( event: Event ):void
Displays an error alert, and sets the eventHandled variable to true.
private function uploadHTTPStatusHandler( event: HTTPStatusEvent ):void
Displays an error message and progresses to the next file.
private function uploadIoErrorHandler( event: Event ):void
Removes the event listeners.
private function cleanupFile( file: FileReference ):void
Triggers a cleanup on the current file, and initiates the upload of the next file.
private function progressToNextFile( file: FileReference ):void