I'm really new at AS3, I'm going through some resource to catch it with the new language in the meanwhile just want to ask you a simple question.
I'm bulding a really simple menu to learn the code. What I have is an object in my library which I 'attach' on the stage. When I click on any of the elements of the menu it just moves on the x axys of few pixels and get disabled so that no further click is possible on it.
Now what I want to achieve is the chance to switch it back when another voice of the menu is clicked, and so on every time a new voice is clicked the previous one switches back onto original position (x = 0). With AS2 was a quite esay task but since just "few" things have changed...
Below you will find an attachment of the movieclip I've created with the relative code.
function eventoDown(e:MouseEvent) {
resetMenu(e.currentTarget.parent);
e.currentTarget.mouseEnabled=false;
e.currentTarget.x=5;
}
function resetMenu(mc:MovieClip):void {
var len:uint=mc.numChildren;
for (var i:uint = 0; i<len; i++) {
var child=mc.getChildAt(i);
if (child.mouseEnabled==false) {
child.mouseEnabled=true;
child.x=0;
}
}
}