FLVPlayback.width

Availability

Flash Player 8.

Edition

Flash Professional 8.

Usage

my_FLVPlybk.width

Description

Property; a number that specifies the width of the FLVPlayback instance on the Stage. This property affects only the width of the FLVPlayback instance and does not include the width of a skin SWF file that might be loaded. Use the FLVPlayback width property and not the MovieClip._width property because the _width property might give a different value if a skin SWF file is loaded.

Example

The following example sets the width and height properties, which causes a resize event because the default value of the maintainAspectRatio property is true. When the event occurs, the event handler shows the width and height of the resized FLVPlayback instance in the Output panel.

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.*;
// maintainAspectRatio (true by default) affects the actual dimensions
my_FLVPlybk.width = 400;
my_FLVPlybk.height = 350;
var listenerObject:Object = new Object();
listenerObject.resize = function(eventObject:Object) {
    trace("Width is: " + eventObject.target.width + " Height is: " + eventObject.target.height);
};
my_FLVPlybk.addEventListener("resize", listenerObject);
my_FLVPlybk.contentPath = "http://www.helpexamples.com/flash/video/water.flv";

See also

FLVPlayback.height, FLVPlayback.setSize(), FLVPlayback.preferredHeight, FLVPlayback.preferredWidth

Flash CS3