Groups | Blog | Home
all groups > flash data integration > april 2005 >

flash data integration : Best practice for loading multiple XML files at once.


aventurella
4/5/2005 4:23:07 PM
I was curious as to what the best practice was when loading multiple multiple
XML files at once into a flash movie. At first thought I have 2 options,

a new XML object for each XML file to be loaded.

Or

Cycle though one object for all of the loading, by storing the file names into
an array, and looping though the array to load them via one XML object.

Anyway, anyone have any suggestions? The files are not that large, and only
conatain site copy.


thanks!
aventurella
4/5/2005 6:26:36 PM
So... I have resolved to just do this for each XML file I am loading (x4): ( So
my next question is how do I tell of all of the XML files are loaded before
proceeding? I could set a flag variable to auto increment in each function and
if it, in my case, == 4 then I can continue on, otherwise don't. Any better
ways to approach this that anyone knows of?)



var solutionsData:XML = new XML();
solutionsData.ignoreWhite = true;
solutionsData.onLoad = processSolutions;
solutionsData.load("xml/sec-solutions.xml");
ncomposer
9/19/2005 12:00:00 AM
Dimitar
9/19/2005 12:00:00 AM
There are many and different solutions but I think all of htem include
different XMLConnector (XML) class instances.
You could:
1) Store the different XML data into different arrays
2) Different DataSets

SOlving the execution of any of the xml if only all of them were loaded could
be done with a small movieclip with animation loading (called Msg_mc here).
Inside a textfield (Msg_txt) and Msg_mc._invisible = false;
- Assign onLoad() event for all the XML which gives Msg_mc._visible = true;
Thus the Msg_mc will stay visible until all the XML files are loaded till the
end. Could be done with try throw exceptions.
- assign a timeInterval function to check 5 times per second if a var
bool:Boolean != Msg_mc._visible. The moment bool = false (Msg_mc._visible =
false, thus everthng loaded), delete setInterval(timeInterval); and then load
the stuff you need.

For sure there is a simpler decision for this but this popped in my head now.

Dimitar
AddThis Social Bookmark Button