ActionScript 2.0 Components Language Reference |
|
|
|
| FLVPlayback Component > FLVPlayback class > FLVPlayback.cuePoint | |||
Flash Player 8.
Flash Professional 8.
varlistenerObject:Object = new Object();listenerObject.cuePoint = function(eventObject:Object):Void {// insert event-handling code here}; my_FLVplybk.addEventListener("cuePoint",listenerObject);
Event; dispatched when a cue point is reached. The event object has an info property that contains the info object received by the NetStream.onCuePoint callback for FLV file cue points. For ActionScript cue points, it contains the object that was passed into the ActionScript cue point methods or properties.
This event has a vp property, which is the index number of the video player to which this event applies.
The following example adds two ActionScript cue points to an FLV file. The example adds the first one using a cuePoint parameter and the second one using the time and name parameters. When each cue point occurs, a listener for cuePoint events shows the value of the playheadTime property in a text area.
Drag an FLVPlayback component to the Stage, and give it an instance name of my_FLVPlybk. Drag a TextArea component to the Stage below the FLVPlayback instance, and give it an instance name of my_ta. Then add the following code to the Actions panel on Frame 1 of the Timeline:
/**
Requires:
- FLVPlayback component on the Stage with an instance name of my_FLVPlybk
- TextArea component on the Stage with an instance name of my_ta
*/
import mx.video.*;
my_FLVPlybk.contentPath = "http://www.helpexamples.com/flash/video/water.flv";
my_ta.visible = false;
// create cue point object
var cuePt:Object = new Object(); //create cue point object
cuePt.time = 1.444;
cuePt.name = "elapsed_time";
cuePt.type = "actionscript";
my_FLVPlybk.addASCuePoint(cuePt); //add AS cue point
// add 2nd AS cue point using time and name parameters
my_FLVPlybk.addASCuePoint(5.3, "elapsed_time2");
var listenerObject:Object = new Object();
listenerObject.cuePoint = function(eventObject:Object):Void {
my_ta.text = "Cue at: " + eventObject.info.time + " occurred";
my_ta.visible = true;
}
my_FLVPlybk.addEventListener("cuePoint", listenerObject);
FLVPlayback.activeVideoPlayerIndex, FLVPlayback.visibleVideoPlayerIndex
|
|
|
|