Hi-
I’m trying to load text from an xml file to populate the labels of a column of buttons loaded with a for loop, but for some reason the text won’t load. Here’s my code thus far:
patents_xml = new XML();
patents_xml.ignoreWhite = true;
patents_xml.load("text/patents.xml");
patents_xml.onLoad = loadXML
//initializes the xml nodes so they can be used in the movie
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
patentnumber = [];
//claim = [];
//claimnumber = [];
total = xmlNode.firstChild.childNodes.length;
for(i=0; i<total; i++){
attachMovie("patentBtn", "patentBtn"+i, i, {_x:xPos, _y:yPos});
//increase the y position for each button in array
yPos += this["patentBtn"+i]._height+3;
//populates the button labels with pat. numbers from xml file
patentnumber* = xmlNode.childNodes*.childNodes[0].firstChild.nodeValue;
this["patentBtn"+i].buttonLabel_mc.labelText_txt.text = patentnumber*;
};
}
}
Been puzzling over this for several hours and can’t see where the problem is. Any suggestions welcome.