FLVPlayback.seekToPrevOffset

Availability

Flash Player 8.

Edition

Flash Professional 8.

Usage

my_FLVPlybk.seekToPrevOffset

Description

Property; the number of seconds that the seekToPrevNavCuePoint() method uses when it compares its time against the previous cue point. The method uses this value to ensure that, if you are just ahead of a cue point, you can hop over it to the previous one and avoid going to the same cue point that just occurred. Defaults to one second.

Example

The following example initially sets the seekToPrevOffset property to 10, causing the first call to the seekToPrevNavCuePoint() method to hit cue point point1. When the initial cuePoint event for point3 occurs, however, the example lowers the seekToPrevOffset property to 1 second, causing subsequent calls to the seekToPrevNavCuePoint() method to reach cue point point2.

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.ready = function(eventObject:Object) {
    my_FLVPlybk.seekToPrevOffset = 10;
    my_FLVPlybk.seekToNavCuePoint("point3");
}
my_FLVPlybk.addEventListener("ready", listenerObject)
var listenerObject:Object = new Object();
listenerObject.cuePoint = function(eventObject:Object) {
        trace("hit cue point at " + eventObject.info.time);
        if(eventObject.info.name == "point3"){
            my_FLVPlybk.seekToPrevNavCuePoint(eventObject.info.time);
            my_FLVPlybk.seekToPrevOffset = 1;
        }
}
my_FLVPlybk.addEventListener("cuePoint", listenerObject)

See also

FLVPlayback.seekToPrevNavCuePoint()