Hi there,
I am really stuck here. this what i want to do:
1: Create a menu from xml
2 with a subMenu.
3 and that subMenu slides in.
To accomplish this i used http://www.kirupa.com/developer/flash5/slidingmenu.htm
for the movement.
Now in AS i have
makeMenu = function (success) {
// linkage name of button movieclip
myItem = "menu_btn";
// initialize x and y pos
myX = -50;
myY = 50;
for (i = 0; i < myXML.firstChild.childNodes.length; i++) {
//trace (myXML.firstChild.childNodes.length);
title = (myXML.firstChild.childNodes*.attributes.NAME);
//trace (title);
this.attachMovie (myItem, "title" + i, i + 5);
// attach item button graphic for each menu heading
thisItem = this["title" + i];
thisItem.menuLabel = (title);
// label the button with id attribute of XML node
thisItem._x = myX += (thisItem._width);
// reposition item on Y axis
thisItem._y = myY;
k= i;
trace("k has a value of = " +k);
// to move the submenu calculate X-target pos
thisItem.onPress = function () {
if (k < 4) {
trgt = 8 - (k * 2);
_root.xnew = _root.mask2._x + (trgt * (500 / 2));
trace ("xtarget= " + _root.xnew);
} else {
trgt = 8 - ((k * 2) + 2);
_root.xnew = _root.mask2._x + (trgt * (500 / 2));
trace ("xTarget= " +_root.xnew);
}
};
}
};
I want to use the thisItem.onPress to set the xnew
any suggestions.