User Guide
240 Chapter 9: Working with Text
Italic tag (<i>)
The
<i> tag displays the tagged text in italics, as shown in the following code:
That is very <i>interesting</i>.
This code example would render as follows:
That is very interesting.
An italic typeface must be available for the font used.
List item tag (<li>)
The
<li> tag places a bullet in front of the text that it encloses, as shown in the following code:
Grocery list:
<li>Apples</li>
<li>Oranges</li>
<li>Lemons</li>
This code example would render as follows:
Grocery list:
■ Apples
■ Oranges
■ Lemons
Note: Ordered and unordered lists (<ol> and <ul> tags) are not recognized by Flash Player, so they
do not modify how your list is rendered. All list items use bullets.
Paragraph tag (<p>)
The
<p> tag creates a new paragraph. It supports the following attributes:
• align Specifies alignment of text within the paragraph; valid values are left, right,
and
center.
• class Specifies a CSS style class defined by an TextField.StyleSheet object. (For more
information, see “Using style classes” on page 231.)
The following example uses the
align attribute to align text on the right side of a text field.
myText_txt.htmlText = "<p align='right'>This text is aligned on the right
side of the text field</p>";
The following example uses the class attribute to assign a text style class to a <p> tag:
var myStyleSheet = new TextField.StyleSheet();
myStyleSheet.setStyle("body", {color:'#99CCFF', fontSize:'18'});
this.createTextField("test", 10, 0, 0, 300, 100);
test.styleSheet = myStyleSheet;
test.htmlText = "<p class='body'>This is some body-styled text.</p>.";