03.05.2013 Views

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

stageListener.onResize = function() {<br />

stageSize_txt.text = "w:"+Stage.width+", h:"+Stage.height;<br />

};<br />

Stage.scaleMode = "noScale";<br />

Stage.addListener(stageListener);<br />

See also<br />

onResize (Stage.onResize event listener), removeListener<br />

(Stage.removeListener method)<br />

align (Stage.align property)<br />

public static align : String<br />

Indicates the current alignment of the SWF file in the player or browser.<br />

The following table lists the values for the align property. Any value not listed here centers<br />

the SWF file in Flash player or browser area, which is the default setting.<br />

Value Vertical Horizontal<br />

"T" top center<br />

"B" bottom center<br />

"L" center left<br />

"R" center right<br />

"TL" top left<br />

"TR" top right<br />

"BL" bottom left<br />

"BR" bottom right<br />

Availability: <strong>ActionScript</strong> 1.0; Flash Player 6<br />

Example<br />

The following example demonstrates different alignments of the SWF file. Add a ComboBox<br />

instance to your document with the instance name stageAlign_cb. Add the following<br />

<strong>ActionScript</strong> to your FLA or AS file:<br />

var stageAlign_cb:mx.controls.ComboBox;<br />

stageAlign_cb.dataProvider = ['T', 'B', 'L', 'R', 'TL', 'TR', 'BL', 'BR'];<br />

var cbListener:Object = new Object();<br />

cbListener.change = function(evt:Object) {<br />

var align:String = evt.target.selectedItem;<br />

Stage.align = align;<br />

};<br />

Stage 1137

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!