FLVPlayback.seekToPrevNavCuePoint()

Availability

Flash Player 8.

Edition

Flash Professional 8.

Usage

my_FLVplybk.seekToPrevNavCuePoint([time:Number])

Parameters

time A number that is the starting time in seconds from which to look for the previous navigation cue point. The default is the current value of the playheadTime property. Optional.

Returns

Nothing.

Description

Method; seeks to the previous navigation cue point, based on the current value of the playheadTime property. It goes to the beginning if there is no previous cue point. The method skips navigation cue points that have been disabled.

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.

Example

The following example seeks to the previous navigation cue point when the point2 cue point occurs, creating a loop to play the FLV file.

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 listenerObject:Object = new Object();
listenerObject.cuePoint = function(eventObject:Object) {
        if(eventObject.info.name == "point2")
            my_FLVPlybk.seekToPrevNavCuePoint(eventObject.info.time);
}
my_FLVPlybk.addEventListener("cuePoint", listenerObject);

See also

FLVPlayback.cuePoint, FLVPlayback.findCuePoint(), FLVPlayback.playheadTime, FLVPlayback.seekToNavCuePoint(), FLVPlayback.seekToPrevNavCuePoint(), FLVPlayback.isFLVCuePointEnabled(), FLVPlayback.setFLVCuePointEnabled()