
TextField._parent Property
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
Alphabetical Language Reference
|
857
Example
The following code uses onSetFocus() and onKillFocus() to highlight a field with color
when it is focused, providing a nice interface cue for the user:
this.createTextField("userName_txt", 1, 0, 0, 200, 20);
userName_txt.type = "input";
userName_txt.border = true;
userName_txt.background = true;
userName_txt.backgroundColor = 0xA4660B;
userName_txt.onSetFocus = function (oldFocus) {
this.backgroundColor = 0xF5BF70;
}
userName_txt.onKillFocus = function (newFocus) {
this.backgroundColor = 0xA4660B;
}
To apply this effect to all text fields in a movie, use:
TextField.prototype.onSetFocus = function (oldFocus) {
this.backgroundColor = 0xF5BF70;
}
TextField.prototype.onKillFocus = function (newFocus) {
this.backgroundColor = 0xA4660B;
}
See Also
Selection.onSetFocus(), Selection.setFocus(), TextField.background, TextField.
backgroundColor
, TextField.onKillFocus(), TextField.selectable, TextField.tabEnabled,
TextField.tabIndex, TextField.type; Chapter 10
TextField._parent Property
a reference to the movie clip in which the text field resides
Flash 6
read/write (write has no meaningful effect)
theField._parent
Description
The _parent property is an object reference to the movie clip that contains theField. For
example, if we have a