ActionScript 2.0 Components Language Reference |
|
|
|
| FLVPlayback Component > FLVPlayback class > FLVPlayback.contentPath | |||
Flash Player 8.
Flash Professional 8.
my_FLVPlybk.contentPath
Property; a string that specifies the URL of the FLV file to stream and how to stream it. The URL can be an HTTP URL to an FLV file, an RTMP URL to a stream, or an HTTP URL to an XML file.
If you set this property through the Component inspector or the Property inspector, the FLV file begins loading and playing at the next MovieClip.onEnterFrame event. The delay provides time to set the isLive, autoPlay, and cuePoints properties, among others, which affect loading. It also allows ActionScript that is placed on the first Frame to affect the FLVPlayback component before it starts playing.
If you set this property through ActionScript, the FLVPlayback instance closes the current FLV file and immediately begins loading the new FLV file. The autoPlay, totalTime, and isLive properties affect how the new FLV file is loaded, so if you set these properties, you must set them before setting contentPath property.
Set the autoPlay property to false to prevent the new FLV file from playing automatically.
The following example sets the contentPath property in ActionScript to specify the location of the FLV file to play.
Drag an FLVPlayback component to the Stage, and give it an instance name of my_FLVPlybk. Do not assign a value to the contentPath parameter in the Component inspector. Add the following code to Frame 1 of the Timeline:
/**
Requires:
- FLVPlayback component on the Stage with an instance name of my_FLVPlybk
*/
import mx.video.*;
my_FLVPlybk.contentPath = "http://www.helpexamples.com/flash/video/water.flv";
var listenerObject:Object = new Object();
listenerObject.metadataReceived = function(eventObject:Object):Void {
my_FLVPlybk.setSize(my_FLVPlybk.preferredWidth, my_FLVPlybk.preferredHeight);
}
my_FLVPlybk.addEventListener("metadataReceived", listenerObject);
FLVPlayback.autoPlay, FLVPlayback.isLive, FLVPlayback.play(), FLVPlayback.totalTime
|
|
|
|