Chapter 10. Formatting Text

Understanding the TextFormat Class

When you create a text field visually using the text tool and dragging on the Stage, you can use the Properties panel to apply formatting. If you create the field in code, however, you must apply formatting via an instance of the TextFormat class.

Class Properties

The TextFormat class contains a set of properties for storing formatting information that you plan to apply to a text field. These properties are align, blockIndent, bold, bullet, color, font, indent, italic, kerning, leading, leftMargin, letterSpacing, rightMargin, size, tabStops, target, underline, and url.

align

The align property sets the alignment of text within a field. It takes as its value one of the constants set in the ...

Get ActionScript®: Your visual blueprint™ for creating interactive projects in Flash® CS4 Professional now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.