User Guide
TextField 667
A reference to the text field instance is passed as a parameter to the onChanged handler. You
can capture this data by putting a parameter in the event handler method. For example, the
following code uses
textfield_txt as the parameter that is passed to the onChanged event
handler. The parameter is then used in a
trace() statement to send the instance name of the
text field to the Output panel:
this.createTextField("myInputText_txt", 99, 10, 10, 300, 20);
myInputText_txt.border = true;
myInputText_txt.type = "input";
myInputText_txt.onChanged = function(textfield_txt:TextField) {
trace("the value of "+textfield_txt._name+" was changed. New value is:
"+textfield_txt.text);
};
The onChanged handler is called only when the change results from user interaction; for
example, when the user is typing something on the keyboard, changing something in the text
field using the mouse, or selecting a menu item. Programmatic changes to the text field do not
trigger the
onChanged event because the code recognizes changes that are made to the text
field.
Availability: ActionScript 1.0; Flash Lite 2.0
Parameters
changedField:TextField - The field triggering the event.
See also
TextFormat, setNewTextFormat (TextField.setNewTextFormat method)
onKillFocus (TextField.onKillFocus handler)
onKillFocus = function(newFocus:Object) {}
Invoked when a text field loses keyboard focus. The onKillFocus method receives one
parameter,
newFocus, which is an object representing the new object receiving the focus. If no
object receives the focus,
newFocus contains the value null.
Availability: ActionScript 1.0; Flash Lite 2.0
Parameters
newFocus:Object - The object that is receiving the focus.