views:

119

answers:

1

I am loading multiple xml files with URLLoader.

for (var i=0;i<xmlCount;i++) {
     loadXML(xmlFiles[i], i);
}

public function loadXML(req:String=null, _id:Number=0):void {
     var loader:URLLoader = new URLLoader();
     loader.addEventListener(ProgressEvent.PROGRESS, 
             function a(e:ProgressEvent) {XMLLoadProgress(e, _id);});
     loader.addEventListener(Event.COMPLETE, XMLLoadFinished);
     loader.load(new URLRequest(req));

}

private function XMLLoadProgress(e:ProgressEvent=null, _id:Number=0):void {
     dispatchEvent(new LoadingEvent(Model.LOADING_PROGRESS, _id, (e.bytesLoaded/e.bytesTotal)*100));
}

The problem is I think LOADING_PROGRESS gets dispatched after all the loading is done and each xml is loaded one by one not asynchronously.

How could I make it load asynchronously and also make it so progress event is called for each progress tick.

A: 

I'm guessing this only happens when viewing over a fast connection. Try viewing with a slow connection (Charles Proxy has the ability to artificially slow down your connection).

Dusty J
Tried with simulate download but it didn't change.
gok