ActionScript 2.0 Components Language Reference |
|
|
|
| FLVPlayback Component > Using cue points > Using ActionScript with cue points > 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(), FLVPlayback.seekToNextNavCuePoint(), and FLVPlayback.seekToPrevNavCuePoint().
|
|
|
|