I have an xml file that has 3075 entries that look something like this
<item id="1" itype="COLOUR"></item>
I'm using action script 2 to load the xml and then a while loop the enter all data into an array using this code.
my_xml = new XML();
paper_crumbs = Array();
my_xml.load("sample.xml");
my_xml.onLoad = my_function;
my_xml.ignoreWhite = 1;
function my_function() {
var b = true;
var num = "1";
while(b == true){
paper_crumbs[my_xml.firstChild.childNodes[num].attributes.id] = {type: my_xml.firstChild.childNodes[num].attributes.itype, cost: 0, is_member: false};
if(my_xml.firstChild.childNodes[num].attributes.final == "yes"){
b = false;
trace("done");
}
num = num + 1;
}
}
The problem i am having is that it makes flash unresponsive then asks if i would like to terminate the script, is there any other way i can loop through the xml and add them to an array or could someone edit the while so it works?