EasyManua.ls Logo

MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE - Addlistener (Stage.addlistener Method); Align (Stage.align Property)

MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE
780 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
620 ActionScript classes
addListener (Stage.addListener method)
public static addListener(listener:Object) : Void
Detects when a SWF file is resized (but only if Stage.scaleMode = "noScale"). The
addListener() method doesn't work with the default movie clip scaling setting (showAll)
or other scaling settings (
exactFit and noBorder).
To use
addListener(), you must first create a listener object. Stage listener objects receive
notification from
Stage.onResize.
Availability: ActionScript 1.0; Flash Lite 2.0
Parameters
listener:Object - An object that listens for a callback notification from the
Stage.onResize event.
Example
This example creates a new listener object called
stageListener. It then uses
stageListener to call onResize and define a function that will be called when onResize is
triggered. Finally, the code adds the
stageListener 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
onResize (Stage.onResize event listener), removeListener
(Stage.removeListener method)
align (Stage.align property)
public static align : String
Indicates the current alignment of the SWF file in the player or browser.

Table of Contents

Related product manuals