real quick before I leave for work:
example code:
Code:links_xml = new XML(); links_xml.load("menulink.xml"); links_xml.ignoreWhite = true; links_xml.onLoad = function(success) { if (success) { trace("XML: " + links_xml); totalLinks = links_xml.firstChild.childNodes.length; trace("TOTAL LINKS: " + totalLinks+newline); for (i = 0; i < totalLinks; i++) { trace("LINK " + i + " DETAILS:"); _root.urlVar = links_xml.firstChild.childNodes[i].childNodes[0].firstChild.nodeValue; trace("URL: " + urlVar); _root.altVar = links_xml.firstChild.childNodes[i].childNodes[1].firstChild.nodeValue; trace("ALT: " + altVar); _root.titleVar = links_xml.firstChild.childNodes[i].childNodes[2].firstChild.nodeValue; trace("TITLE: " + titleVar); trace("-------------------------------------"); } } else { trace("error loading xml"); } };
example button code:
on(press){
getURL("http://www.yourdomain.com/folder/+"_root.urlVar);
}
is an example.. however all buttons will have the LAST url added.. dsince you are only using 1 var.. need to use _root["urlVar"+i]
basically since your in MX you can ASSIGN button actions..as your button dont have instance name (do they?) so you need to dump the value to a VARIABLE so the button can grab it in its execution..




Reply With Quote