FLVPlayback.removeEventListener()

Availability

Flash Player 8.

Edition

Flash Professional 8.

Usage

my_FLVPlybk.removeEventListener(event:String, listener:Object):Void
my_FLVPlybk.removeEventListener(event:String, listener:Function):Void

Parameters

event A string that specifies the name of the event for which you are removing a listener.

listener A reference to the listener object or function that you are removing.

Returns

Nothing.

Description

Method; removes an event listener from a component instance.

Example

The following example removes the listener for a cuePoint event when the first cue point occurs. This causes only the first of three cue points to be detected.

Drag an FLVPlayback component to the Stage, and give it an instance name of my_FLVPlybk. Then add the following code to the Actions panel on Frame 1 of the Timeline:

Usage 1: listener object
/**
 Requires:
  - FLVPlayback component on the Stage with an instance name of my_FLVPlybk
*/
import mx.video.*;
my_FLVPlybk.contentPath = "http://www.helpexamples.com/flash/video/cuepoints.flv";
var listenerObject:Object = new Object(); // create listener object
listenerObject.cuePoint = function(eventObject:Object):Void {
        trace("Hit cue point at " + eventObject.info.time);
        my_FLVPlybk.removeEventListener("cuePoint", listenerObject);
};
my_FLVPlybk.addEventListener("cuePoint", listenerObject);
Usage 2: listener function
/**
 Requires:
  - FLVPlayback component on the Stage with an instance name of my_FLVPlybk
*/
import mx.video.*;
my_ta.visible = false;
my_FLVPlybk.contentPath = "http://www.helpexamples.com/flash/video/cuepoints.flv";
function cuePoint(eventObject:Object):Void {
        trace("Hit cue point at " + eventObject.info.time);
        my_FLVPlybk.removeEventListener("cuePoint", cuePoint);
};
my_FLVPlybk.addEventListener("cuePoint", cuePoint); 

See also

FLVPlayback.addEventListener()


Flash CS3