<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" initialize="init()"> <mx:Script> <![CDATA[ import com.cb.util.AnchorText; import flash.text.TextField; import flash.events.TextEvent; private var _htmlLoader:URLLoader = new URLLoader(); private var html_url:String = "assets/test.html"; private var myText:AnchorText; private function init():void { _htmlLoader.addEventListener(Event.COMPLETE, htmlLoadHandler); _htmlLoader.load(new URLRequest(html_url)); } private function htmlLoadHandler(event:Event):void { myText = new AnchorText(_htmlLoader.data, 300); myTextComponent.addChild(myText); } ]]> </mx:Script> <mx:UIComponent id="myTextComponent" /> </mx:Application>