414 Working with Text and Strings
After the text loads from the remote server, Flash displays some text in the text field, and
you can see the advanced anti-aliasing table properties applied to your text field. The
embedded font on the Stage should appear like it has a slight blur effect because of the
current
insideCutoff and outsideCutoff values.
About text layout and formatting
You can control text layout and formatting by using ActionScript. The TextFormat class
provides a great deal of control over how the text appears at runtime, in addition to other
forms of formatting such as style sheets (see “Formatting text with Cascading Style Sheet
styles” on page 421) and HTML text (see “Using HTML-formatted text” on page 436).
You can also control how characters fit on the grid by using ActionScript when you use anti-
alias text in a SWF file. This helps you to control the appearance of the characters at runtime.
For an example of how to use a grid fit type in your applications, see “Using a grid fit type”
on page 417.
For general information on text fields, see “About text fields” on page 383. For information
on formatting text, see “About formatting anti-alias text” on page 414. For more information
on the TextFormat class, see “Using the TextFormat class” on page 419 and
TextFormat
in the ActionScript 2.0 Language Reference.
For more information on text layout and text formatting using the TextFormat class, see the
following sections:
■ “About formatting anti-alias text” on page 414
■ “Using a grid fit type” on page 417
■ “Using the TextFormat class” on page 419
■ “Default properties of new text fields” on page 421
About formatting anti-alias text
Flash 8 introduces two new properties that you can use when you format text fields with
advanced anti-aliasing enabled:
sharpness and thickness. Sharpness refers to the amount of
aliasing that is applied to the text field instance. A high value for sharpness makes the
embedded font edge appear jagged and sharp. Setting sharpness to a lower value makes the
font appear softer, with more blurring. Setting a font’s thickness is similar to enabling bold
formatting for a text field. The higher the thickness, the bolder the font appears.
The following example dynamically loads a text file and displays text on the Stage. Moving
the mouse pointer along the x axis sets the sharpness between -400 and 400. Moving the
mouse pointer along the y axis sets the thickness between -200 and 200.