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.

See also<br />

_visible (Button._visible property), _visible (MovieClip._visible property)<br />

_width (TextField._width property)<br />

public _width : Number<br />

The width of the text field, in pixels.<br />

Example<br />

The following example creates two text fields that you can use to change the width <strong>and</strong> height<br />

of a third text field on the Stage. Add the following ActionScript to a FLA or ActionScript file.<br />

this.createTextField("my_txt", this.getNextHighestDepth(), 10, 40, 160,<br />

120);<br />

my_txt.background = true;<br />

my_txt.backgroundColor = 0xFF0000;<br />

my_txt.border = true;<br />

my_txt.multiline = true;<br />

my_txt.type = "input";<br />

my_txt.wordWrap = true;<br />

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

20);<br />

width_txt.border = true;<br />

width_txt.maxChars = 3;<br />

width_txt.type = "input";<br />

width_txt.text = my_txt._width;<br />

width_txt.onChanged = function() {<br />

my_txt._width = this.text;<br />

}<br />

this.createTextField("height_txt", this.getNextHighestDepth(), 70, 10, 30,<br />

20);<br />

height_txt.border = true;<br />

height_txt.maxChars = 3;<br />

height_txt.type = "input";<br />

height_txt.text = my_txt._height;<br />

height_txt.onChanged = function() {<br />

my_txt._height = this.text;<br />

}<br />

When you test the example, try entering new values into width_txt <strong>and</strong> height_txt to<br />

change the dimensions of my_txt.<br />

See also<br />

_height (TextField._height property)<br />

650 ActionScript classes

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

Saved successfully!

Ooh no, something went wrong!