Flash CS3 Documentation |
|||
| ActionScript 2.0 Language Reference > ActionScript classes > TextFormat > letterSpacing (TextFormat.letterSpacing property) | |||
public letterSpacing : Number
The amount of space that is uniformly distributed between characters. The Number value specifies the number of pixels that are added to the space after each character. A negative value condenses the space between characters.
System fonts support integer values only; however, for embedded fonts, you can specify floating point (noninteger) values (such as 2.6).
Availability: ActionScript 1.0; Flash Player 8
The following code example uses two TextFormat objects to apply positive and negative values of letterSpacing to different ranges of text in a text field.
this.createTextField("mytext", this.getNextHighestDepth(), 10, 10, 200, 100);
mytext.multiline = true;
mytext.wordWrap = true;
mytext.border = true;
var format1:TextFormat = new TextFormat();
format1.letterSpacing = -1;
var format2:TextFormat = new TextFormat();
format2.letterSpacing = 10;
mytext.text = "Eat at \nJOE'S.";
mytext.setTextFormat(0, 7, format1);
mytext.setTextFormat(8, 12, format2);
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.
Flash CS3