TextFormat


Object
    |
    +-TextFormat

public class TextFormat
extends Object

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 both static and dynamic text fields. Some properties of the TextFormat class are not available for both embedded and device fonts.

Availability: ActionScript 1.0; Flash Lite 2.0

See also

setTextFormat (TextField.setTextFormat method), getTextFormat (TextField.getTextFormat method)

Property summary

Modifiers

Property

Description

 

align:String

A string that indicates the alignment of the paragraph.

 

blockIndent:Number

A number that indicates the block indentation in points.

 

bold:Boolean

A Boolean value that specifies whether the text is boldface.

 

bullet:Boolean

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

 

color:Number

A number that indicates the color of text.

 

font:String

A string that specifies the name of the font for text.

 

indent:Number

An integer that indicates the indentation from the left margin to the first character in the paragraph.

 

italic:Boolean

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

 

leading:Number

An integer that represents the amount of vertical space in pixels (called leading) between lines.

 

leftMargin:Number

The left margin of the paragraph, in points.

 

rightMargin:Number

The right margin of the paragraph, in points.

 

size:Number

The point size of text in this text format.

 

tabStops:Array

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

 

target:String

Indicates the target window where the hyperlink is displayed.

 

underline:Boolean

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

 

url:String

Indicates the URL that text in this text format hyperlinks to.

Properties inherited from class Object

constructor (Object.constructor property), __proto__ (Object.__proto__ property), prototype (Object.prototype property), __resolve (Object.__resolve property)


Constructor summary

Signature

Description

TextFormat([font:String], [size:Number], [color:Number], [bold:Boolean], [italic:Boolean], [underline:Boolean], [url:String], [target:String], [align:String], [leftMargin:Number], [rightMargin:Number], [indent:Number], [leading:Number])

Creates a TextFormat object with the specified properties.

Method summary

Modifiers

Signature

Description

 

getTextExtent(text:String, [width:Number]) : Object

Returns text measurement information for the text string text in the format specified by my_fmt.

Methods inherited from class Object

addProperty (Object.addProperty method), hasOwnProperty (Object.hasOwnProperty method), isPropertyEnumerable (Object.isPropertyEnumerable method), isPrototypeOf (Object.isPrototypeOf method), registerClass (Object.registerClass method), toString (Object.toString method), unwatch (Object.unwatch method), valueOf (Object.valueOf method), watch (Object.watch method)