Im hoping this is just a small param I am missing. Im loading in an XML file, which has the following line in it to load a swf:
Everything is working fine, except the loading bar flashes 100% full, and then reverts back to 0% to load the swf. Obvisouly it's better if it takes both the XML filesize and SWF filesize into account. I've tried to compensate for that my adding an onComplete into the XMLLoader, but that doesn't seem to fire until both the SWF and XML are loaded. Any thoughts on a better way to do this so the bar doesn't flash?
protected function setLoaders():void {
_isXMLLoaded = false;
_loaderMax = new LoaderMax( { name:"mainQueue", onProgress:loaderProgressHandler, requireWithRoot:true, noCache:true, onComplete:loaderCompleteHandler, onError:loaderErrorHandler, onIOError:loaderErrorHandler, onFail:loaderErrorHandler } );
_loaderMax.append( new XMLLoader("myXML.xml", {name:"lib_xml", estimatedBytes:3000, onError:loaderErrorHandler, onIOError:loaderErrorHandler, onComplete:initLoader}) );
LoaderMax.prioritize("lib_xml");
_loaderMax.load();
}
private function initLoader( $evt:LoaderEvent ):void {
_isXMLLoaded = true;
}
private function loaderProgressHandler( $evt:LoaderEvent ):void {
if(_isXMLLoaded) {
showLoadProgress( $evt.target.progress );
} else {
trace( "LOADING XML:", $evt.target.progress );
}