i am still learning actionscript and i am tryin to make a dynamic xml menu. i have stored the url links in the xml file, but i cannot get the getURL function to work. can anyone give some advice. thanks!
var menuXML:XML = new XML();
menuXML.ignoreWhite = true;
menuXML.onLoad = loadXML;
function loadXML(success) {
spacing = 120;
if (success) {
xmlNode = this.firstChild;
menu = [];
url = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
menu* = xmlNode.childNodes*.attributes.title;
url* = xmlNode.childNodes*.attributes.url;
newBut = menuHolder.attachMovie("button", "but"+i, i);
newBut._x = (i*spacing);
newBut.menu_txt.text = menu*;
_parent["but"+i].onRelease = function() {
getURL(url*);
};
}
}
}
menuXML.load("menu.xml");
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<buttonmenu>
<menu title = "HOME" url = "http://www.home.net"></menu>
<menu title = "ABOUT" url = "http://www.google.com"></menu>
<menu title = "CONTACT" url = "http://www.cnn.com"></menu>
<menu title = "NEWS" url = "http://www.abc.com"></menu>
<menu title = "HISTORY" url = "http://www.123.com"></menu>
<menu title = "EXTRAS" url = "http://www.xyz.com"></menu>
</buttonmenu>