FLVPlayback.rewind

Availability

Flash Player 8.

Edition

Flash Professional 8.

Usage

var listenerObject:Object = new Object();
listenerObject.rewind = function(eventObject:Object):Void {
    // insert event-handling code here
};
my_FLVplybk.addEventListener("rewind", listenerObject);

Description

Event; dispatched when the location of the playhead moves backward by a call to seek() or when an automatic rewind completes.

The event object has the properties auto, state, and playheadTime. If the event results from a seek backward, the auto property is false. If it results from an automatic rewind, the auto property is true.

The playheadTime property is the destination time.

The stateChange event is dispatched with a state of "rewinding" when an automatic rewind occurs. The stateChange event does not start until rewinding has completed. The seek event is dispatched when rewinding occurs through seeking. The FLVPlayback instance also dispatches the playheadUpdate event when rewinding occurs.

The rewind event has the property vp, the index number of the video player to which this event applies. For more information on the vp property, see the FLVPlayback.activeVideoPlayerIndex and FLVPlayback.visibleVideoPlayerIndex properties.

Example

The following example sets the autoRewind property to true and listens for the rewind event. When the event occurs, the event handler shows the values of the vp, state, and playheadTime properties in the Output panel.

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.autoRewind = true;
var listenerObject:Object = new Object();
listenerObject.rewind = function(eventObject:Object) {
    trace("Video player is #" + eventObject.vp);
    trace("State is: " + eventObject.state);
    trace("Playhead time is: " + eventObject.playheadTime);
};
my_FLVPlybk.addEventListener("rewind", listenerObject);
my_FLVPlybk.contentPath = "http://www.helpexamples.com/flash/video/water.flv";

See also

FLVPlayback.activeVideoPlayerIndex, FLVPlayback.playheadTime, FLVPlayback.playheadUpdateFLVPlayback.seek(), FLVPlayback.seekPercent(), FLVPlayback.seekSeconds(), FLVPlayback.seekToNavCuePoint(), FLVPlayback.seekToPrevNavCuePoint(), FLVPlayback.state, FLVPlayback.stateChange