Hello
I have a Image XML menu that works well, but with a litle problem with target in TweenMax. I will post only the code that is relevant to resolve the problem, I hope .
I have a MC in library, and inside I have 3 movie clips, img_mc, bg_mc (this is a background for text) and title_mc (inside this mc I have a textfield named title-txt).
I create a for loop for the MC, so I use e.currentTarget in my tween animations.
When I hovered the title_mc is suposed to scale the background, but because bg_mc are back the hover don't works. I do not know how to target the title_mc for on MOUSE:OVER scale the bg_mc.
MY CODE:
for (var i:Number = 0; i < my_total; i++)
{
//CREATE THE LOOP FOR MOVIE CLIP THAT I HAVE IN LIBRARY WITH THE CLASS "menu_item"
var MC:MovieClip = new menu_item();
MC.id = "i" + i;
MC.label = my_menu[i]. @ LABEL;
MC.name = "mc" + i;
//INITIAL ANIMATIONS
TweenLite.to(MC, 0, {alpha:0});
TweenMax.to(MC.container_mc.img_mc, 0, {colorMatrixFilter:{colorize:0xffffff, amount:1}});
TweenMax.to(MC, 2, {dropShadowFilter:{color:0x000000, alpha:0.7, blurX:15, blurY:15, distance:15}});
//ANIMATION EVENTS
MC.container_mc.bg_mc.addEventListener(MouseEvent.MOUSE_OVER, hover_bg);
MC.container_mc.bg_mc.addEventListener(MouseEvent.MOUSE_OUT, out_bg);
function hover_bg(e:MouseEvent)
{
TweenLite.to(e.currentTarget,1,{scaleY:1.2,ease:Quad.easeInOut});
TweenLite.to(e.currentTarget,1,{alpha:0.8});
}
function out_bg(e:MouseEvent)
{
TweenLite.to(e.currentTarget,1,{scaleY:1,ease:Quad.easeInOut});
TweenLite.to(e.currentTarget,1,{alpha:0.6});
}
This Last piece of code don't works because title_mc is over bg_mc.
If I put in event listener MC.container_mc.title_mc.addEventListener(MouseEvent.MOUSE_OUT, out_bg); the Text will scale too, and I don't want this...
Thanks