User Guide
Using cue points 519
Seeking navigation cue points
You can seek to a navigation cue point, seek to the next navigation cue point from a specified
time, and seek to the previous navigation cue point from a specified time. The following
example plays the FLV file cuepoints.flv and seeks to the cue point at 7.748 when the
ready
event occurs. When the cuePoint event occurs, the example calls the
seekToPrevNavCuePoint() method to seek to the first cue point. When that cuePoint
event occurs, the example calls the
seekToNextNavCuePoint() method to seek to the last cue
point by adding 10 seconds to
eventObject.info.time, which is the time of the current cue
point.
import mx.video.*;
var listenerObject:Object = new Object();
listenerObject.ready = function(eventObject:Object) {
my_FLVPlybk.seekToNavCuePoint("point2");
}
my_FLVPlybk.addEventListener("ready", listenerObject);
var listenerObject:Object = new Object();
listenerObject.cuePoint = function(eventObject:Object) {
trace(eventObject.info.time);
if(eventObject.info.time == 7.748)
my_FLVPlybk.seekToPrevNavCuePoint(eventObject.info.time - .005);
else
my_FLVPlybk.seekToNextNavCuePoint(eventObject.info.time + 10);
}
my_FLVPlybk.addEventListener("cuePoint", listenerObject);
my_FLVPlybk.contentPath = "http://helpexamples.com/flash/video/
cuepoints.flv";
For more information, see FLVPlayback.seekToNavCuePoint() on page 660,
FLVPlayback.seekToNextNavCuePoint() on page 661, and
FLVPlayback.seekToPrevNavCuePoint() on page 663.
Enabling and disabling embedded FLV file cue points
You can enable and disable embedded FLV file cue points using the
setFLVCuePointEnabled() method. Disabled cue points do not trigger cuePoint events
and do not work with the
seekToCuePoint(), seekToNextNavCuePoint(), and
seekToPrevNavCuePoint() methods. You can find disabled cue points, however, with the
findCuePoint(), findNearestCuePoint(), and findNextCuePointWithName() methods.