Flash CS3 Documentation |
|||
| ActionScript 2.0 Components Language Reference > FLVPlayback Component > FLVPlayback class > FLVPlayback.getVideoPlayer() | |||
Flash Player 8.
Flash Professional 8.
my_FLVplybk.getVideoPlayer(index:Number)
A VideoPlayer object.
Method; gets the video player specified by index. When possible, it is best to access VideoPlayer methods and properties using FLVPlayback methods and properties. Each VideoPlayer._name property is its index.
The following example uses two video players to play two FLV files. When the second FLV file triggers the ready event, the example calls the getVideoPlayer() method to obtain video player number 1 and set its _alpha property to 50. This causes the FLV file (plane_cuepoints) in that player to be transparent and makes both FLV files visible simultaneously.
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
*/
my_FLVPlybk.load("http://www.helpexamples.com/flash/video/cuepoints.flv");
var listenerObject:Object = new Object();
listenerObject.ready = function(eventObject:Object) {
if (eventObject.target.contentPath == "http://www.helpexamples.com/flash/video/cuepoints.flv") {
//this fires after the first flv is ready
my_FLVPlybk.activeVideoPlayerIndex = 1;
my_FLVPlybk.load("http://www.helpexamples.com/flash/video/plane_cuepoints.flv");
} else {
//this fires after the second flv is ready
eventObject.target.activeVideoPlayerIndex = 0;
eventObject.target.play();
eventObject.target.activeVideoPlayerIndex = 1;
eventObject.target.play();
var layerOnTop:MovieClip = eventObject.target.getVideoPlayer(1);
layerOnTop._alpha = 50;
layerOnTop._visible = true;
}
}
my_FLVPlybk.addEventListener("ready", listenerObject);
FLVPlayback.activeVideoPlayerIndex, FLVPlayback.bringVideoPlayerToFront(), FLVPlayback.visibleVideoPlayerIndex
Flash CS3