FLVPlayback.stopped

Availability

Flash Player 8.

Edition

Flash Professional 8.

Usage

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

Description

Event; dispatched when entering the stopped state. This happens when you call the stop() method or click the stopButton control. It also happens, in some cases, if the autoPlay property is false (the state might become paused instead) when the FLV file is loaded. The FLVPlayback instance also dispatches this event when the playhead stops at the end of the FLV file. The event object has the properties state, playheadTime, and vp, which is the index number of the video player to which the event applies. For more information on the vp property, see FLVPlayback.activeVideoPlayerIndex and FLVPlayback.visibleVideoPlayerIndex.

The FLVPlayback instance also dispatches the stateChange event.

Example

The following example listens for occurrences of the stopped event as it occurs while the FLV file plays. When the event occurs the example shows the elapsed playhead time 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.*;
var listenerObject:Object = new Object();
listenerObject.stopped = function(eventObject:Object):Void {
    trace(my_FLVPlybk.state + ": playhead time is: " + eventObject.playheadTime);
};
my_FLVPlybk.addEventListener("stopped", listenerObject);
my_FLVPlybk.contentPath = "http://www.helpexamples.com/flash/video/water.flv";

See also

FLVPlayback.addEventListener(), FLVPlayback.playheadTime, FLVPlayback.state, FLVPlayback.stateChange, FLVPlayback.stop()