scaleMode (Stage.scaleMode property)

public static scaleMode : String

Indicates the current scaling of the SWF file within Flash Player. The scaleMode property forces the SWF file into a specific scaling mode. By default, the SWF file uses the HTML parameters set in the Publish Settings dialog box.

The scaleMode property can use the values "exactFit", "showAll", "noBorder", and "noScale". Any other value sets the scaleMode property to the default "showAll".

Note: the default setting is showAll, except when in test movie mode, where the default setting is noScale

Availability: ActionScript 1.0; Flash Player 6

Example

The following example demonstrates various scale settings for the SWF file. Add a ComboBox instance to your document with the instance name scaleMode_cb. Add the following ActionScript to your FLA or AS file:

var scaleMode_cb:mx.controls.ComboBox;
scaleMode_cb.dataProvider = ["showAll", "exactFit", "noBorder", "noScale"];
var cbListener:Object = new Object();
cbListener.change = function(evt:Object) {
    var scaleMode_str:String = evt.target.selectedItem;
    Stage.scaleMode = scaleMode_str;
};
scaleMode_cb.addEventListener("change", cbListener);

For another example, see the Flash Samples page at www.adobe.com/go/learn_fl_samples. Download and decompress the Samples zip file and go to the ActionScript2.0\StageSize folder to access the stagesize.fla file.


Flash CS3


 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/flash/9.0/main/00002154.html