Here we are going to explore one TweenLite / TweenMax’s nifty little unsung features: the ability to tween a variable over time. This little trick works great for animating scores in games and just making your life a touch sweeter. Like all things TweenLitey, its really easy.
Sample AS3 Code
import com.greensock.*;
import com.greensock.easing.*;
var score:Number = 0;
var targetScore:Number = 20;
TweenLite.to(this, 1, {score:targetScore, onUpdate:showScore, ease:Linear.easeNone});
function showScore(){
trace(score);
score_mc.score_txt.text = int(score);
}
Resources
DOWNLOAD FILES: snorklTV_sample_TweenVariable_cs3
Official Greensock Tweening Platform Site
My TweenMax Intro Tutorial
Thanks for reading, if you have any questions, just post below.






