Jump to content
Search Community

Timeline TweenTo

friendlygiraffe test
Moderator Tag

Recommended Posts

import com.greensock.*;
import com.greensock.easing.*;

TweenLite.defaultEase = Linear.easeNone;

var tl:TimelineMax = new TimelineMax();

tl.add( TweenMax.to(mc1,2, {x:"500"}),0.5 );
tl.add( TweenMax.to(mc2,2, {x:"500"}),1 );
tl.add( TweenMax.to(mc3,2, {x:"500"}),1.5 );
tl.add( TweenMax.to(mc4,2, {x:"500"}),2 );
tl.add( TweenMax.to(mc5,2, {x:"500"}),2.5 );

stage.addEventListener(MouseEvent.CLICK,Rewind);

function Rewind(e:MouseEvent)
{
	tl.tweenTo(0);
}

Hi, I'm trying to tween a TimeLine to a certain time in the timeline (0, in this case). 

 

Is it possible to control how quickly this it tweened to? even adding easing?

 

Something like tl.tweenTo(0,2,{ease:Sine.easeInOut});

 

Thanks,

Darren

 

 

Link to comment
Share on other sites

tweenTo() respects the duration / speed of the timeline, however you can add an ease

tl.tweenTo(0, {ease:Bounce.easeOut})

If you want to control the speed at which you get back to 0, you can tween the progress() of the timeline

TweenLite.to(tl, 02, {progress:0, ease:Bounce.easeOut});

And although it may not be what you need now, you can also tween the timeScale() for smooth acceleration and deceleration:

http://codepen.io/GreenSock/pen/LuIJj (JavaScript example but syntax is the same in ActionScript)

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...