User Guide
Using HTML-formatted text 241
Span tag (<span>)
The
<span> tag is available only for use with CSS text styles. (For more information, see
“Formatting text with Cascading Style Sheets” on page 226.) It supports the following attribute:
• class Specifies a CSS style class defined by an TextField.StyleSheet object. For more
information on creating text style classes, see “Using style classes” on page 231.
Text format tag (<textformat>)
The
<textformat> tag lets you use a subset of paragraph formatting properties of the TextFormat
class within HTML text fields, including line leading, indentation, margins, and tab stops. You
can combine
<textformat> tags with the built-in HTML tags.
The
<textformat> tag has the following attributes:
• blockindent Specifies the block indentation in points; corresponds to
TextFormat.blockIndent. (See TextFormat.blockIndent in Flash ActionScript Language
Reference.)
• indent Specifies the indentation from the left margin to the first character in the paragraph;
corresponds to
TextFormat.indent. (See TextFormat.indent in Flash ActionScript Language
Reference.)
• leading Specifies the amount of leading (vertical space) between lines; corresponds to
TextFormat.leading. (See TextFormat.leading in Flash ActionScript Language Reference.)
• leftmargin Specifies the left margin of the paragraph, in points; corresponds to
TextFormat.leftMargin. (See TextFormat.leftMargin in Flash ActionScript Language
Reference.)
• rightmargin Specifies the right margin of the paragraph, in points; corresponds to
TextFormat.rightMargin. (See TextFormat.rightMargin in Flash ActionScript Language
Reference.)
• tabstops Specifies custom tab stops as an array of non-negative integers; corresponds to
TextFormat.tabStops. (See TextFormat.tabStops in Flash ActionScript Language
Reference.)
The following code example uses the
tabstops attribute of the <textformat> tag to create a
table of data with boldfaced row headers:
To create a formatted table of data using tab stops:
1.
Using the Text tool, create a dynamic text field that’s approximately 300 pixels wide and 100
pixels high.
2.
In the Property inspector, name the instance table_txt, select Multiline from the Line Type
pop-up menu, and select the Render Text as HTML option.
3.
In the Timeline, select the first frame on Layer 1.
Name Age Department
Tim 32 Finance
Edwin 46 Marketing