Jump to content
Search Community

TimelineLite and Ease

robertnyc test
Moderator Tag

Recommended Posts

If you have multiple tweens with eases in a timeline, is there an easy way to keep the same ease on reverse? That is, if you have the ease on the original tweens as easeOut, when you reverse() the timeline they become easeIn (as far as I can see), which makes sense. But is there an easy way to make them remain easeOut?

 

I see no overall ease on the timeline itself, although I suppose you could tween the currentProgress of the timeline and then adjust that ease. But that ruins the elegance of the simple timeline play()/reverse() (really nifty stuff!). One could also change the ease on the tweens, but again, that seems kludgy.

 

Am I missing an easier method?

Link to comment
Share on other sites

Nope, you assessed things correctly. You can certainly sequence two tweens back-to-back, one with an easeIn and the other with an easeOut - put 'em both into a TimelineLite and then you can control it as a whole. You could also put labels at each start time so that you can gotoAndPlay("forwards") and gotoAndPlay("backwards"). Just an idea.

Link to comment
Share on other sites

OK, that seems to work, but it seems I would then have to set up all tweens twice (not a big deal, but when there are a lot of tweens....)

 

Does TweenMax store a copy of the ease function, or simply a reference? I thought that the following might be the simplest solution (in pseduo code)

var _ease:Function = Quad.easeOut;

myTweenMax = new TweenMax(something,someTime,{someparams,ease:_ease});
myTimeline = new TimelineMax();
myTimeline.insert(myTweenMax);

function changedirection():void {
if timeline is playing forward {
    _ease = Quad.easeIn;
     timeline.reverse();
  } else {
    _ease = Quad.easeOut;
    timeline.play();
  }
}

 

but that doesn't seem to work

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