hey, I’m attempting to build a menu using a XML. I have read the tutorial on the site and I am attempt to do it in a slightly different manner.
Anyways, I am trying to make dynamic variable names for my text fields. And because of the way I am doing this I found it easier to try to use XML to hold the field name. But when I try to use the name from the XML file it won’t work. I can trace it and get the proper word but when used in the script it breaks.
Below I want to replace ‘popMenu’ with the fieldName variable.
mainMenu.menu1.onRollOver = function(){
listLength = menu_xml.childNodes[0].childNodes;
for(i=0;i<listLength.length;i++){
if(listLength*.nodeName == "m"){
listLength = menu_xml.childNodes[0].childNodes*.childNodes;
tbH = 100;
for(ii=0;ii<listLength.length;ii++){
bCat = menu_xml.childNodes[0].childNodes*.childNodes[ii].attributes.n;
fieldName = menu_xml.childNodes[0].childNodes*.childNodes[ii].attributes.cn;
mainMenu.menu1.createTextField("popMenu",this.getNextHighestDepth(),0,tbH,80,50,50);
mainMenu.menu1.popMenu.text = bCat;
tbH+=15;
trace(ii);
}
}
}
}