thanks for the in depth, but the only part I was confused with was the " xml.firstChild.childNodes[0]childNodes[1].attributes.name;" part.![]()
My final code ended up as:
code:
function getData() {
var x = new XML();
x.ignoreWhite = true;
var Name:Array = new Array();
var id:Array = new Array();
var url:Array = new Array();
x.onLoad = function(){
var Data:Array = this.firstChild.childNodes[_root.accordion.selectedIndex].childNodes;
for(i=0;i<Data.length;i++) {
Name.push(Data[i].attributes.name);
id.push(Data[i].attributes.id);
url.push(Data[i].attributes.url);
list.addItem({label:Name[i], data:id[i]});
window.contentPath:url[i];
}
}
x.load("data.xml");
}
There was a minor change to the XML. Where "desc" was became "url".




Reply With Quote