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.

Returns<br />

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

listener was not successfully removed (for example, if listener was not on the TextField<br />

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

Example<br />

The following example creates an input text field called my_txt. When the user types into the<br />

field, information about the number of characters in the text field is displayed in the Output<br />

panel. When the user types into the field, information about the number of characters in the<br />

text field writes to the log file. If the user clicks the removeListener_btn instance, then the<br />

listener is removed <strong>and</strong> information is no longer displayed. If the user clicks the<br />

removeListener_btn instance, then the listener is removed <strong>and</strong> information no longer writes<br />

to the log file.<br />

this.createTextField("my_txt", this.getNextHighestDepth(), 10, 10, 160,<br />

20);<br />

my_txt.border = true;<br />

my_txt.type = "input";<br />

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

txtListener.onChanged = function(textfield_txt:TextField) {<br />

trace(textfield_txt+" changed. Current length is:<br />

"+textfield_txt.length);<br />

};<br />

my_txt.addListener(txtListener);<br />

removeListener_btn.onRelease = function() {<br />

trace("Removing listener...");<br />

if (!my_txt.removeListener(txtListener)) {<br />

trace("Error! Unable to remove listener");<br />

}<br />

};<br />

(<br />

removeTextField (TextField.removeTextField<br />

method)<br />

public removeTextField() : Void<br />

Removes the text field. This operation can only be performed on a text field that was created<br />

with MovieClip.createTextField(). When you call this method, the text field is removed.<br />

This method is similar to MovieClip.removeMovieClip().<br />

TextField 635

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

Saved successfully!

Ooh no, something went wrong!