Jump to content
Search Community

insertMultiple with the same ease function for the whole timeline

Oggy test
Moderator Tag

Recommended Posts

Hello, 

I've been looking for something that looks pretty simple, but I've never found anything about this: I'd like to use the insertMultiple method and play the timeline with one single ease function. What is the correct syntax?

Here is one of the (many) things I've tried so far:

 

 

var myTimeline:TimelineLite = new TimelineLite({onComplete:zoomComplete,    ease:Bounce.easeInOut});
myTimeline.insertMultiple([new TweenLite(R, dureeTween, {x:newR.x, y:newR.y}),
 new TweenLite(I, 2, {x:newI.x, y:newI.y}),
 new TweenLite(Cmin, 2, {x:newCmin.x, y:newCmin.y}),
 new TweenLite(Cmax, 2, {x:newCmax.x, y:newCmax.y}),
 new TweenLite(seuil, 2, {x:newSeuil})] );
 
The ease function does not seem to be taken into account, can someone tell me what I'm doing wrong? Thanks in advance ^^
Link to comment
Share on other sites

Hi

 

Yeah, you can't apply an ease directly to a timeline but you can create a tween that tween's the progress or time of a timeline with an ease. Sounds a little confusing, right?

 

This tutorial here shows exactly how to do it:

http://www.snorkl.tv/2011/03/tween-a-timelinelite-for-ultimate-sequencing-control-and-flexibillity/

 

*note that tutorial was written for v11 (older version) of the platform.

 

In v12 (recent version) you would use progress instead of currentProgress.

 

for your code use:
 

var myTimeline:TimelineLite = new TimelineLite({onComplete:zoomComplete, paused:true});

//insert tweens

TweenLite.to(myTimeline, myTimeline.duration(), {progress:1 , ease:Bounce.easeOut})
Link to comment
Share on other sites

This is a really handy technique. The thing I want to add is that you might also want to apply

ease:Linear.easeNone

to the tweens you are inserting to the timeline if you want a pure Bounce.easeInOut. Otherwise the default ease will still exist on the tweens, which will overlap with the Bounce ease - it will probably still look ok, just not an exact Bounce.easeInOut.

Link to comment
Share on other sites

Hey guys, 

thank you so much for your answers, it's quite tricky indeed and I would have never found it myself  :-P  I must say that the logic is quite confusing, but it does make sense. Precising the linear ease for each and every tween is very weird though. 

But it's working, so thanks again. 

 

Quick note, just in case someone else uses this topic, it's "currentProgress" and not "progress"  ;-)

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