User Guide
620 FLVPlayback Component (Flash Professional Only)
Example
The following example creates a listener for the stateChange event. When the event occurs,
it checks the
paused property to determine whether the component is in the paused state. If
so, it shows a message to that effect in the Output panel. You must click the Pause button
while the FLV file is playing to cause the paused state to occur.
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) {
if(my_FLVPlybk.paused)
trace("FLV is in " + FLVPlayback.PAUSED + " state");
};
my_FLVPlybk.addEventListener("stateChange", listenerObject);
my_FLVPlybk.contentPath = "http://www.helpexamples.com/flash/video/
water.flv";
See also
FLVPlayback.paused, FLVPlayback.PAUSED, FLVPlayback.state,
FLVPlayback.stateChange
FLVPlayback.play()
Availability
Flash Player 8.
Edition
Flash Professional 8.
Usage
my_FLVplybk.play ([contentPath:String, totalTime:Number, isLive:Boolean])
Parameters
contentPath A string that specifies the URL of the FLV file to stream and how to stream it.
The URL can be a local path, an HTTP URL to an FLV file, an RTMP URL to an FLV file
stream, or an HTTP URL to an XML file. It is optional, but the
contentPath property must
be set either through the Component inspector or through ActionScript, or this method has
no effect.