I’m using the code bellow for a menu:
//button 1
button1.addEventListener(MouseEvent.MOUSE_OVER,over);
button1.addEventListener(MouseEvent.MOUSE_OUT, out);
function over(e:MouseEvent):void{
TweenLite.to (button1,1,{alpha:0});
}
function out(e:MouseEvent):void{
TweenLite.to (button1,1,{alpha:1});
}
The problem is that I’ll have several buttons, and I was imagining if there’s a easer, faster and cleaner way of doing the actions, since all the buttons will have the same rollover and rollout effect.
I tried to use
function over(e:MouseEvent):void{
TweenLite.to (this,1,{alpha:0});
}
but the effect takes place in all stage elements.
Is there a way of doing the effect with Vars or another easer way?
thanks in advance.