TextFormat class
Availability
Flash Player 6.
Description
The TextFormat class represents character formatting information.
You must use the constructor
its methods.
You can set TextFormat parameters to
a TextFormat object to a text field using TextField.setTextFormat(), only its defined properties are
applied, as in the following example:
this.createTextField("my_txt", this.getNextHighestDepth(), 0, 0, 100, 22);
my_txt.autoSize = true;
my_txt.text = "Lorem ipsum dolor sit amet...";
var my_fmt:TextFormat = new TextFormat();
my_fmt.bold = true;
my_txt.setTextFormat(my_fmt);
This code first creates an empty TextFormat object with all of its properties
the
property to a defined value.
bold
The code
my_txt.setTextFormat(my_fmt)
default text format, because the
of the text field's default text format remain unchanged.
When
TextField.getTextFormat()
properties defined; no property is
Method summary for the TextFormat class
Method
TextFormat.getTextExtent()
Property summary for the TextFormat class
Property
TextFormat.align
TextFormat.blockIndent
TextFormat.bold
TextFormat.bullet
TextFormat.color
TextFormat.font
942
Chapter 2: ActionScript Language Reference
ActionScript Language Reference
to create a TextFormat object before calling
new TextFormat()
to indicate that they are undefined. When you apply
null
only changes the
property is the only one defined in
bold
is invoked, a TextFormat object is returned with all of its
.
null
Description
Returns text measurement information for a text string.
Description
Indicates the alignment of a paragraph.
Indicates the block indentation, in points.
Indicates whether text is boldface.
Indicates whether text is in a bulleted list.
Indicates the color of text.
Indicates the font name of the text with a text format.
CHAPTER 2
, and then sets
null
property of the text field's
bold
. All other aspects
my_fmt
Need help?
Do you have a question about the FLASH MX 2004-ACTIONSCRIPT LANGUAGE and is the answer not in the manual?
Questions and answers