MACROMEDIA FLASH 8-USING FLASH Use Manual page 179

Using flash
Table of Contents

Advertisement

If you will publish your Flash document as Flash Player 5 or earlier, you can use the text field
variable to apply HTML tags to text fields.
The following HTML tags are supported by the
,
,
color
font face
font size
The following HTML attributes are supported in text fields:
,
, and
align
indent
leading
style sheets. For more information, see Chapter 12, "Working with Text and Strings," in
Learning ActionScript 2.0 in Flash and "TextFormat class" or "TextField.StyleSheet class" in
the ActionScript 2.0 Language Reference.
To use the text field instance name to preserve rich text formatting:
1.
Do one of the following to assign an instance name to the text field:
Use the Text tool to create a text field on the Stage. Assign the text field an instance
name in the Property inspector.
Use the ActionScript
Assign the text field an instance name as a parameter of the
method.
2.
Do one of the following:
Select the Render Text as HTML option in the Property inspector.
In the Actions panel, set the
the following:
myInstanceName.html = true;
3.
In the Actions panel, set the
For example, if you have a dynamic text field on the Stage with the instance name
, the following code renders the text in bold:
instName
myInstanceName.htmlText = "<b>Chris</b>";
To use the text field variable to preserve rich text formatting:
1.
Select a text field on the Stage.
2.
Assign the text field a variable name in the Property inspector.
3.
Do one of the following:
Select the Render Text as HTML option in the Property inspector.
In the Actions panel, set the
htmlText
,
,
, and
.
i
p
u
. To apply these attributes, use the TextFormat class or cascading
method to create a text field dynamically.
createTextField
property of the TextField object to
html
property to a value that includes HTML tags.
htmlText
property of the TextField object to
html
property text fields:
a
,
leftmargin
rightmargin
createTextField
true
true
Preserving rich text formatting
,
,
b
font
,
, as in
.
179

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flash 8

Table of Contents