heya folks
I can’t get the submenu fired from the mainmenu mc…
the thing is I’l like both the main- and sub menu items to be dynamic so your able to ad a new mainmenu item with whatever submenuitems…
I can launch the first node from submenu items with this…
myXML = new XML();
myXML.ignoreWhite = true;
myXML.load("menu.xml");
myXML.ref = this;
item_count =0;
item_spacing = 30;
function displayText(){
testDisplay_mc.test_txt.text = this.description_text
};
myXML.onLoad = function(success) {
if (success) {
// use XPath to select the node we want
path = "data/work[@categorie='Web']";
var nodes:Array = mx.xpath.XPathAPI.selectNodeList(this.firstChild, path);
for (var i in nodes) {
//this.ref.categorie.push(nodes*.attributes.categorie);
var subnodes = nodes*.childNodes;
//this.ref.Title.push(subnodes[0].firstChild.toString());
//this.ref.description.push(subnodes[1].firstChild.toString());
trace(subnodes)
item_count++;
item_mc = container_mc.attachMovie("item","item"+item_count,i);
item_mc._y = item_spacing*i;
item_mc.item_txt.text = subnodes[0].firstChild.nodeValue
item_mc.description_text = subnodes[1].firstChild.nodeValue
item_mc.onRelease = displayText;
}
} else {
trace("Error loading XML document");
}
};
but I can’t get both describtion a and b out on different mc’s…
any suggestions?
heres my xml for good maesure
<?xml version="1.0" encoding="utf-8"?>
<data>
<work categorie="Web">
<title>title_0</title>
<description>description_0</description>
</work>
<work categorie="Print">
<title>title_1</title>
<description>description_1</description>
</work>
<work categorie="Web">
<title>title_2</title>
<description>description_2</description>
</work>
<work categorie="Print">
<title>title_3</title>
<description>description_3</description>
</work>
<work categorie="Web">
<title>title_4</title>
<description>description_4</description>
</work>
<work categorie="Web">
<title>title_5</title>
<description>description_5</description>
</work>
</data>