03.05.2013 Views

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Indicates whether the text field is a multiline text field. If the value is true, the text field is<br />

multiline; if the value is false, the text field is a single-line text field.<br />

Example<br />

The following example creates a multiline text field called myText.<br />

this.createTextField("myText", this.getNextHighestDepth(), 10, 30, 110,<br />

100);<br />

myText.text = "Flash is an authoring tool that designers <strong>and</strong> developers use<br />

to create presentations,<br />

applications, <strong>and</strong> other content that enables user interaction.";<br />

myText.border = true;<br />

myText.wordWrap = true;<br />

myText.multiline = true;<br />

_name (TextField._name property)<br />

public _name : String<br />

The instance name of the text field.<br />

Example<br />

The following example demonstrates text fields residing at different depths. Create a dynamic<br />

text field on the Stage. Add the following ActionScript to your FLA or ActionScript file,<br />

which dynamically creates two text fields at runtime <strong>and</strong> displays their depths in the Output<br />

panel.<br />

this.createTextField("first_mc", this.getNextHighestDepth(), 10, 10, 100,<br />

22);<br />

this.createTextField("second_mc", this.getNextHighestDepth(), 10, 10, 100,<br />

22);<br />

for (var prop in this) {<br />

if (this[prop] instanceof TextField) {<br />

var this_txt:TextField = this[prop];<br />

trace(this_txt._name+" is a TextField at depth: "+this_txt.getDepth());<br />

}<br />

}<br />

When you test the document, the instance name <strong>and</strong> depth is displayed in the Output<br />

panel.When you test the document, the instance name <strong>and</strong> depth writes to the log file.<br />

onChanged (TextField.onChanged h<strong>and</strong>ler)<br />

onChanged = function(changedField:TextField) {}<br />

Event h<strong>and</strong>ler/listener; invoked when the content of a text field changes. By default, it is<br />

undefined; you can define it in a script.<br />

628 ActionScript classes

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!