I’m trying to create a little linking menu, for that I want to use items and then have some text within those items. When the user then clicks on the item, it’s supposed to link. It all has to be loaded externally from an xml file.
Now, I can get it to work half the way, the items come up, but it doesn’t load the text, and it doesn’t link either.
I would really appreciate it, if you guys could help me out here. (please let me know if fla is needed)
My AS:
[AS]var item_spacing = 50;
var item_count = 0;
////////////////////////////
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild.firstChild.childNodes;
header = [];
link = [];
////////////////////////////
for (var i = 0; i<xmlNode.length; i++) {
header* = xmlNode*.childNodes[0].nodeValue;
link* = xmlNode*.childNodes[1].nodeValue;
////////////////////////////
var item_mc = menu_mc.attachMovie(“menu_item”, “item”+item_count, item_count);
item_mc._y = item_countitem_spacing;
item_count++;
////////////////////////////
item_mc.rollOverItem.rollOverText.header_txt.text = header.firstChild.nodeValue;
item_mc.main_btn.onRelease = function() {
getURL(link, “_blank”);
};
}
} else {
content = “file not loaded”;
}
}
////////////////////////////
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load(“offentligeArrangementer_arrangementer.xml”);[/AS]
My XML:
<?xml version="1.0" ?>
<menu>
<menuitems>
<item type>
<header>Kirupa</header>
<link>http://www.kirupa.com/</link>
</item type>
...
</menuitems>
</menu>
Thanks, Morten