Jump to content
Search Community

Prioritize LoaderMax items within a XML

Wonder Giant test
Moderator Tag

Recommended Posts

I searched around for other posts about this topic, but didn't have much luck, so I'll try to explain my situation as simple as possible:

 

1. 'index.swf' has an XMLLoader that loads 'config.xml' with 'requireWithRoot' turned on so it is a part of my preloaders total "100%"

2. config.xml (sample below) has SWFLoader's and XMLLoaders inside of it that automatically get parsed and loaded.

 

-- here is the issue ---

 

3. config.xml has SWFLoaders that contain font swfs that need to be loaded in BEFORE the other items inside my config.xml get loaded in.

4. I attempted to set a "prioritize=true" on their SWFLoader xml nodes, but it doesn't seem to bump them up to the top. It seems to load all the nodes form the config.xml in a fairly random order.

5. I need all of these items to be a part of the same load process since they all need to add up to the intial "100%" in my preloader.

 

-- here is the question --

 

How do I get the font SWFLoader nodes to make sure they are loaded before the other items in the config.xml, but also make sure all of it takes part in the same load sequence so they all count toward my preloaders "100%".

 

Hope that makes sense, and thank you for any help!

 

-- here is my sample xml ---

 

 

Link to comment
Share on other sites

In the spirit of giving back and not jut having another dead question post, I will post my work-around solution until I know of a better way.

 

1. I load the config.xml separately and DON'T include it in the preloaders progress

2. Once that is loaded I loop through the xml and "queue.append ()" all the loaders in it to a new LoaderMax instance

3. Before starting my new LoaderMax, I loop through my font nodes that I needed first and tell them all to LoaderMax.prioritize ();

 

Probably not completely ideal since this requires me to know ahead of time what nodes in the config.xml that I need to loop through and add to the queue (somewhat defeating the purpose of having LoaderMax instances in the xml), but at least it works. I get my config.xml and fonts loaded first before the main swf files need them.

Link to comment
Share on other sites

The loaders are NOT loaded in a random order. They are always loaded in the order that they show up in the XML, but by default, the maxConnections is set to 2 so it will always try to load 2 at a time, filling the pipeline to speed things up. You can easily set the maxConnections to 1 by defining your loaders inside a node in the XML, like:







 

That way, it will load one at a time, one-after-the-other like you wanted.

 

Make sense?

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...