addListener (FileReference.addListener method)

public addListener(listener:Object) : Void

Registers an object to receive notification when a FileReference event listener is invoked.

Availability: ActionScript 1.0; Flash Player 8

Parameters

listener:Object - An object that listens for a callback notification from the FileReference event listeners.

Example

The following example adds a listener to an instance of FileReference.

import flash.net.FileReference;

var listener:Object = new Object();

listener.onProgress = function(file:FileReference, bytesLoaded:Number, bytesTotal:Number):Void {
    trace("onProgress with bytesLoaded: " + bytesLoaded + " bytesTotal: " + bytesTotal);
}

listener.onComplete = function(file:FileReference):Void {
    trace("onComplete: " + file.name);
}

var fileRef:FileReference = new FileReference();
fileRef.addListener(listener);
var url:String = "http://www.adobe.com/platform/whitepapers/platform_overview.pdf";
fileRef.download(url, "FlashPlatform.pdf");

Flash CS3


 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/flash/9.0/main/00001657.html