Below is my code for buttons the problem I facing is that once button is clicked it wont work again after click of next button. I want to enable the previous clicked button. I hope an expert can help me here.
pages.gotoAndStop("home");
// list of button instance names
var buttonsss:Array = [home, menudown.about, menudown.portfolio, menudown.clients, menudown.pricing, menudown.contact];
for each ( var mc:MovieClip in buttonsss)
{
mc.buttonMode = true;
mc.mouseChildren = false;
mc.addEventListener(MouseEvent.MOUSE_UP, onClick, false, 0, true);
mc.addEventListener(MouseEvent.ROLL_OVER, rolloverEffect, false, 0, true);
mc.addEventListener(MouseEvent.ROLL_OUT, rolloutEffect, false, 0, true);
}
function onClick(e:MouseEvent):void
{
pages.gotoAndStop(e.target.name);
TweenLite.to(e.currentTarget,2,{tint:0xFF0000, ease:Strong.easeOut});
var myTween:Tween = new Tween(pages, "alpha", Strong.easeOut, 0, 1, 2, true);
e.currentTarget.removeEventListener(MouseEvent.ROLL_OUT, rolloutEffect);//disable the roll out effect
e.currentTarget.removeEventListener(MouseEvent.MOUSE_UP, onClick);//disable the roll out effect
e.currentTarget.removeEventListener(MouseEvent.ROLL_OVER, rolloverEffect);//disable the roll out effect
}
function rolloverEffect(e:MouseEvent):void{
TweenLite.to(e.currentTarget,2,{tint:0x000000, ease:Strong.easeOut});
}
function rolloutEffect(e:MouseEvent):void{
//should change tint to null just when its enabled, but its changing always (enabled or disabled)
TweenLite.to(e.currentTarget,2,{tint:null , ease:Strong.easeOut});
}