Stage.addlistener() - MACROMEDIA FLASH MX 2004-ACTIONSCRIPT LANGUAGE Reference

Actionscript language reference
Table of Contents

Advertisement

Stage.addListener()

Availability
Flash Player 6.
Usage
Stage.addListener(myListener:Object) : Void
Parameters
An object that listens for a callback notification from the
myListener
Returns
Nothing.
Description
Method; detects when a SWF file is resized (but only if
addListener()
other scaling settings (
To use
addListener()
notification from
Example
This example creates a new listener object called
and define a function that will be called when
onResize
adds the
myListener
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
Stage.onResize,
778
Chapter 2: ActionScript Language Reference
method doesn't work with the default movie clip scaling setting (
and
exactFit
noBorder
, you must first create a listener object. Stage listener objects receive
.
Stage.onResize
object to the callback list of the Stage object. Listener objects allow multiple
Stage.removeListener()
Stage.scaleMode = "noScale"
).
. It then uses
stageListener
is triggered. Finally, the code
onResize
event.
Stage.onResize
). The
) or
showAll
to call
myListener

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH MX 2004-ACTIONSCRIPT LANGUAGE and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Flash mx

Table of Contents