Flash 载入 html 办法

728x15 ad here

出自Guoshuang Wiki

跳转到: 导航, 搜索

新建文本输入框,多行multiline,允许html,实例名为 stage_txt。在组件面板拖进来 UIScollBar,这个滚动条会自动适应高(宽)度。

新建层,在第一个空白关键帧加入下面 actionscript

myData = new LoadVars();
// load event 
myData.onLoad = function() {
	// allow text to use html 
	stage_txt.html = true;
	stage_txt.htmlText = this.myVariable;

};

myData.load("2.htm");

2.htm 的内容必须是

myVariable=<h1>这里是html代码</h1>12314...

的形式。

注意:此法支持的html标签数量有限。

个人工具
125x125 ad here
Advertisement
120x600 ad here