Here we are going to talk about a tweening technique that will open up a whole new way of controlling sequenced animations. With GreenSock’s Tweenlite we can tween and ease the playback rate of a timeline or tween. Press the butons in the swf above to see how tweening the currentProgress property of a simple TimelineLite can have dramatic effects.
Watch the Video on Tweening currentProgress and timeScale
This tutorial focuses on tweening a TimelineLite instance’s currentProgress and timeScale properties. I want to note that you can also tween these properties on TweenMax tweens as well. TweenLite and TweenNano do not have these properties.
Often people ask how they can adjust the playback of their allTo() tweens. Usually they want to progressively speed up the animation or the delay. Being that allTo() creates an array of tweens, and not a single tween, we need to put the allTo into a TimelineLite/Max first. Once all these tweens are added to a timeline we can tween that timeline’s currentProgress or timeScale properties to get the effect we want.
Sample Code for easing the currentProgress of a TimlineLite
var tl:TimelineLite = new TimelineLite({paused:true});
tl.appendMultiple(TweenMax.allTo(mcs_array, 1, { scaleX:1, scaleY:1, alpha:1 }, .2));
//create a tween that changes the currentProgress of the timeline named tl
var bounceOut:TweenLite = TweenLite.to( tl, 3, { currentProgress:1, ease:Bounce.easeOut } );
restarting a tween of a timeline
If your timeline has already played to the end (without the aid of a tween) note that its currentProgress will be 1. Tweening the currentProgress to 1 will have no effect as the virtual playhead is already at the end.
It may be necessary to rewind the timeline before tweening its currentProgress like so
tl.currentProgress = 0; bounceOut.restart();
Tween a tween’s timeScale property for smooth fast forward action
A tween or timeline’s timeScale property dictates the speed at which it play. By default the timeScale of a tween is set to 1. The lower the timeScale, the slower it will play. To speed up a tween or timeline, simply adjust the timeScale to be greater than 1.
AS3 code to smoothly adjust a timeline’s playback speed on the fly
TweenLite.to(tl, .5, {timeScale:8});
Download Source Files
Additional Resources
Some more TimelineLite/Max Tutorials: From Snork.tv
Offical TimelineLite/Max info: From GreenSock.com






