Number animation help

Recommended Posts

Hi All,


I'm trying to follow 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(){
    score_mc.score_txt.text = score;

    score_mc.score_txt.text = int(score);, 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, 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?

Share this post

Link to post
Share on other sites



Please keep in mind that tutorial is 7 years old. Since that tutorial was created Adobe has abandoned Flash and GreenSock has moved away from AS3 tooling.

It looks to me that you will need to format that code as class or document class: if you want to load it externally. For general AS3 help, check out the Adobe AS3 forums. 



  • Like 1

Share this post

Link to post
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.