Hi everybody my name is Igor .. and I'm a Newb.. sounds like AA meeting a?
I'm a complete Newb trying to figure out how the AS3 code works..in general.
What I'm trying go figure out how to make an animation execute on ROLL_OVER and ROLL_OUT
i tried removing
var timeline:TimelineLite = new TimelineLite();
timeline.append(TweenLite.to(box1, 1, {x:"400", scaleX:0.5, scaleY:0.5, ease:Back.easeIn}));
this.timeline.pause();
and placing everything in
TweenLite.to(box1, 1,{scaleX:1, scaleY:1, ease:Cubic.easeOut});
TweenLite.to(box1, 1,{dropShadowFilter:{color:0x000000, alpha:0.5, blurX:5, blurY:5, strength:0.5, angle:195, distance:12}, alpha:0.5, ease:Cubic.easeOut});
timeline.reverse();
}
function outHandler(event:MouseEvent):void {
TweenLite.to(box1, 1,{scaleX:0.2, scaleY:0.2, ease:Cubic.easeIn});
timeline.play();
}
but the animation then starts from the place ROLL_OVER executes and animation ends on a different X, Y, position.
Any help would be appreciated, i tried searching forums and found some answers, but fundamentals i cant figure out where I'm making a wrong turn.
Thx.. by the way.. GreenSock made my Newb status to Newb+ , very easy to understand and this is where it all started for me.
import com.greensock.*;
import com.greensock.easing.*
var timeline:TimelineLite = new TimelineLite();
timeline.append(TweenLite.to(box1, 1, {x:"400", scaleX:0.5, scaleY:0.5, ease:Back.easeIn}));
this.timeline.pause();
button.addEventListener(MouseEvent.ROLL_OVER, overHandler);
button.addEventListener(MouseEvent.ROLL_OUT, outHandler);
function overHandler(event:MouseEvent):void {
TweenLite.to(box1, 1,{scaleX:1, scaleY:1, ease:Cubic.easeOut});
TweenLite.to(box1, 1,{dropShadowFilter:{color:0x000000, alpha:0.5, blurX:5, blurY:5, strength:0.5, angle:195, distance:12}, alpha:0.5, ease:Cubic.easeOut});
timeline.reverse();
}
function outHandler(event:MouseEvent):void {
TweenLite.to(box1, 1,{scaleX:0.2, scaleY:0.2, ease:Cubic.easeIn});
timeline.play();
}