Onprogress (Filereference.onprogress Event Listener) - MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE Reference

Actionscript 2.0 language reference
Table of Contents

Advertisement

onProgress (FileReference.onProgress event
listener)
onProgress = function(fileRef:FileReference, bytesLoaded:Number,
bytesTotal:Number) {}
Invoked periodically during the file upload or download operation. The
is invoked while the Flash Player 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
In some cases,
onProgress
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
event is called during the upload operation, but the value of the
onProgress
parameter is -1, indicating that the progress cannot be determined.
bytesLoaded
Availability: ActionScript 1.0; Flash Player 8
Parameters
fileRef:flash.net.FileReference
bytesLoaded:Number
bytesTotal:Number
be determined, the value is -1.
Example
The following example traces the progress of a download using the
import flash.net.FileReference;
var listener:Object = new Object();
listener.onProgress = function(file:FileReference, bytesLoaded:Number,
bytesTotal:Number):Void {
trace("onProgress: " + file.name + " with bytesLoaded: " + bytesLoaded +
" bytesTotal: " + bytesTotal);
}
var fileRef:FileReference = new FileReference();
fileRef.addListener(listener);
var url:String = "http://www.macromedia.com/platform/whitepapers/
platform_overview.pdf";
fileRef.download(url, "FlashPlatform.pdf");
listeners are not invoked; for example, if the file being transmitted
- The FileReference object that initiated the operation.
- The number of bytes transmitted so far.
- The total size of the file to be transmitted, in bytes. If the size cannot
onProgress
onComplete
onProgress
FileReference (flash.net.FileReference)
listener
.
event listener.
575

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Flash 8

Table of Contents