Stage
1121
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.
height (Stage.height property)
public static height : Number
Property (read-only); indicates the current height, in pixels, of the Stage. When the value of
Stage.scaleMode
is noScale, the height property represents the height of Flash Player. When
the value of
Stage.scaleMode
is not noScale, height represents the height of the SWF file.
Availability:
ActionScript 1.0; Flash Player 6
Example
This example creates a new listener object called
stageListener
. It then uses
myListener
to
call
onResize
and define a function that will be called when
onResize
is triggered. Finally,
the code adds the
myListener
object to the callback list of the Stage object. Listener objects
allow multiple objects to listen for resize notifications.
this.createTextField("stageSize_txt", this.getNextHighestDepth(), 10, 10,
100, 22);
var stageListener:Object = new Object();
stageListener.onResize = function() {
stageSize_txt.text = "w:"+Stage.width+", h:"+Stage.height;
};
Stage.scaleMode = "noScale";
Stage.addListener(stageListener);
See also
align (Stage.align property)
,
scaleMode (Stage.scaleMode property)
,
width
(Stage.width property)
Содержание FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE
Страница 1: ...ActionScript 2 0 Language Reference ...
Страница 1352: ...1352 ActionScript classes ...