Onresize (Stage.onresize Event Listener) - MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE Reference

Flash lite 2.x actionscript language reference
Hide thumbs Also See for FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE:
Table of Contents

Advertisement

Example
This example creates a new listener object called
call
and define a function that will be called when
onResize
the code adds the
myListener
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
align (Stage.align property)
(Stage.width property)

onResize (Stage.onResize event listener)

onResize = function() {}
Invoked when
Stage.scaleMode
this event handler to write a function that lays out the objects on the Stage when a SWF file is
resized.
Availability: ActionScript 1.0; Flash Lite 2.0
Example
The following example displays a message in the Output panel when the Stage is resized:
Stage.scaleMode = "noScale"
var myListener:Object = 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
scaleMode (Stage.scaleMode property)
,
method)
removeListener (Stage.removeListener method)
622
ActionScript classes
stageListener
object to the callback list of the Stage object. Listener objects
,
scaleMode (Stage.scaleMode property)
is set to noScale and the SWF file is resized. You can use
,
addListener (Stage.addListener
. It then uses
myListener
is triggered. Finally,
onResize
,
to
width

Advertisement

Table of Contents
loading

Table of Contents