ML()的定义 var e=newsXML.firstChild.childNodes; var total=e.length; mytextarea.wordWrap=true; //设置TextArea可以自动换行 mytextarea.editable=false; //TextArea不可编辑 mytextarea.hScrollPolicy=off; //TextArea横向滚动条关闭 mytextarea.html=true; //支持XML mytextarea.styleSheet=myStyles; //调用前面设置好的样式 for(i=0;i<total;i++){ //解析XML并格式化文本 mytextarea.text+="<.title>"+e[i].attributes.title+"</.title>"; mytextarea.text+="<.date>"+e[i].attributes.date+"</.date>"; mytextarea.text+="<.content>"+e[i].firstChild.firstChild.nodeValue+"</.content><br>"; } }
好了,很简单吧 PS:可以对myStyles扩充,flash支持的html标签还有不少:) 点击这里下载源文件
|