FLVPlayback.load()

Availability

Flash Player 8.

Edition

Flash Professional 8.

Usage

my_FLVplybk.load(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.

totalTime A number that is the total playing time for the video. Optional.

isLive A Boolean value that is true if the video stream is live. This value is effective only when streaming from FVSS or FMS. The value of this property is ignored for an HTTP download. Optional.

Returns

Nothing.

Description

Method; begins loading the FLV file and provides a shortcut for setting the autoPlay property to false and setting the contentPath, totalTime, and isLive properties, if given. If the totalTime and isLive properties are undefined, they are not set. If the contentPath property is undefined, null, or an empty string, this method does nothing.

Example

The following example calls the load() method to load an FLV file that is specified by the contentPath parameter. It shows the value of the autoPlay property before and after loading the FLV file and calls the play() method to begin playing the FLV file.

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.*;
trace("Before load, autoPlay is: " + my_FLVPlybk.autoPlay);
my_FLVPlybk.load("http://www.helpexamples.com/flash/video/water.flv");
trace("After load, autoPlay is: " + my_FLVPlybk.autoPlay);
my_FLVPlybk.play();

See also

FLVPlayback.contentPath, FLVPlayback.isLive, FLVPlayback.totalTime