Jump to content
Search Community

Does .append() cause items to load twice?

BirdInTheCity test
Moderator Tag

Recommended Posts

When checking out the activity panel in Safari, I noticed that the LoaderMax.append() functions seems to cause the browser to attempt to load things twice. Below is the test code that I'm using.

 

 

As you can see in the image, things appear to be loading, canceled and loaded again. Is the correct? I ask because I have more complex code that seems to load things fine in Safari and Firefox... but in Chrome the images are not loading correctly and I'm trying to figure out why this is occurring.

 

SafariBar.png

 

package  {

import flash.display.*;
import com.greensock.loading.*;
import com.greensock.loading.display.*;
import com.greensock.events.LoaderEvent;
import flash.events.*;

public class Test2 extends Sprite {

	var queue:LoaderMax;
	var queue2:LoaderMax;

	public function Test2() {

		LoaderMax.activate([imageLoader, SWFLoader, DataLoader, VideoLoader]);

		queue = new LoaderMax({name:"mainQueue", onComplete:loadOthers});
		queue.append( new XMLLoader("webAssets.xml", {name:"xmlDoc"}) );

		queue.load();			

	}

	public function loadOthers(e){
		trace("loading others");
		queue.getLoader("ingels_gallery").load();
	}
}
}

Link to comment
Share on other sites

If you don't set auditSize:false on your LoaderMax, it will loop through its children and find any that don't have an estimatedBytes defined and attempt to audit their size initially (only loading enough of the file to determine its bytesTotal). This makes the progress reporting much more accurate. Again, if you don't want that behavior, either set auditSize:false or make sure you define an estimatedBytes for each loader.

 

There does appear to be a bug in Chrome (not LoaderMax) that can cause trouble when files are audited but please make sure you have the latest version of LoaderMax because several browser bugs were worked around in recent versions. If that doesn't solve it, just set auditSize:false. There's a master switch for that too - if you want the default value of auditSize to always be false, set LoaderMax.defaultAuditSize = false;

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...