Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Counter in Flash

New Here ,
Jan 05, 2016 Jan 05, 2016

I'm currently working on a Flash animation that requires a counter from $0-$100,000 which will be converted into a movie for a website, how easy can this be done in flash?

It needs to start 'onframe' and will not have a button to start the counter.

Thanks!

TOPICS
ActionScript
482
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Enthusiast , Jan 06, 2016 Jan 06, 2016

- Create a dynamic text field on the stage > give it an instance name > embed the font you want to use

- Add the following code in frame one:

var currentCount = 0;

var totalCount = 1000000;

addEventListener(Event.ENTER_FRAME, onEF);

function onEF(e:Event):void

{

     currentCount +=1;

     textFieldName.text = "$ " + currentCount;

    

     /// If you want to repeat it or you want to do anything on complete count:

     if (currentCount == totalCount)

     {

          //reset the currentCount:

          curre

...
Translate
Enthusiast ,
Jan 06, 2016 Jan 06, 2016

- Create a dynamic text field on the stage > give it an instance name > embed the font you want to use

- Add the following code in frame one:

var currentCount = 0;

var totalCount = 1000000;

addEventListener(Event.ENTER_FRAME, onEF);

function onEF(e:Event):void

{

     currentCount +=1;

     textFieldName.text = "$ " + currentCount;

    

     /// If you want to repeat it or you want to do anything on complete count:

     if (currentCount == totalCount)

     {

          //reset the currentCount:

          currentCount = 0;

          // If you want to stop the counter:

          // removeEventListener(Event.ENTER_FRAME, onEF);

     }

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 06, 2016 Jan 06, 2016

Great, thanks nezarov for your help!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jan 06, 2016 Jan 06, 2016
LATEST

You're welcome.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines