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
, which indicates that kerning is disabled.
false
Kerning is supported for embedded fonts only. Certain fonts, such as Courier New, do not
support kerning.
The
property is only supported in SWF files created in Windows, not in SWF files
kerning
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
set to
, and the format of the second uses blue text with
set to
.
kerning
false
kerning
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
, select
"Font 1"
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";
1238
ActionScript classes
Need help?
Do you have a question about the FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE and is the answer not in the manual?