15.10.2012 Views

Actionscript 3 Entwicklerhandbuch

Actionscript 3 Entwicklerhandbuch

Actionscript 3 Entwicklerhandbuch

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.

ACTIONSCRIPT 3.0 ENTWICKLERHANDBUCH<br />

Verwenden der Flash Text Engine<br />

}<br />

}<br />

}<br />

{<br />

return shrinkText(--pointSize, maxLines);<br />

}<br />

else<br />

{<br />

return growText(pointSize, maxLines);<br />

}<br />

public function growText(pointSize:Number, maxLines:uint = 1):Number<br />

{<br />

if (pointSize >= MAX_POINT_SIZE)<br />

{<br />

return pointSize;<br />

}<br />

}<br />

this.changeSize(pointSize + 1);<br />

if (this.totalTextLines > maxLines)<br />

{<br />

// set it back to the last size<br />

this.changeSize(pointSize);<br />

return pointSize;<br />

}<br />

else<br />

{<br />

return growText(pointSize + 1, maxLines);<br />

}<br />

public function shrinkText(pointSize:Number, maxLines:uint=1):Number<br />

{<br />

if (pointSize maxLines)<br />

{<br />

return shrinkText(pointSize - 1, maxLines);<br />

}<br />

else<br />

{<br />

return pointSize;<br />

}<br />

MultiColumnText.as formatiert Text in mehrspaltigen Textkörpern. Es zeigt die flexible Verwendung eines<br />

TextBlock-Objekts, das zum Erstellen, Formatieren und Positionieren von Textzeilen dient.<br />

Letzte Aktualisierung 27.6.2012<br />

449

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

Saved successfully!

Ooh no, something went wrong!