PDA

View Full Version : Recursive Menu problem



thatsasif
August 16th, 2009, 02:18 PM
ActionScript Code:

function onMouseClickEvent(event:Event) {
var item = event.target.parent;
//trace("CLicked "+item.name);
//trace("Opened state "+item.opened);
if (item.opened == false) {
var px = item.x + 5;
var py = item.height;
item.opened = true;
GenerateMenu(item,px,py,depth,item.xmlNodes);
} else {
trace(item.numChildren);
var cn = item.getChildByName("curm");
trace("removed"+cn.numChildren);
while (cn.numChildren >1) {
trace("removed");
cn.removeChildAt(1);
}
item.removeChild(cn);
item.opened = false;
setmenubg();
}
}




At first when i click the menu a sumenu opens properly. I set item.opened = true; to the menu which i clicked.

Problem is the submenu's item.opened is also automatically set to true which should be false. I mean i have assigned it to false when creating it.

thatsasif
August 17th, 2009, 02:52 AM
Please anyone can help me out with this.

thatsasif
August 17th, 2009, 01:30 PM
Somebody please reply and say whether it is possible to solve it or is it impossible.;(