Stage.onResize

Availability

Flash Player 6.

Usage

myListener.onResize = function(){
  // your statements here
}

Parameters

None.

Parameters

None.

Returns

Nothing.

Description

Event handler; invoked when Stage.scaleMode is set to "noScale" and the SWF file is resized. You can use this event handler to write a function that lays out the objects on the Stage when a SWF file is resized.

Example

The following example displays a message in the Output panel when the Stage is resized.

Stage.scaleMode = "noScale"
myListener = new Object();
myListener.onResize = function () {
  trace("Stage size is now " + Stage.width + " by " + Stage.height);
}
Stage.addListener(myListener);
// later, call Stage.removeListener(myListener)

See also

Stage.addListener(), Stage.removeListener()