removeListener (FileReference.removeListener method)

public removeListener(listener:Object) : Boolean

Removes an object from the list of objects that receive event notification messages.

Availability: ActionScript 1.0; Flash Player 8

Parameters

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

Returns

Boolean - Returns true if the object specified in the listener parameter was successfully removed. Otherwise, this method returns false.

Example

The following example removes an event listener using the removeListener method. If a user 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");

Version 8

 

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

Current page: http://livedocs.adobe.com/flash/8/main/00002222.html