EasyManua.ls Logo

MACROMEDIA FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH - Page 441

MACROMEDIA FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH
830 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...
Using HTML-formatted text 441
Apples
Oranges
Lemons
Paragraph tag
The <p> tag creates a new paragraph. You must set the text field to be a multiline text field to
use this tag.
The
<p> tag supports the following attributes:
align Specifies alignment of text within the paragraph; valid values are left, right,
justify, and center.
class Specifies a CSS style class defined by a TextField.StyleSheet object. (For more
information, see “Using style classes” on page 429.)
The following example uses the
align attribute to align text on the right side of a
text field.
this.createTextField("myText_txt", 1, 10, 10, 400, 100);
myText_txt.html = true;
myText_txt.multiline = true;
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:TextField.StyleSheet = new TextField.StyleSheet();
myStyleSheet.setStyle(".blue", {color:'#99CCFF', fontSize:18});
this.createTextField("test_txt", 10, 0, 0, 300, 100);
test_txt.html = true;
test_txt.styleSheet = myStyleSheet;
test_txt.htmlText = "<p class='blue'>This is some body-styled text.</
p>.";
Span tag
The <span> tag is available only for use with CSS text styles. (For more information, see
“Formatting text with Cascading Style Sheet styles” on page 421.) It supports the following
attribute:
class Specifies a CSS style class defined by a TextField.StyleSheet object. For more
information on creating text style classes, see “Using style classes” on page 429.
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.

Table of Contents

Related product manuals