removeFileScript.as

Summary
removeFileScript.as
Variables
currentlyRemovingFilesUsed to determine if files are currently in the process of being removed.
filesToRemoveAn ArrayCollection of files that are queueud to be removed.
Functions
removeFilesSends the removal request.
removeFileHandlerHandles the result of the file removal operation.
handleHTTPFaultHandle faults in the event of HTTP Service failure.

Variables

currentlyRemovingFiles

private var currentlyRemovingFiles: Boolean

Used to determine if files are currently in the process of being removed.

filesToRemove

private var filesToRemove: ArrayCollection

An ArrayCollection of files that are queueud to be removed.

Functions

removeFiles

private function removeFiles():void

Sends the removal request.  The parameters for the removal request contains an array, file[].

See Also

removeFileHandler

removeFileHandler

private function removeFileHandler(event: ResultEvent):void

Handles the result of the file removal operation.  If there isn’t an error, remove the files from the uploaded files array.  If there is an error, display the error message.  In either case, remove the busy cursor.  The error message is formatted as follows: <errors><error><title>Error Title!</title><message>Error Message</message></error></errors>.  IF AN ERROR MESSAGE IS RETURNED, IT IS ASSUMED THAT NO FILES WERE REMOVED.  In other words, the server side file removal process should be transactional.

Parameters

eventResult Event from the http request.

See Also

removeFiles

handleHTTPFault

private function handleHTTPFault(error: FaultEvent):void

Handle faults in the event of HTTP Service failure.  In production, this method should never be called.

Parameters

errorFault Error event.
private var currentlyRemovingFiles: Boolean
Used to determine if files are currently in the process of being removed.
private var filesToRemove: ArrayCollection
An ArrayCollection of files that are queueud to be removed.
private function removeFiles():void
Sends the removal request.
private function removeFileHandler(event: ResultEvent):void
Handles the result of the file removal operation.
private function handleHTTPFault(error: FaultEvent):void
Handle faults in the event of HTTP Service failure.