EasyManua.ls Logo

MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE - Name (Textfield._Name Property); Onchanged (Textfield.onchanged Handler)

MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE
780 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
666 ActionScript classes
Example
The following example creates a multiline text field called
myText.
this.createTextField("myText", this.getNextHighestDepth(), 10, 30, 110,
100);
myText.text = "Flash is an authoring tool that designers and developers use
to create presentations,
applications, and other content that enables user interaction.";
myText.border = true;
myText.wordWrap = true;
myText.multiline = true;
_name (TextField._name property)
public _name : String
The instance name of the text field.
Availability: ActionScript 1.0; Flash Lite 2.0
Example
The following example demonstrates text fields residing at different depths. Create a dynamic
text field on the Stage. Add the following ActionScript to your FLA or ActionScript file,
which dynamically creates two text fields at runtime and displays their depths in the Output
panel.
this.createTextField("first_mc", this.getNextHighestDepth(), 10, 10, 100,
22);
this.createTextField("second_mc", this.getNextHighestDepth(), 10, 10, 100,
22);
for (var prop in this) {
if (this[prop] instanceof TextField) {
var this_txt:TextField = this[prop];
trace(this_txt._name+" is a TextField at depth: "+this_txt.getDepth());
}
}
When you test the document, the instance name and depth is displayed in the Output
panel.When you test the document, the instance name and depth writes to the log file.
onChanged (TextField.onChanged handler)
onChanged = function(changedField:TextField) {}
Event handler/listener; invoked when the content of a text field changes. By default, it is
undefined; you can define it in a script.

Table of Contents

Related product manuals