Tween the icon you are over to its normal state
nikolaig Mar 20, 2012 1:47 PMI have this snippet of code I've been running successfuly on my image buttons grouped into one MC.
It applies changes to the buttons I am not rolling over, i.e. if I were to roll over a button the rest of the buttons in the group would dim and blur and etc, but not the button I am over.
All worked fine until I decided to group buttons one more time.
With my limited knowledge of AS3 I was able to put all the actions to the buttons except into making the button I am over to stay the way it is.
In my understanding the problem is in the line:
// target = tween the icon you are over to its normal state
TweenMax.to(e.target, .5, {alpha: 1, blurFilter:{blurX:0, blurY:0}, colorMatrixFilter:{colorize:0x000000, amount:0, brightness:1.25, saturation:1}, ease:Sine.easeOut});
}
particularly in properly specifiying e.target
I tried a few variations but nothing seemed to work.
What would be a proper code to go two levels deep into an MC?
Below is my full code:
IMGS_COLLAGE.buttonMode=true;
IMGS_COLLAGE.useHandCursor = true;
IMGS_COLLAGE.imgORIGINAL_collage.addEventListener(MouseEvent.MOUSE_OVER, navOver);
IMGS_COLLAGE.imgORIGINAL_collage.addEventListener(MouseEvent.MOUSE_OUT, navOut);
////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////
function navOver(e:MouseEvent):void
{
//loop through all icons
for (var i in IMGS_COLLAGE.imgORIGINAL_collage)
{
//tween out all icons
TweenMax.to(IMGS_COLLAGE.imgORIGINAL_collage[i], .2, {alpha:.85, blurFilter:{blurX:11, blurY:11}, colorMatrixFilter:{colorize:0x000000, amount:0.25, brightness:0.65, saturation:0.7}, ease:Sine.easeOut});
}
// target = tween the icon you are over to its normal state
TweenMax.to(e.target, .5, {alpha: 1, blurFilter:{blurX:0, blurY:0}, colorMatrixFilter:{colorize:0x000000, amount:0, brightness:1.25, saturation:1}, ease:Sine.easeOut});
}
function navOut(e:MouseEvent):void
{
for (var i in IMGS_COLLAGE.imgORIGINAL_collage)
{
//tween out all icons to a normal state
TweenMax.to(IMGS_COLLAGE.imgORIGINAL_collage[i], .5, {alpha: 1, blurFilter:{blurX:0, blurY:0}, colorMatrixFilter:{colorize:0x000000, amount:0, brightness:1, saturation:1}, ease:Sine.easeOut});
}
}


