Search In
• More options...
Find results that contain...
Find results in...

insertMultiple with the same ease function for the whole timeline

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

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

//insert tweens

TweenLite.to(myTimeline, myTimeline.duration(), {progress:1 , ease:Bounce.easeOut})```
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.

Share on other sites

Thanks, Jamie. You are exactly right. The tweens in the timeline should have ease:Linear.easeNone. Nice catch.

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

Share on other sites

Glad to hear you are having success.

As noted above progress vs currentProgress depends on the version of the library you are using.

I would strongly recommend you use version 12 which uses progress. Lots of enhancements and new features.

http://www.greensock.com/v12/

get it here: