User Guide
1210 ActionScript classes
See also
TextFormat, setNewTextFormat (TextField.setNewTextFormat method)
sharpness (TextField.sharpness property)
public sharpness : Number
The sharpness of the glyph edges in this TextField instance. This property applies only if the
antiAliasType property of the text field is set to "advanced". The range for sharpness is a
number from -400 to 400. If you attempt to set
sharpness to a value outside that range,
Flash sets the property to the nearest value in the range (either -400 or 400).
Availability: ActionScript 1.0; Flash Player 8
Example
This example creates three text fields with
sharpness set to 400, 0, and -400. 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:
■ Open your Library
■ Click the Library options menu in the upper right corner of the Library
■ Select "New Font" from the dropdown list
■ Name the font "Times-12"
■ Select "Times New Roman" from the font dropdown list
■ Press the "OK" button
■ Right-click on the newly created font and select "Linkage..."
■ Check the "Export for ActionScript" box
■ Accept the default identifier "Times-12" by pressing the "OK" button
var my_format:TextFormat = new TextFormat();
my_format.font = "Times-12";
var my_text1:TextField = this.createTextField("my_text1",
this.getNextHighestDepth(), 10, 10, 400, 100);
my_text1.text = "This text has sharpness set to 400."
my_text1.embedFonts = true;
my_text1.antiAliasType = "advanced";
my_text1.gridFitType = "pixel";
my_text1.sharpness = 400;
my_text1.setTextFormat(my_format);
var my_text2:TextField = this.createTextField("my_text2",
this.getNextHighestDepth(), 10, 40, 400, 100);
my_text2.text = "This text has sharpness set to 0."