1238 ActionScript classes
Example
The following example creates a text field and sets the text style to italic.
this.createTextField("mytext",1,100,100,100,100);
mytext.multiline = true;
mytext.wordWrap = true;
mytext.border = true;
var myformat:TextFormat = new TextFormat();
myformat.italic = true;
mytext.text = "This is my first text field object text";
mytext.setTextFormat(myformat);
kerning (TextFormat.kerning property)
public kerning : Boolean
A Boolean value that indicates whether kerning is enabled or disabled. Kerning puts a
predetermined amount of space between certain character pairs to improve readability. The
default value is
false
, which indicates that kerning is disabled.
Kerning is supported for embedded fonts only. Certain fonts, such as Courier New, do not
support kerning.
The
kerning
property is only supported in SWF files created in Windows, not in SWF files
created on the Macintosh. However, Windows SWF files
can
be played in non-Windows
versions of Flash Player, and the kerning will still apply.
Use kerning only when necessary, such as with headings in large fonts.
Availability:
ActionScript 1.0; Flash Player 8
Example
The following example shows two text fields: The format of the first uses red text with
kerning
set to
false
, and the format of the second uses blue text with
kerning
set to
true
.
To use this example, you add a font symbol to the Library, and then select Arial as the font. In
the Linkage Properties dialog box for the font, you set the Identifier name to
"Font 1"
, select
Export for ActionScript, and then select Export in First Frame.
var fmt1:TextFormat = new TextFormat();
fmt1.font = "Font 1";
fmt1.size = 50;
fmt1.color = 0xFF0000;
fmt1.kerning = false;
var fmt2:TextFormat = new TextFormat();
fmt2.font = "Font 1";
Содержание FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE
Страница 1: ...ActionScript 2 0 Language Reference ...
Страница 1352: ...1352 ActionScript classes ...