public class XMLLoader extends Sprite { private var novel:XML; private var urlLoader:URLLoader;
public function XMLLoader ( ) { var urlRequest:URLRequest = new URLRequest("novel.xml"); urlLoader = new URLLoader( ); urlLoader.addEventListener(Event.COMPLETE, completeListener); urlLoader.load(urlRequest); }
private function completeListener(e:Event):void { novel = new XML(urlLoader.data); trace(novel.toXMLString( )); } } }
Related Scripts with Example Source Code in same category :