Flash CS3 Documentation |
|||
| ActionScript 2.0 Components Language Reference > FLVPlayback Component > FLVPlayback class > FLVPlayback.stateChange | |||
Flash Player 8.
Flash Professional 8.
varlistenerObject:Object = new Object();listenerObject.stateChange = function(eventObject:Object):Void {// insert event-handling code here}; my_FLVplybk.addEventListener("stateChange",listenerObject);
Event; dispatched when playback state changes. The event object has properties state and playheadTime.
This event can be used to track when playback enters or leaves unresponsive states (such as in the middle of connecting, resizing, or rewinding) during which times the play(), pause(), stop(), and seek() methods queue the requests to be executed when the player enters a responsive state.
The event has the property 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 following example shows the state property in the Output panel each time the stateChange event occurs while the FLV file plays.
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.stateChange = function(eventObject:Object):Void {
trace(my_FLVPlybk.state);
};
my_FLVPlybk.addEventListener("stateChange", listenerObject);
my_FLVPlybk.contentPath = "http://www.helpexamples.com/flash/video/water.flv";
FLVPlayback.addEventListener(), FLVPlayback.state
Flash CS3