User Guide
FLVPlayback class 591
Example
The following example creates an ActionScript cue point for the FLV file at 4.07 seconds.
When this cue point occurs, the
cuePoint event handler calls the findNearestCuePoint()
method to find a cue point of any type that is nearest to 5 seconds later. The Output panel
shows the name, time, and type of the cue point that is returned.
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:
/**
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 cuePt:Object = new Object(); //create cue point object
cuePt.time = 4.07;
cuePt.name = "ASpt1";
cuePt.type = "actionscript";
my_FLVPlybk.addASCuePoint(cuePt); //add AS cue point
function cuePoint(eventObject:Object):Void {
if (eventObject.info.name == "ASpt1") {
var rtn_obj:Object = new Object();
rtn_obj = my_FLVPlybk.findNearestCuePoint(eventObject.info.time + 5);
trace("Cue point name is: " + rtn_obj.name);
trace("Cue point time is: " + rtn_obj.time);
trace("Cue point type is: " + rtn_obj.type);
}
}
my_FLVPlybk.addEventListener("cuePoint", cuePoint);
See also
FLVPlayback.addASCuePoint(), FLVPlayback.cuePoints,
FLVPlayback.findCuePoint(), FLVPlayback.findNextCuePointWithName(),
FLVPlayback.isFLVCuePointEnabled(), FLVPlayback.removeASCuePoint(),
FLVPlayback.seekToNavCuePoint(), FLVPlayback.seekToNextNavCuePoint(),
FLVPlayback.seekToPrevNavCuePoint(), FLVPlayback.setFLVCuePointEnabled()