Hi All,
I'm trying to follow http://www.snorkl.tv/2010/09/how-to-tween-a-variable-with-flash-and-tweenlite/ to build simple number animation.
Below is the sample codes:
import com.greensock.*;
import com.greensock.easing.*;
var score:Number = 0;
var targetScore:Number = 0;
function showScore(){
trace(score);
score_mc.score_txt.text = score;
}
targetScore=10;
score_mc.score_txt.text = int(score);
TweenLite.to(this, 4, {score:targetScore, onUpdate:showScore, ease:Linear.easeNone});
It works fine in the main timeline, however, when I run the same code in .as file it doesn't work.
By doing some troubleshooting, I noticed in
TweenLite.to(this, 4, {score:targetScore, onUpdate:showScore, ease:Linear.easeNone});
value cannot be passed to score (trace results shows 0 all the time).
Can anyone please help?