How do I preload multiple XML files?

Hi there

I want to preload multiple XML files using the XML.load method.
I know how to do this for one XML file, but I’m interested in preloading multiple XML files (My data + config settings).

How would one do this?
I thought of 2 ways, but I don’t think they’re very nice programming:

  1. Preload the first XML and do another XML.load within the XML.onload. But that way, you get a lot of nested functions if you want to preload more than 2 files.
  2. Preload both the XML files at the same time, and use a counter to check if all the XML.onload are executed.

Are there other ways?

check the source and experiments section for this

creatify has made something pretty ■■■■ cool i think.

Otherwize, like you said, load multiple xml files into seperate var’s and access when needed.

Looks cool, thanks.

After a search I found a nice way of preloading the xml by going through an array of the xml files. When it’s completed you have to do the same thing once again, but the xml file will be cached on the user’s computer.

Could you be more specific about the exact solution you found? I am having the same problem, and unfortunately, every time I try to load multiple xml files the whole server crashes saying too many mysql connections (the XML files are created dynamically).