flash显示html内容

适用as2.0

1、先建动态文本,并命名myText

2、在帧上加上代码,

myText.html = true; 

myText.multiline = true;

var myString = '<p><b>This is a bold text</b></p><p><i>And this text is in Italic</i></p>This is a <a href="http://desigm.yesky.com"><u>link</u></a> to the bbc website.<br>Here is a little list of colors :<br><li><font color="#FF0000">Red</font></li><li><font color="#009900">Green</font></li><li><font color="#0000FF">Blue</font></li>Here is a little image that links to the bbc site<a href="http://desigm.yesky.com"><img src="bird.jpg"></a>';

myText.htmlText = myString;

3、也可以读取外部文件作为html内容:参考http://www.wangchao.net.cn/bbsdetail_1736674.html

你可能感兴趣的:(html,Flash,文本)