EasyManua.ls Logo

MACROMEDIA FLASH 8-USING FLASH - Page 179

MACROMEDIA FLASH 8-USING FLASH
678 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Preserving rich text formatting 179
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
htmlText property text fields: a, b, font
color
, font face, font size, i, p, and u.
The following HTML attributes are supported in text fields:
leftmargin, rightmargin,
align, indent, and leading. To apply these attributes, use the TextFormat class or cascading
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 createTextField method to create a text field dynamically.
Assign the text field an instance name as a parameter of the
createTextField
method.
2. Do one of the following:
Select the Render Text as HTML option in the Property inspector.
In the Actions panel, set the html property of the TextField object to true, as in
the following:
myInstanceName.html = true;
3.
In the Actions panel, set the htmlText property to a value that includes HTML tags.
For example, if you have a dynamic text field on the Stage with the instance name
instName, the following code renders the text in bold:
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 html property of the TextField object to true.

Table of Contents

Related product manuals