Flash CS3 Documentation |
|||
| Learning ActionScript 2.0 in Adobe Flash > Working with Text and Strings > Using HTML-formatted text > About supported HTML tags > 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.) 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>.";
Flash CS3
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/flash/9.0/main/00000930.html