Example
The following example removes an event listener using the
cancels the download, the listener is removed so that it no longer receives events from that
FileReference object.
import flash.net.FileReference;
var listener:Object = new Object();
listener.onCancel = function(file:FileReference):Void {
trace(file.removeListener(this)); // true
}
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");
size (FileReference.size property)
public size : Number [read-only]
The size of the file on the local disk, in bytes. If the FileReference object has not been
populated, a call to get the value of this property returns
Availability: ActionScript 1.0; Flash Player 8
Example
The following example retrieves the size of a file selected by the user.
import flash.net.FileReference;
var listener:Object = new Object();
listener.onSelect = function(file:FileReference):Void {
trace("size: " + file.size + " bytes");
}
var fileRef:FileReference = new FileReference();
fileRef.addListener(listener);
fileRef.browse();
See also
browse (FileReference.browse method)
removeListener
.
null
FileReference (flash.net.FileReference)
method. If a user
579
Need help?
Do you have a question about the FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE and is the answer not in the manual?