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

Animate numbers within a range using actionscript

New Here ,
Aug 12, 2008 Aug 12, 2008
Hi all,
well i am trying to create this simulation where in lot of numbers keep changing based on the time line. I find it really hard to manually animate the numbers frame by frame. Is there a way that i can specify a dynamic text and specify a range of 50-100 and then its starts generating the numbers automatically from 50,51,52... etc, and it should reach the end range at a specified frame.

If i follow this method, animating a number from 10-50 and 1-6 will happen in the timeline of 80 frames.

Please help..... Thanks in advance...
TOPICS
ActionScript
408
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
LEGEND ,
Aug 12, 2008 Aug 12, 2008
You can just use a setInterval function to count up. Then you can set an interval value that will get you the timing that you want to have. Something like the code below will change the number every .2 seconds. It requires a dynamic textfield named "numbers".
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 ,
Aug 12, 2008 Aug 12, 2008
Thanks a lot...

But i am able to see the values when i put a trace command for maxCount and count, but when i put trace command for trace(numbers); i am getting some junk values like these..
"<p align="left"></p>"

how do i fix this ???
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 ,
Aug 12, 2008 Aug 12, 2008
When i create a dynamic text field on runtime then its working out fine......
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
LEGEND ,
Aug 13, 2008 Aug 13, 2008
LATEST
That junk that you were seeing in the trace is because you have html text selected for that textfield. You will just see the text as you expect in the actual textfield.
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