simple as and xml question
Hi there
I have made an xml preloader for my xml file.
This script is in frame2 after my stage preloader.
code:
stop();
xmlObject = new Xml();
xmlObject.load("dbase.xml");
myInterval = setInterval(loadingXml, 10);
function loadingXml() {
if (xmlObject.getBytesLoaded()>=xmlObject.getBytesTot al()) {
play();
trace(xmlObject);
clearInterval(myInterval);
}
}
the xml is preloaded right
Later in scene i have this script(is not made by me)for an xml menu
code:
var array = new Array ();
var xml = new XML ();
xml.onLoad = function ()
{
var header, link;
for (var i = 0; i < this.firstChild.childNodes.length; i++)
{
if (this.firstChild.childNodes[i].nodeName != null)
{
header = this.firstChild.childNodes[i].attributes.header;
}
for (var j = 0; j < this.firstChild.childNodes[i].childNodes.length; j++)
{
if (this.firstChild.childNodes[i].childNodes[j].nodeName == "link")
{
link = this.firstChild.childNodes[i].childNodes[j].firstChild.nodeValue;
}
}
array.push (new struct (header, link));
}
printer ();
};
//xml.load ("dbase.xml");
Now i dont what this xml to load now becouse the animation gets freezes for a sec and i want to use the first xmlObject that i had preloaded.
I have tryed many noobs things like making the _global.xmlOmject
and than xml = _global.xmlObject; but nothing worked.
Can u please tell me how to make this work?
Thank you very much and please excuse me english.