Textformat - MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE Reference

Actionscript 2.0 language reference
Table of Contents

Advertisement

Example
See the example for
TextField._xscale
See also
_x (TextField._x property)
(TextField._y property)

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.
You must use the constructor
its methods.
You can set TextFormat parameters to
apply a TextFormat object to a text field using
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
sets the
property to a defined value. The
bold
used in this example requires Flash Player 7 or later. If your SWF file includes a version 2
component, use the version 2 components DepthManager class instead of the
MovieClip.getNextHighestDepth()
The code
my_txt.setTextFormat(my_fmt)
field's default text format, because the
other aspects of the text field's default text format remain unchanged.
1228
ActionScript classes
.
,
_xscale (TextField._xscale property)
to create a TextFormat object before calling
new TextFormat()
to indicate that they are undefined. When you
null
TextField.setTextFormat()
MovieClip.getNextHighestDepth()
method.
only changes the
property is the only one defined in
bold
,
_y
, only its
, and then
null
property of the text
bold
my_fmt
method
. All

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash 8

Table of Contents

Save PDF