MACROMEDIA FLEX-FLEX ACTIONSCRIPT LANGUAGE Reference page 737

Actionscript language reference
Table of Contents

Advertisement

A reference to the text field instance is passed as a parameter to the
capture this data by putting a parameter in the event handler method. For example, the following
code uses
textfield_txt
parameter is then used in a
file:
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
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
event because the code recognizes changes that are made to the text field.
onChanged
TextField.onKillFocus
Availability
Flash Player 6.
Usage
my_txt.onKillFocus = function(newFocus:Object){
// your statements here
}
Parameters
The object that is receiving the focus.
newFocus
Returns
Nothing.
Description
Event handler; invoked when a text field loses keyboard focus. The
one parameter,
newFocus
no object receives the focus,
Example
The following example creates two text fields called
focus to a text field, information about the text field with current focus and the text field that lost
focus writes to the log file.
this.createTextField("first_txt", 1, 10, 10, 300, 20);
first_txt.border = true;
first_txt.type = "input";
this.createTextField("second_txt", 2, 10, 40, 300, 20);
as the parameter that is passed to the
method to write the instance name of the text field to the log
trace()
handler is fired only when the change results from user interaction; for example,
, which is an object representing the new object receiving the focus. If
newFocus
contains the value
null
first_txt
handler. You can
onChanged
event handler. The
onChanged
method receives
onKillFocus
.
and
. When you give
second_txt
TextField.onKillFocus
737

Advertisement

Table of Contents
loading
Need help?

Need help?

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

This manual is also suitable for:

Flex

Table of Contents