03.05.2013 Views

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - 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.

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 />

The MovieClip.getNextHighestDepth() method used in this example requires Flash Player<br />

7 or later. If your SWF file includes a version 2 component, use the version 2 components'<br />

DepthManager class instead of the MovieClip.getNextHighestDepth() method.<br />

See also<br />

_height (TextField._height property)<br />

wordWrap (TextField.wordWrap property)<br />

public wordWrap : Boolean<br />

A Boolean value that indicates if the text field has word wrap. If the value of wordWrap is<br />

true, the text field has word wrap; if the value is false, the text field does not have word<br />

wrap.<br />

Availability: <strong>ActionScript</strong> 1.0; Flash Player 6<br />

Example<br />

The following example demonstrates how wordWrap affects long text in a text field that is<br />

created at runtime.<br />

this.createTextField("my_txt", 99, 10, 10, 100, 200);<br />

my_txt.text = "This is very long text that will certainly extend beyond the<br />

width of this text field";<br />

my_txt.border = true;<br />

Test the SWF file in Flash Player by selecting Control > Test Movie. Then return to your<br />

<strong>ActionScript</strong> <strong>and</strong> add the following line to the code <strong>and</strong> test the SWF file again:<br />

my_txt.wordWrap = true;<br />

_x (TextField._x property)<br />

public _x : Number<br />

An integer that sets the x coordinate of a text field relative to the local coordinates of the<br />

parent movie clip. If a text field is on the main Timeline, then its coordinate system refers to<br />

the upper left corner of the Stage as (0, 0). If the text field is inside a movie clip that has<br />

transformations, the text field is in the local coordinate system of the enclosing movie clip.<br />

Thus, for a movie clip rotated 90 degrees counterclockwise, the enclosed text field inherits a<br />

coordinate system that is rotated 90 degrees counterclockwise. The text field's coordinates<br />

refer to the registration point position.<br />

1244 <strong>ActionScript</strong> classes

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

Saved successfully!

Ooh no, something went wrong!