03.05.2013 Views

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

}<br />

}<br />

this.createTextField("status_txt", this.getNextHighestDepth(), 200, 10,<br />

300, 100);<br />

status_txt.html = true;<br />

status_txt.multiline = true;<br />

var someListener:Object = new Object();<br />

someListener.onSetFocus = function(oldFocus, newFocus) {<br />

status_txt.htmlText = "setFocus triggered";<br />

status_txt.htmlText += "";<br />

status_txt.htmlText += "&nbsp;\toldFocus:\t"+oldFocus;<br />

status_txt.htmlText += "&nbsp;\tnewFocus:\t"+newFocus;<br />

status_txt.htmlText += "&nbsp;\tgetFocus:\t"+Selection.getFocus();<br />

status_txt.htmlText += "";<br />

};<br />

Selection.addListener(someListener);<br />

See also<br />

addListener (Selection.addListener method), setFocus (Selection.setFocus<br />

method)<br />

removeListener (Selection.removeListener method)<br />

public static removeListener(listener:Object) : Boolean<br />

Removes an object previously registered with the Selection.addListener() method.<br />

Parameters<br />

listener:Object - The object that no longer receives focus notifications.<br />

Returns<br />

Boolean - If the listener object was successfully removed, the method returns a true value.<br />

If the listener object was not successfully removed—for example, if listener was not on<br />

the Selection object's listener list—the method returns a value of false.<br />

Example<br />

The following ActionScript dynamically creates several text field instances. When you select a<br />

text field, information appears in the Output panel. When you click the remove_btn<br />

instance, the listener is removed <strong>and</strong> information no longer appears in the Output panel.<br />

this.createTextField("one_txt", 1, 0, 0, 100, 22);<br />

this.createTextField("two_txt", 2, 0, 25, 100, 22);<br />

this.createTextField("three_txt", 3, 0, 50, 100, 22);<br />

Selection 547

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!