Using the bellow code, how can I find out from loadXML
function when the onComplete is completed and the xml data is
available for use outside of onComplete method.
public function loadXML():void
var loader:URLLoader = new URLLoader();
var request:URLRequest = new URLRequest("sportOne.xml");
public function onComplete(event:Event):void
text = "";
var loader:URLLoader = URLLoader(event.target);
scoresXML = new XML(loader.data);
I'm assuming you're trying to decouple your code such that
the class the "uses" the xml is different from the class that loads
You can dispatch your own event when that happens so other
classes can then suscribe to that event.
Or you can simply pass in the callback function to be called
after the xml has been loaded. In this case you will need to use
the HttpService class since you get access to the Async token that
essentially allows you to pass in addtional information that is
accessible to you in the "called back" method.