Selection.removeListener()
Availability
Flash Player 6.
Usage
Selection.removeListener(listener:Object)
Parameters
The object that will no longer receive focus notifications.
listener
Returns
If
was successfully removed, the method returns a
listener
successfully removed—for example, if
the method returns a value of
Description
Method; removes an object previously registered with Selection.addListener().
Example
The following ActionScript dynamically creates several text field instances. When you select a text
field, information displays in the Output panel. When you click the
listener is removed and information no longer displays in the Output panel.
this.createTextField("one_txt", 1, 0, 0, 100, 22);
this.createTextField("two_txt", 2, 0, 25, 100, 22);
this.createTextField("three_txt", 3, 0, 50, 100, 22);
this.createTextField("four_txt", 4, 0, 75, 100, 22);
for (var i in this) {
if (this[i] instanceof TextField) {
this[i].border = true;
this[i].type = "input";
}
}
var selectionListener:Object = new Object();
selectionListener.onSetFocus = function(oldFocus, newFocus) {
trace("Focus shifted from "+oldFocus+" to "+newFocus);
};
Selection.addListener(selectionListener);
remove_btn.onRelease = function() {
trace("removeListener invoked");
Selection.removeListener(selectionListener);
};
See Also
Selection.addListener()
was not on the Selection object's listener list—
listener
.
false
value. If
true
listener
instance, the
remove_btn
Selection.removeListener()
was not
723
Need help?
Do you have a question about the FLASH MX 2004-ACTIONSCRIPT LANGUAGE and is the answer not in the manual?