TextField
1183
Availability:
ActionScript 1.0; Flash Player 8
Example
This example shows three text fields that use the different
gridFitType
settings. 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(), 9.5, 10, 400, 100);
my_text1.text = "this.gridFitType = none";
my_text1.embedFonts = true;
my_text1.antiAliasType = "advanced";
my_text1.gridFitType = "none";
my_text1.setTextFormat(my_format);
var my_text2:TextField = this.createTextField("my_text2",
this.getNextHighestDepth(), 9.5, 40, 400, 100);
"pixel"
Specifies that strong horizontal and vertical lines are fit to the pixel
grid. This setting works only for left-aligned text fields. To use this
setting, the
antiAliasType
property of the text field must be set to
"advanced"
. This setting generally provides the best legibility for left-
aligned text.
"subpixel"
Specifies that strong horizontal and vertical lines are fit to the
subpixel grid on an LCD monitor. To use this setting, the
antiAliasType
property of the text field must be set to
"advanced"
.
The
"subpixel"
setting is often good for right-aligned or centered
dynamic text, and it is sometimes a useful trade-off for animation
versus text quality.
String value
Description
Содержание FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE
Страница 1: ...ActionScript 2 0 Language Reference ...
Страница 1352: ...1352 ActionScript classes ...