Preserving Rich Text Formatting - MACROMEDIA FLASH MX 2004-USING FLASH Use Manual

Hide thumbs Also See for FLASH MX 2004-USING FLASH:
Table of Contents

Advertisement

Preserving rich text formatting

Flash lets you preserve rich text formatting in input and dynamic text fields. If you select the
Render Text as HTML formatting option in the Property inspector or set the
the TextField object to
size) and hyperlinks in the text field by automatically applying the corresponding HTML tags
when you export the SWF file. You apply HTML tags to text fields as the value of the
property of the TextField object. You must give the text field an instance name to use the
property.
htmlText
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
,
font face
font size
The following HTML attributes are supported in text fields:
, and
indent
leading
sheets. For more information, see Chapter 9, "Working with Text," in Using ActionScript in Flash
and "TextFormat class" or "TextField.StyleSheet class" in Flash ActionScript Language Reference.
To use the text field instance name to preserve rich text formatting:
Do one of the following to assign an instance name to the text field:
1.
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
the text field an instance name as a parameter of the
Do one of the following:
2.
Select the Render Text as HTML option in the Property inspector.
In the Actions panel, set the
the following:
instanceName.html = true;
In the Actions panel, set the
3.
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.htmlText = "<b>Chris</b>";
To use the text field variable to preserve rich text formatting:
Select a text field on the Stage.
1.
Assign the text field a variable name in the Property inspector.
2.
Do one of the following:
3.
Select the Render Text as HTML option in the Property inspector.
In the Actions panel, set the
, Flash preserves basic text formatting (such as font, style, color, and
true
,
,
, and
.
i
p
u
. To apply these attributes, use the TextFormat class or cascading style
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:
htmlText
leftmargin
method to create a text field dynamically. Assign
createTextField

Preserving rich text formatting

property of
html
htmlText
,
,
a
b
font color
,
,
rightmargin
align
method.
, as in
true
instName
.
true
121
,
,
,

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flash mx 2004 - actionscript

Table of Contents