Flash CS3 文档 |
|||
| 学习 Adobe Flash 中的 ActionScript 2.0 > 使用文本和字符串 > 使用 HTML 格式的文本 > 关于支持的 HTML 标签 > 段落标签 | |||
<p> 标签创建一个新段落。若要使用此标签,您必须将文本字段设置为多行文本字段。
<p> 标签支持以下属性:
align 指定段落内的文本对齐方式;有效值为 left、right、justify 和 center。class 指定 TextField.StyleSheet 对象定义的 CSS 样式类。(有关详细信息,请参阅使用样式类。) 下例使用 align 属性使文本在文本字段的右侧对齐。
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>";
下例使用 class 属性将文本样式类分配到 <p> 标签:
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
当前页: http://livedocs.adobe.com/flash/9.0_cn/main/00000930.html