Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...

AmandaWarner

Members
  • Posts

    2
  • Joined

  • Last visited

Posts posted by AmandaWarner

  1. Thanks so much for your response. 

     

    When I was setting estimatedBytes before, I was accounting for just the size of the xml files themselves for the top level XMLLoaders. After reading your message, I've made these numbers much larger to account for all the images that will be referenced within these files so that the initial estimate isn't so completely off. Not perfect, but it at least seems to have resolved the initial jumping backwards problem.

     

    Thanks for your help!

  2. I'm using LoaderMax to load an XML file that contains additional XMLLoader nodes.

    <sections>
      <XMLLoader activity_type="epi_activity" title="Introduction" url="xml/introduction.xml" load="true" />
      <XMLLoader activity_type="epi_activity" title="Stages of TB" url="xml/definitions_drag_and_drop.xml" load="true" />
      <XMLLoader activity_type="epi_activity" title="Risk Factors for TB Infection and Disease" url="xml/risk_factors_timeline.xml" load="true"  />
      <XMLLoader activity_type="epi_activity" title="Comparing Risk Factors" url="xml/compare_situations.xml" load="true" />
      <XMLLoader activity_type="epi_activity" title="Risk Factors Review" url="xml/risk_factors_drag_and_drop.xml" load="true" />
      <XMLLoader activity_type="epi_activity" title="Addressing Misconceptions" url="xml/misconceptions.xml" load="true" />
      <XMLLoader activity_type="epi_activity" title="Data Interpretation" url="xml/data_interpretation.xml" load="true" />
      <XMLLoader activity_type="epi_activity" title="The Global Picture" url="xml/maps.xml" load="true" />
      <XMLLoader activity_type="epi_activity" title="Conclusion" url="xml/conclusion.xml" load="true" />
    </sections>
    

    These xml files then contain ImageLoaders.

     

    For example, here is a short snippet from introduction.xml. Each file contains multiple ImageLoaders.

    <page>
      <text>Your progress will be saved once you complete each menu item, so if you need to leave and come back to a module at a different time, that’s fine.</text>
      <ImageLoader name="menu" url="images/menu.png" load="true" x="500" y="100" />
    </page>
    

    Everything loads as desired. However, I can't seem to make my progress bar not jump. When I trace out the progress, it very consistently starts around .49, followed by .98, and then drops to .05. It then continues to be pretty jerky throughout the load.

     
    I've read the tips and tricks for using LoaderMax. I've tried using rawProgress instead of progress, and I have the same result. I've also tried adding/omitting estimatedBytes, but I always still get the initial jump to .48 and then .98.  

     

    Here is my AS for the loader:

    public function Main() {
    			
      addChild(loadingAssetsView);
    
      LoaderMax.activate([ImageLoader]);
      queue = new LoaderMax({name:"mainQueue", onProgress:progressHandler, onComplete:XMLLoaded});
      queue.append(new XMLLoader(menuXMLURL, {name:"module"}));
      queue.load();
    						
      navigationView.addEventListener(Event.CHANGE, loadMenu);
    
    }
    		
    private function progressHandler(event:LoaderEvent):void {
      loadingAssetsView.progressBar.progressBar.scaleX = event.target.progress;
      loadingAssetsView.textField.text = Math.round(100*(event.target.progress)) + "%";
    			
      trace(event.target.progress);
    }
    

    Is it initially reporting progress for just the top level XMLLoader? Is there any way to get the loader to report progress for all the loaders in both the top level XML and the referenced XML files at once?

     

    Thank you in advance for any suggestions!

    • Like 1
×