flash on 2012-5-6 Gjgjhgj.Jghj.. forked:0favorite:0lines:21license : MIT License modified : 2012-05-06 19:09:58 Embed Tweet package { import flash.text.TextField; import flash.display.Sprite; import flash.xml.*; public class FlashTest extends Sprite { public static function txt2html(str:String) : String { return (new XMLNode(3, str).toString()); } public function FlashTest() { var html:String = "<![CDATA[\"sdf\"]]>"; var txt:String = txt2html(html); var tf:TextField = new TextField(); tf.text = txt + " " + html; //addChild(tf); var tf2:TextField = new TextField(); tf2.htmlText = txt; addChild(tf2); } } } Code Fullscreen Preview Fullscreen XMLNode htmlText TextField toString String text addChild Sprite