Removelistener (Selection.removelistener Method) - MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE Reference

Actionscript 2.0 language reference
Table of Contents

Advertisement

Example
The following example demonstrates how to determine when input focus changes in a SWF
file between several dynamically created text fields. Enter the following ActionScript into a
FLA or AS file and then test the document:
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";
}
}
this.createTextField("status_txt", this.getNextHighestDepth(), 200, 10,
300, 100);
status_txt.html = true;
status_txt.multiline = true;
var someListener:Object = new Object();
someListener.onSetFocus = function(oldFocus, newFocus) {
status_txt.htmlText = "<b>setFocus triggered</b>";
status_txt.htmlText += "<textformat tabStops='[20,80]'>";
status_txt.htmlText += "&nbsp;\toldFocus:\t"+oldFocus;
status_txt.htmlText += "&nbsp;\tnewFocus:\t"+newFocus;
status_txt.htmlText += "&nbsp;\tgetFocus:\t"+Selection.getFocus();
status_txt.htmlText += "</textformat>";
};
Selection.addListener(someListener);
The
MovieClip.getNextHighestDepth()
7 or later. If your SWF file includes a version 2 component, use the version 2 components
DepthManager class instead of the
See also
addListener (Selection.addListener method)
method)

removeListener (Selection.removeListener method)

public static removeListener(listener:Object) : Boolean
Removes an object previously registered with
Availability: ActionScript 1.0; Flash Player 6
1076
ActionScript classes
method used in this example requires Flash Player
MovieClip.getNextHighestDepth()
,
setFocus (Selection.setFocus
Selection.addListener()
method.
.

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash 8

Table of Contents

Save PDF