Loader: swf,图片(jpg,png,gif)
URLLoader:文本文件(xml,php,jsp…)
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadComplete); private function loadComplete(event:Event){ trace("done"); addChild(loader); }
xmlLoader.dataFormat=URLLoaderDataFormat.TEXT; xmlLoader.addEventListener(Event.COMPLETE,xmlLoaded); private function xmlLoaded(event:Event { try {myXML = XML(event.target.data);area.text=myXML;} catch (e:TypeError) {area.text="Load faild:n"+e.message;} }