antiAliasType (TextField.antiAliasType property)

public antiAliasType : String

The type of anti-aliasing used for this TextField instance. Advanced anti-aliasing is available only in Flash Player 8 and later. You can control this setting only if the font is embedded (with the embedFonts property set to true). For Flash Player 8, the default setting is "advanced".

To set values for this property, use the following string values:

String value

Description

"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, which makes text more legible. (This feature is available as of Flash Player 8.) Advanced anti-aliasing allows for high-quality rendering of font faces at small sizes. It is best used with applications that have a lot of small text. Advanced anti-aliasing is not recommended for fonts that are larger than 48 points.

Availability: ActionScript 1.0; Flash Player 8

Example

This example creates two text fields and applies advanced anti-aliasing to the first one only. It assumes that you have a font embedded in the Library with the linkage identifier set to "Times-12". To embed the font, follow these steps:

var my_format:TextFormat = new TextFormat();
my_format.font = "Times-12";

var my_text1:TextField = this.createTextField("my_text1", this.getNextHighestDepth(), 10, 10, 300, 30);
my_text1.text = "This text uses advanced anti-aliasing.";
my_text1.antiAliasType = "advanced";
my_text1.border = true;
my_text1.embedFonts = true;
my_text1.setTextFormat(my_format); 

var my_text2:TextField = this.createTextField("my_text2", this.getNextHighestDepth(), 10, 50, 300, 30);
my_text2.text = "This text uses normal anti-aliasing."
my_text2.antiAliasType = "normal";
my_text2.border = true;
my_text2.embedFonts = true;
my_text2.setTextFormat(my_format);

If your SWF file includes a version 2 component, use the version 2 components' DepthManager class instead of the MovieClip.getNextHighestDepth() method, which is used in this example.

See also

TextRenderer (flash.text.TextRenderer), gridFitType (TextField.gridFitType property), thickness (TextField.thickness property), sharpness (TextField.sharpness property)


Flash CS3


 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/flash/9.0/main/00002193.html