Jump to content
Search Community

Little Help Please "reverse","play","pause".

aliennoise test
Moderator Tag

Recommended Posts

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();
}

Link to comment
Share on other sites

It's a little unclear of what you're trying to accomplish.

According to your code you're trying to scale the box1 to 1 and 0.5 at the same time, but only after the second rollover.

If you haven't already, I highly recommend checking out the video on TimelineLite/Max basics --> http://blog.greensock.com/timeline-basics/

Make sure you've read through the get started tweening page as well.

It will definitely provide for you a much clearer picture on how everything works. --> http://blog.greensock.com/get-started-tweening/

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...