FLVPlayback.setScale()

Availability

Flash Player 8.

Edition

Flash Professional 8.

Usage

my_FLVplybk.setScale(xs:Number, ys:Number) 

Parameters

xs A number representing the horizontal scale.

ys A number representing the vertical scale.

Returns

Nothing.

Description

Method; sets the scaleX and scaleY properties simultaneously. Because setting either one, individually, can cause automatic resizing, setting them simultaneously can be more efficient than setting the scaleX and scaleY properties, individually.

If autoSize is true, this method has no effect because the player sets its own dimensions. If the maintainAspectRatio property is true and autoSize is false, then changing scaleX or scaleY causes automatic resizing.

Example

The following example calls the setScale() method to scale the horizontal (x) and vertical (y) dimensions of the FLVPlayback instance. The example sets the maintainAspectRatio property to false to prevent automatic resizing and allow the scaling to appear as specified.

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.*;

my_FLVPlybk.maintainAspectRatio = false;
my_FLVPlybk.setScale(200, 175);
my_FLVPlybk.contentPath = "http://www.helpexamples.com/flash/video/water.flv";

See also

FLVPlayback.scaleX, FLVPlayback.scaleY, FLVPlayback.setSize()


Flash CS3