Flash Lite 2.x and 3 Help

TextFormat class

The TextFormat class represents character formatting information. Use the TextFormat class to create specific text formatting for text fields. You can apply text formatting to static and dynamic text fields. Some properties of the TextFormat class are not available for embedded and device fonts.

The TextFormat class lets you apply formatting to a text field or to certain characters within a text field. Some examples of text formatting options that can be applied to text are alignment, indenting, bold, color, font size, margin widths, italics, and letter spacing. You can apply text formatting to static and dynamic text fields. Some properties of the TextFormat class are not available for embedded and device fonts.

You must use the constructor TextFormat() to create a TextFormat object before calling its methods.

NOTE

 

Flash Lite 2.x and later provides partial support for the formatting feature available in the TextFormat class. Formatting features are not available when you use device fonts.

Flash Lite 2.x and later provides partial support for the TextFormat class. For example, TextFormat.font, TextFormat.bold, and TextFormat.tabstop are not supported when you use device fonts.

For more information about the TextFormat class, see the following references:

  • Developing Flash Lite 2.x and 3.0 Applications
  • Chapter 12, "Working with Text and Strings," in Learning ActionScript 2.0 in Flash
  • Chapter 2, "ActionScript Classes," in Flash Lite 2.x and 3.0 ActionScript Language Reference

Property summary

The following table lists the properties that are partially supported when using ActionScript 2.0 to create Flash content.

Property

Description

bold

A Boolean value that specifies whether the text is boldface.

Limitations: For use only with paragraph-level formatting; you cannot apply bold to individual characters.

bullet

A Boolean value that indicates that the text is part of a bulleted list.

Limitations: For use only with embedded fonts.

color

Indicates the color of text.

Limitations: For use only with paragraph-level formatting; you cannot apply color to individual characters.

font

The name of the font for text in this text format, as a string.

Limitations: For Flash Lite, this property works for embedded fonts only. This property is not supported for Arabic, Hebrew, and Thai.

italic

A Boolean value that indicates whether text in this text format is italic.

Limitations: For use only with paragraph-level formatting; you cannot apply italics to individual characters.

size

The point size of text in this text format.

Limitations: For use only with paragraph-level formatting; you cannot apply different font sizes to individual characters.

tabStops

Specifies custom tab stops as an array of non-negative integers.

Limitations: For use with embedded fonts only.

underline

A Boolean value that indicates whether the text that uses this text format is underlined (true) or not (false).

Limitations: For use only with paragraph-level formatting.

 

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