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.*;
// specify name and location of FLV for default player
my_FLVPlybk.contentPath = "http://www.helpexamples.com/flash/video/
clouds.flv";
var listenerObject:Object = new Object();
listenerObject.ready = function(eventObject:Object):Void {
// add a second video player and specify the name and loc of its FLV
my_FLVPlybk.activeVideoPlayerIndex = 1;
my_FLVPlybk.contentPath = "http://www.helpexamples.com/flash/video/
water.flv";
// reset to default video player, which plays its FLV automatically
my_FLVPlybk.activeVideoPlayerIndex = 0;
};
my_FLVPlybk.addEventListener("ready", listenerObject);
listenerObject.complete = function(eventObject:Object):Void {
// if complete is for 2nd FLV, make default active and visible
if (eventObject.vp == 1) {
my_FLVPlybk.activeVideoPlayerIndex = 0;
my_FLVPlybk.visibleVideoPlayerIndex = 0;
}
else { // make 2nd player active & visible and play FLV
my_FLVPlybk.activeVideoPlayerIndex = 1;
my_FLVPlybk.visibleVideoPlayerIndex = 1;
my_FLVPlybk.play();
}
};
// add listener for complete event
my_FLVPlybk.addEventListener("complete", listenerObject);
See also
FLVPlayback.bringVideoPlayerToFront()
VideoPlayer class
,
FLVPlayback.visibleVideoPlayerIndex
,
FLVPlayback.getVideoPlayer()
,
,
FLVPlayback class
551
Need help?
Do you have a question about the FLASH 8-COMPONENTS LANGUAGE and is the answer not in the manual?
Questions and answers