User Guide
518 FLVPlayback Component (Flash Professional Only)
The ready event handler in the following example calls the findCuePoint() method to find
the cue point
ASpt1 and then calls the findNearestCuePoint() method to find the
navigation cue point that is nearest to the time of cue point
ASpt1:
import mx.video.*;
my_FLVPlybk.contentPath = "http://www.helpexamples.com/flash/video/
cuepoints.flv"
var rtn_obj:Object = new Object(); //create cue point object
my_FLVPlybk.addASCuePoint(2.02, "ASpt1"); //add AS cue point
var listenerObject:Object = new Object();
listenerObject.ready = function(eventObject:Object):Void {
rtn_obj = my_FLVPlybk.findCuePoint("ASpt1");
traceit(rtn_obj);
rtn_obj = my_FLVPlybk.findNearestCuePoint(rtn_obj.time,
FLVPlayback.NAVIGATION);
traceit(rtn_obj);
}
my_FLVPlybk.addEventListener("ready", listenerObject);
function traceit(cuePoint:Object):Void {
trace("Cue point name is: " + cuePoint.name);
trace("Cue point time is: " + cuePoint.time);
trace("Cue point type is: " + cuePoint.type);
}
In the following example, the ready event handler finds cue point ASpt and calls the
findNextCuePointWithName() method to find the next cue point with the same name:
import mx.video.*;
my_FLVPlybk.contentPath = "http://www.helpexamples.com/flash/video/
cuepoints.flv"
var rtn_obj:Object = new Object(); //create cue point object
my_FLVPlybk.addASCuePoint(2.02, "ASpt"); //add AS cue point
my_FLVPlybk.addASCuePoint(3.4, "ASpt"); //add 2nd Aspt
var listenerObject:Object = new Object();
listenerObject.ready = function(eventObject:Object):Void {
rtn_obj = my_FLVPlybk.findCuePoint("ASpt");
traceit(rtn_obj);
rtn_obj = my_FLVPlybk.findNextCuePointWithName(rtn_obj);
traceit(rtn_obj);
}
my_FLVPlybk.addEventListener("ready", listenerObject);
function traceit(cuePoint:Object):Void {
trace("Cue point name is: " + cuePoint.name);
trace("Cue point time is: " + cuePoint.time);
trace("Cue point type is: " + cuePoint.type);
}
For more information about finding cue points, see FLVPlayback.findCuePoint()
on page 586,
FLVPlayback.findNearestCuePoint() on page 589, and
FLVPlayback.findNextCuePointWithName() on page 592.