User Guide

642 FLVPlayback Component (Flash Professional Only)
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.*;
// turn off autoSize and maintainAspectRatio
my_FLVPlybk.autoSize = false;
my_FLVPlybk.maintainAspectRatio = false;
// play this FLV
my_FLVPlybk.contentPath = "http://www.helpexamples.com/flash/video/
clouds.flv";
// add a cue point
my_FLVPlybk.addASCuePoint(3, "switch_here");
var listenerObject:Object = new Object();// create listener
listenerObject.cuePoint = function(eventObject:Object):Void {
// add a second video player
my_FLVPlybk.activeVideoPlayerIndex = 1;
// play this FLV
my_FLVPlybk.contentPath = "http://www.helpexamples.com/flash/video/
water.flv";
// change size of this video player
my_FLVPlybk.setSize(240, 180);
my_FLVPlybk.visibleVideoPlayerIndex = 1; // make it visible
my_FLVPlybk.play(); // play VLV
};
// add listener for cuePoint event
my_FLVPlybk.addEventListener("cuePoint", listenerObject);
listenerObject.resize = function(eventObject:Object):Void {
// display location and dimensions
trace("Video player is #" + my_FLVPlybk.activeVideoPlayerIndex);
trace("X coordinate is: " + eventObject.x);
trace("Y coordinate is: " + eventObject.y);
trace("Width is: " + eventObject.width);
trace("Height is: " + eventObject.height);
};
// add listener for resize event
my_FLVPlybk.addEventListener("resize", listenerObject);
See also
FLVPlayback.activeVideoPlayerIndex, FLVPlayback.autoSize, FLVPlayback.height,
FLVPlayback.maintainAspectRatio, FLVPlayback.preferredHeight,
FLVPlayback.preferredWidth, FLVPlayback.setSize(), FLVPlayback.state,
FLVPlayback.width, FLVPlayback.x, FLVPlayback.y