13.08.2012 Views

ACTIONSCRIPT 3 Developer’s Guide en

ACTIONSCRIPT 3 Developer’s Guide en

ACTIONSCRIPT 3 Developer’s Guide en

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.

<strong>ACTIONSCRIPT</strong> 3.0 DEVELOPER’S GUIDE<br />

Using the TextField class<br />

}<br />

}<br />

}<br />

if (lastCharCode == 10 || lastCharCode == 13)<br />

{<br />

lastLineEndedPara = true;<br />

}<br />

else<br />

{<br />

lastLineEndedPara = false;<br />

}<br />

if ((this.format.align == TextFormatAlign.JUSTIFY) &&<br />

(i < fieldArray.l<strong>en</strong>gth - 1))<br />

{<br />

if (!lastLineEndedPara)<br />

{<br />

justifyLastLine(field, lastLine);<br />

}<br />

After the preferredHeight property has be<strong>en</strong> set by calling the getOptimalHeight() method, the<br />

layoutColumns() method iterates through the TextField objects, setting the height of each to the preferredHeight<br />

value. The layoutColumns() method th<strong>en</strong> distributes just <strong>en</strong>ough lines of text to each field so that no scrolling occurs<br />

in any individual field, and the text in each successive field begins where the text in the previous field <strong>en</strong>ded. If the text<br />

alignm<strong>en</strong>t style has be<strong>en</strong> set to “justify” th<strong>en</strong> the justifyLastLine() method is called to justify the final line of text<br />

in a field. Otherwise that last line would be treated as an <strong>en</strong>d-of-paragraph line and not justified.<br />

Last updated 6/6/2012<br />

396

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

Saved successfully!

Ooh no, something went wrong!