
Stage.align Property
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
794
|
ActionScript Language Reference
Example
The following code assigns an onResize() method to the ball_mc movie clip and registers
the clip to respond to the onResize() event. Note that
Stage.scaleMode must be set to
“noScale” in order for the onResize() event to be triggered:
Stage.align = "LT";
Stage.scaleMode = "noScale";
ball_mc.onResize = function () {
// Place ball_mc in the center of the Stage (assumes that
// ball_mc's content is centered on its registration point).
// Inside the method, 'this' refers to ball_mc.
this._x = Stage.width/2;
this._y = Stage.height/2;
}
Stage.addListener(ball_mc);
See Also
Stage.onResize(), Stage.removeListener(), Stage.scaleMode; Chapter 10
Stage.align Property
alignment of the movie within the Flash Player
Flash 6
read/write
Stage.align
Description
When a movie is embedded in a web page, the HTML OBJECT and EMBED tags can specify
dimensions that do not match those of the Flash document. When the movie is displayed
in the Standalone Player, the Player can be resized by the user. In both cases, the string
align property dictates the positioning of the movie, relative to the space available to the
Flash Player. By default,
align is the empty string, indicating that the movie should be
centered horizontally and vertically in the Player. ...