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

Actionscript language reference
Table of Contents

Advertisement

TextField.removeListener()

Availability
Flash Player 6.
Usage
my_txt.removeListener(listener:Object)
Parameters
The object that will no longer receive notifications from
listener
TextField.onScroller.
Returns
If
was successfully removed, the method returns a
listener
successfully removed (for example, if
method returns a value of
Description
Method; removes a listener object previously registered to a text field instance with
TextField.addListener().
Example
The following example creates an input text field called
field, information about the number of characters in the text field is displayed in the Output
panel. If the user clicks the
information is no longer displayed.
this.createTextField("my_txt", this.getNextHighestDepth(), 10, 10, 160, 20);
my_txt.border = true;
my_txt.type = "input";
var txtListener:Object = new Object();
txtListener.onChanged = function(textfield_txt:TextField) {
trace(textfield_txt+" changed. Current length is: "+textfield_txt.length);
};
my_txt.addListener(txtListener);
removeListener_btn.onRelease = function() {
trace("Removing listener...");
if (!my_txt.removeListener(txtListener)) {
trace("Error! Unable to remove listener");
}
};
was not on the TextField object's listener list), the
listener
.
false
removeListener_btn
TextField.onChanged
value. If
true
. When the user types into the
my_txt
instance, then the listener is removed and
TextField.removeListener()
or
was not
listener
909

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