User Guide

670 FLVPlayback Component (Flash Professional Only)
Parameters
w A number that specifies the width of the video player.
h A number that specifies the height of the video player.
Returns
Nothing.
Description
Method; sets the width and height simultaneously. Because setting either one, individually,
can cause automatic resizing, setting them simultaneously can be more efficient than setting
the
width and height properties individually.
If
autoSize is true, this method has no effect because the player sets its own dimensions. If
the
maintainAspectRatio is true and the autoSize property is false, changing the width
or height causes automatic resizing.
Example
The following example calls the setSize() method to set the size of the FLVPlayback
instance to a width of 150 pixels and a height of 150 pixels. The
resize event handler shows
the actual width and height because the
maintainAspectRatio property is true by default,
so an automatic resizing maintains the aspect ratio.
Drag the 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_FLVPlybkh
*/
import mx.video.*;
// maintainAspectRatio is true by default so dimensions will reflect that
my_FLVPlybk.setSize(150, 150);
var listenerObject:Object = new Object();
listenerObject.resize = function(eventObject:Object):Void {
trace("Player's width is: " + my_FLVPlybk.width)
trace("Player's height is: " + my_FLVPlybk.height)
};
my_FLVPlybk.addEventListener("resize", listenerObject);
my_FLVPlybk.contentPath = "http://www.helpexamples.com/flash/video/
water.flv";
See also
FLVPlayback.height, FLVPlayback.width, FLVPlayback.setScale()