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

Actionscript language reference
Table of Contents

Advertisement

Stage.removeListener()

Availability
Flash Player 6.
Usage
Stage.removeListener(myListener:Object) : Boolean
Parameters
An object added to an object's callback list with
myListener
Returns
A Boolean value.
Description
Method; removes a listener object created with
Example
The following example displays the Stage dimensions in a dynamically created text field. When
you resize the Stage, the values in the text field update. Create a button with an instance name
. Add the following ActionScript to Frame 1 of the Timeline.
remove_btn
this.createTextField("stageSize_txt", this.getNextHighestDepth(), 10, 10, 100,
22);
stageSize_txt.autoSize = true;
stageSize_txt.border = true;
var stageListener:Object = new Object();
stageListener.onResize = function() {
stageSize_txt.text = "w:"+Stage.width+", h:"+Stage.height;
};
Stage.addListener(stageListener);
remove_btn.onRelease = function() {
stageSize_txt.text = "Removing Stage listener...";
Stage.removeListener(stageListener);
}
Select Control > Test Movie to test this example. The values you see in the text field are updated
when you resize the testing environment. When you click
and the values are no longer updated in the text field.
See also
Stage.addListener()
782
Chapter 2: ActionScript Language Reference
addListener()
.
addListener()
remove_btn
.
, the listener is removed

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

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash mx

Table of Contents