Hello I am making a flash drop down menu, it works fine but instead of using nodes for the drop downs i need to do it by a category attributes for example:
<mainbutton>
<sub />
<sub />
</mainbutton>
<mainbutton />
etc to
<mainbutton cat="1">
<mainbutton cat="2">
<mainbutton cat="2">
the 1 being the main button the 2's being the sub drop downs. Any links would def. help ive never done it like this before...
Code:
if (success) {
for (i=0; i<xml.firstChild.childNodes.length; i++) {
attachMovie("buton",["but"+i],i);
ref = _parent.button["but"+i];
ref._x = i*140;
ref.title.text = xml.firstChild.childNodes[i].attributes.label;
ref.link = xml.firstChild.childNodes[i].attributes.sWhatsCalled;
ref.targetWin = xml.firstChild.childNodes[i].attributes.stargetwindow;
for (j=0; j<xml.firstChild.childNodes[i].childNodes.length; j++) {
var subHeight = xml.firstChild.childNodes[i].childNodes.length;
var subH = (subHeight * 30);
trace(subH);
ref.sub_mc.sub._visible = false;
ref.sub_mc.sub.attachMovie("sub",["sub"+j],j);
refer = ref.sub_mc.sub["sub"+j];
refer._y = j*30;
refer.title.text = xml.firstChild.childNodes[i].childNodes[j].attributes.label;
refer.link = xml.firstChild.childNodes[i].childNodes[j].attributes.sWhatsCalled;
refer.targetWin = xml.firstChild.childNodes[i].childNodes[j].attributes.stargetwindow;
refer.onRelease = function() {
getURL(this.link, this.targetWin);
};
ref.sub_mc.sub._y = -ref.sub_mc.sub._height;
}
theres some of the as2 thanks