FLVPlayback.paused

Availability

Flash Player 8.

Edition

Flash Professional 8.

Usage

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

Description

Event; dispatched when the player enters the paused state. This happens when you call the pause() method or click the corresponding control and it also happens in some cases when the FLV file is loaded if autoPlay is false (the state may be stopped instead). The event object has the properties state, playheadTime, and vp, which is the index number of the video player to which this event applies. For more information on the vp property, see FLVPlayback.activeVideoPlayerIndex and FLVPlayback.visibleVideoPlayerIndex.

The stateChange event is also dispatched.

Example

The following example creates a listener for the playheadUpdate event. When the event occurs, the event handler checks to see whether the playheadTime property is between 5 and 5.05 seconds. If so, the event handler calls the pause() method to suspend playing the FLV file. This triggers a paused event for which the paused event handler shows, "The FLV is paused!"

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.playheadUpdateInterval = 5;
var listenerObject:Object = new Object();
listenerObject.playheadUpdate = function(eventObject:Object):Void {
    if ((eventObject.playheadTime >= 5) && (eventObject.playheadTime < 5.05)) {
        my_FLVPlybk.pause();
    }
}
my_FLVPlybk.addEventListener("playheadUpdate", listenerObject);
listenerObject.paused = function(eventObject:Object) {
    trace("FLV is " + my_FLVPlybk.state + "!");
};
my_FLVPlybk.addEventListener("paused", listenerObject);
my_FLVPlybk.contentPath = "http://www.helpexamples.com/flash/video/water.flv";

See also

FLVPlayback.pause(), FLVPlayback.paused, FLVPlayback.state, FLVPlayback.stateChange