Parameters
A number that specifies the width of the video player.
w
A number that specifies the height of the video player.
h
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
and
width
height
If
is
, this method has no effect because the player sets its own dimensions. If
autoSize
true
the
maintainAspectRatio
or height causes automatic resizing.
Example
The following example calls the
instance to a width of 150 pixels and a height of 150 pixels. The
the actual width and height because the
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
670
FLVPlayback Component (Flash Professional Only)
properties individually.
is
and the
true
setSize()
maintainAspectRatio
,
FLVPlayback.width
property is
autoSize
method to set the size of the FLVPlayback
resize
property is
,
FLVPlayback.setScale()
, changing the width
false
event handler shows
by default,
true
Need help?
Do you have a question about the FLASH 8-COMPONENTS LANGUAGE and is the answer not in the manual?
Questions and answers