align (Stage.align property)

public static align : String

Indicates the current alignment of the SWF file in the player or browser.

The following table lists the values for the align property. Any value not listed here centers the SWF file in Flash player or browser area, which is the default setting.

Value

Vertical

Horizontal

"T"

top

center

"B"

bottom

center

"L"

center

left

"R"

center

right

"TL"

top

left

"TR"

top

right

"BL"

bottom

left

"BR"

bottom

right

Availability: ActionScript 1.0; Flash Player 6

Example

The following example demonstrates different alignments of the SWF file. Add a ComboBox instance to your document with the instance name stageAlign_cb. Add the following ActionScript to your FLA or AS file:

var stageAlign_cb:mx.controls.ComboBox;
stageAlign_cb.dataProvider = ['T', 'B', 'L', 'R', 'TL', 'TR', 'BL', 'BR'];
var cbListener:Object = new Object();
cbListener.change = function(evt:Object) {
    var align:String = evt.target.selectedItem;
    Stage.align = align;
};
stageAlign_cb.addEventListener("change", cbListener);
Stage.scaleMode = "noScale";

Select different alignment settings from the ComboBox.