
Stage.onResize() Listener Event
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
796
|
ActionScript Language Reference
In Test Movie mode, the height of the movie is reported as four pixels less than actual size.
Example
The following code creates a text field and centers it on stage:
Stage.scaleMode = "noScale";
Stage.align = "LT";
this.createTextField("theField_txt", 1, 0, 0, 200, 20);
theField_txt.text = "Derek got a haircut.";
theField_txt._x = Stage.width/2 - theField_txt._width/2;
theField_txt._y = Stage.height/2 - theField_txt._height/2;
See Also
MovieClip.createTextField(), MovieClip._height, Stage.addListener(), Stage.onResize(),
Stage.width, the TextField class
Stage.onResize() Listener Event
invoked when the movie is resized
Flash 6
listenerObject.onResize()
Description
The onResize() event is triggered when Stage.scaleMode is set to “noScale” and the Player
dimensions change. The Player dimensions change when either:
• The Standalone Player is resized by the user or in response to an fscommand
("fullscreen", "true") call.
• The user resizes a browser window containing a movie embedded using percentage
values for the
OBJECT/EMBED tag’s HEIGHT or WIDTH attributes.
The onResize() event lets us dynamically reposition elements in a movie, relative to the
currently available space. We can use this ability to create “stretchy” layouts that ...