View comments | RSS feed

leading (TextFormat.leading property)

public leading : Number

An integer that represents the amount of vertical space in pixels (called leading) between lines. The default value is null, which indicates that the property is undefined.

Flash Player 8 supports negative leading, meaning that the amount of space between lines is less than the text height. Negative leading can be useful when you want to put lines of text, such as headings, very close together. To prevent the overlap of text, you use negative leading for lines of text that do not contain descenders, such as text that is all uppercase.

Availability: ActionScript 1.0; Flash Player 6

Example

The following example creates a text field and sets the leading to 10.

var my_fmt:TextFormat = new TextFormat();
my_fmt.leading = 10;

this.createTextField("my_txt", 1, 100, 100, 100, 100);
my_txt.multiline = true;
my_txt.wordWrap = true;
my_txt.border = true;
my_txt.text = "This is my first text field object text";
my_txt.setTextFormat(my_fmt);

Version 8

Comments


No screen name said on Jan 11, 2006 at 9:21 AM :
I've just discovered that using setMask on a dynamic TextField which has negative leading causes the bottom part of the text to dissappear.

e.g.
var my_fmt:TextFormat = new TextFormat();
my_fmt.leading = -50;

Hides the bottom 50 rows of pixels of the TextField. Not the desired result!
grub kan said on Mar 29, 2006 at 6:39 PM :
leading is not support in flash 7??
other function exist like leading function??

 

RSS feed | Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/flash/8/main/00002812.html