
TextField.addListener() Method
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
828
|
ActionScript Language Reference
The Var: text box in Flash MX’s text field Property inspector is retained for backward
compatibility, as is the
TextField.variable property. When authoring for Flash Player 6,
assign all text fields an instance name and use the
text property to access their content.
By default, Dynamic and Input text fields are selectable by the user. To create a nonselect-
able text field for display only, set its
selectable property to false:
output_txt.selectable = false;
When a user selects a portion of a dynamic or user-input text field, the indexes of the
selected characters are stored in the Selection object. Using the Selection object, we can
check which part of a text field a user has selected; we can even select a part of a text field
programmatically. The Selection object can also give keyboard focus to a particular text
field or tell us which text field is currently selected by the user. See Selection.onSetFocus(),
TextField.onKillFocus(), and TextField.onSetFocus().
For author-time text fields, many TextField object properties can be set through the Prop-
erty inspector interface; any options set at authoring time are reflected at runtime by the
corresponding TextField instance’s properties.
We can respond to changes in a text ...