Flash CS3 Documentation |
|||
| ActionScript 2.0 Components Language Reference > FLVPlayback Component > FLVPlayback class > FLVPlayback.removeEventListener() | |||
Flash Player 8.
Flash Professional 8.
my_FLVPlybk.removeEventListener(event:String,listener:Object):Voidmy_FLVPlybk.removeEventListener(event:String,listener:Function):Void
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.
Nothing.
Method; removes an event listener from a component instance.
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);
FLVPlayback.addEventListener()
Flash CS3