S > Stage.addListener |
Stage.addListener
Stage, Stage.addListener, addListener
Availability
Flash Player 6.
Usage
Stage.addListener(myListener)
Parameters
myListener An object that listens for a callback notification from the onResize event.
Returns
Nothing.
Description
Method; detects when a Flash movie is resized if Stage.scaleMode = "noScale". The addListener method doesn't work with the default movie scaling setting ("showAll") or other scaling settings ("exactFit", and "noBorder").
To use addListener, you must first create a listener object. A listener object is an object that receives notification from an event when that event is triggered in a movie. Listener objects of the Stage object receive notification from Stage.onResize.
Example
This example creates a new listener object called myListener. It then uses myListener to call onResize and define a function that will be called when onResize is triggered. Finally, the code adds the myListener object to the callback list of the Stage object. Listener objects allow multiple objects to listen for resize notifications.
myListener = new Object();
myListener.onResize = function () { ... }
Stage.addListener(myListener);