ActionScript 2.0 Components Language Reference |
|
|
|
| FLVPlayback Component > FLVPlayback class > FLVPlayback.seekToNavCuePoint() | |||
Flash Player 8.
Flash Professional 8.
my_FLVplybk.seekToNavCuePoint(time:Number):Void my_FLVplybk.seekToNavCuePoint(name:String):Void my_FLVplybk.seekToNavCuePoint(cuePoint:Object):Void
time A number that is the time of the navigation cue point to seek. The method uses only the first three decimal places and rounds any additional decimal places.
name A string that is the name of the cue point to seek.
cuePoint A cue point object in which you set the time and name properties to specify the cue point to seek.
Nothing.
Method; seeks to a navigation cue point that matches the specified time or is later. If time is undefined, null, or less than 0, the method starts its search at time 0.
If you specify only a time, the method seeks to a cue point that matches that time or is later.
If you specify a name, the method seeks to the first enabled cue point that matches it (for more information about enabling/disabling cue points see FLVPlayback.setFLVCuePointEnabled()).
For several reasons, the playheadTime property might not have the expected value immediately after calling one of the seek methods or setting playheadTime to cause seeking. First, for a progressive download, you can seek only to a keyframe, so a seek takes you to the time of the first keyframe after the specified time. (When streaming, a seek always goes to the precise specified time even if the source FLV file doesn't have a keyframe there.) Second, seeking is asynchronous, so if you call a seek method or set the playheadTime property, playheadTime does not update immediately. To obtain the time after the seek is complete, listen for the seek event, which does not start until the playheadTime property has updated.
The following example seeks to the cue point named point2 when the ready event occurs. The cuePoint event handler shows the name, time, and type values for each cue point that occurs.
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.*;
var listenerObject:Object = new Object();
listenerObject.ready = function(eventObject:Object):Void {
my_FLVPlybk.seekToNavCuePoint("point2");
}
my_FLVPlybk.addEventListener("ready", listenerObject);
var listenerObject:Object = new Object();
listenerObject.cuePoint = function(eventObject:Object):Void {
trace("Cue point name is: " + eventObject.info.name);
trace("Cue point time is: " + eventObject.info.time);
trace("Cue point type is: " + eventObject.info.type);
}
my_FLVPlybk.addEventListener("cuePoint", listenerObject);
my_FLVPlybk.contentPath = "http://www.helpexamples.com/flash/video/cuepoints.flv";
FLVPlayback.cuePoint, FLVPlayback.seek, FLVPlayback.seek(), FLVPlayback.seekToNextNavCuePoint()
|
|
|
|