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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

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

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

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

Example<br />

The following example creates a text field wherever you click the mouse. When it creates a<br />

text field, that field displays the current x <strong>and</strong> y coordinates of the text field.<br />

this.createTextField("coords_txt", this.getNextHighestDepth(), 0, 0, 60,<br />

22);<br />

coords_txt.autoSize = true;<br />

coords_txt.selectable = false;<br />

coords_txt.border = true;<br />

var mouseListener:Object = new Object();<br />

mouseListener.onMouseDown = function() {<br />

coords_txt.text = "X:"+Math.round(_xmouse)+", Y:"+Math.round(_ymouse);<br />

TextField 651

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

Saved successfully!

Ooh no, something went wrong!