Flash CS3 Documentation |
|||
| ActionScript 2.0 Components Language Reference > FLVPlayback Component > FLVPlayback class > FLVPlayback.visibleVideoPlayerIndex | |||
Flash Player 8.
Flash Professional 8.
my_FLVPlybk.visibleVideoPlayerIndex
Property; a number that you can use to manage multiple FLV file streams. Sets which video player instance is visible, audible, and controlled by the skin or playback controls, while the the rest of the video players are hidden and muted. The default is 0. It does not make the video player the target for most APIs; use the activeVideoPlayerIndex property instead.
Methods and properties that control dimensions interact with this property. The methods and properties that set the dimensions of the video player (setScale(), setSize(), width, height, scaleX, scaleY) can be used for all video players. However, depending on whether autoSize or maintaintAspectRatio are set on those video players, they might have different dimensions. Reading the dimensions using the width, height, scaleX, and scaleY properties gives you the dimensions only of the visible video player. Other video players might have the same dimensions or might not.
To get the dimensions of various video players when they are not visible, listen for the resize event, and store the size value.
This property does not have any implications for visibility of the component as a whole, only which video player is visible when the component is visible. To set visibility for the entire component, use the visible property.
The following example creates two video players to play two FLV files consecutively in a single FLVPlayback instance. It sets the visibleVideoPlayerIndex property to make the video players and the FLV files visible.
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);
FLVPlayback.activeVideoPlayerIndex, FLVPlayback.setScale(), FLVPlayback.setSize(), FLVPlayback.height, FLVPlayback.width, FLVPlayback.scaleX, FLVPlayback.scaleY, FLVPlayback.visible
Flash CS3