About font rendering and anti-alias text
409
Setting anti-alias with ActionScript
Flash 8 offers two types of anti-aliasing: normal and advanced. Advanced anti-aliasing is
available only in Flash Player 8 and later, and can be used only if you embed the font in the
library and have the text field’s
embedFonts
property set to
true
. For Flash Player 8, the
default setting for text fields created using ActionScript is
normal
.
To set values for the
TextField.antiAliasType
property, use the following string values:
normal
Applies the regular text anti-aliasing. This matches the type of anti-aliasing that
Flash Player used in version 7 and earlier.
advanced
Applies advanced anti-aliasing for improved text readability, which is available in
Flash Player 8. Advanced anti-aliasing allows font faces to be rendered at very high quality at
small sizes. It is best used with applications that have a lot of small text.
To use ActionScript to set anti-alias text, see the following example.
To use advanced anti-aliasing:
1.
Create a new Flash document and save it as
antialiastype.fla
.
2.
Create two movie clips on the Stage and give them instances names of
normal_mc
and
advanced_mc
.
You will use these movie clips to toggle between the two types of anti-aliasing: normal
and advanced.
3.
Open the Library panel and select New Font from the pop-up menu in the upper-right
corner of the Library panel.
The Font Symbol Properties dialog box opens, in which you can select a font to embed in
the SWF file (including a font style and font size). You can also assign a font name that
appears in the document’s library and in the Font drop-down menu in the Property
inspector (if you have a text field selected on the Stage).
a.
Select the Arial font from the Font drop-down menu.
b.
Make sure that the Bold and Italic options are not selected.
c.
Set the size to 10 pixels.
d.
Enter the font name of
Arial-10 (embedded)
.
e.
Click OK.
4.
In the library, right-click the font symbol and select Linkage from the context menu.
The Linkage Properties dialog box appears.
TIP
Macromedia does not recommend advanced anti-aliasing for fonts larger than 48
points.
Summary of Contents for FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH
Page 1: ...Learning ActionScript 2 0 in Flash...
Page 8: ...8 Contents...
Page 18: ...18 Introduction...
Page 30: ...30 What s New in Flash 8 ActionScript...
Page 66: ...66 Writing and Editing ActionScript 2 0...
Page 328: ...328 Interfaces...
Page 350: ...350 Handling Events...
Page 590: ...590 Creating Interaction with ActionScript...
Page 710: ...710 Understanding Security...
Page 730: ...730 Debugging Applications...
Page 780: ...780 Deprecated Flash 4 operators...
Page 830: ...830 Index...