Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 669655
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T00:10:29+00:00 2026-05-14T00:10:29+00:00

It’s not that noticeable at first, but my counter skips over to zero and

  • 0

It’s not that noticeable at first, but my counter skips over to zero and ignores the nines.
How can I get my counter to not skipping the nines?

Display Object
It’s a column descending from 0-9. ‘The object and the values appear correct except the skip’

my FLA

import flash.display.Sprite; 
import flash.events.Event; 
import flash.utils.Timer; 
import flash.events.TimerEvent; 

var timer:Timer; 
var count:int = 0; 
var fcount:int = 0; 
var numbers:NumbersView; 

trace("-----new NumberDocument created");
timer = new Timer(10); 
timer.addEventListener(TimerEvent.TIMER, incrementCounter);     
timer.start();    
numbers = new NumbersView(); 
addChild(numbers); 

addEventListener(Event.ENTER_FRAME, enterFrameHandler);
//addEventListener(Event.ADDED_TO_STAGE, traceMeOut);


function incrementCounter(event:TimerEvent) 
{     
    count++;     
    fcount=int(count*count/1000); 
} 

function formatCount(i:int):String 
{    
    return ("000000000" + i).substr(-9, 9); 
} 

function enterFrameHandler(e:Event):void  
{ 
    numbers.setTime(formatCount(fcount)); 
} 
function traceMeOut()
{
    trace("-----Im here on stage!");
}

NumbersView.as

//NumbersView.as - Your Document Class 
package { 

    import flash.display.MovieClip; 

    public class NumbersView extends MovieClip { 

        private var _listItems:Array;  
        private const numHeight:int = 120;  

        public function NumbersView()   
        {  
            _listItems = new Array(); 

            var item:NumberImage;  
            for (var i:Number = 0; i < 9; i++) {  
                item = new NumberImage();  
                addChild(item);  
                item.x = i * item.width;  
                _listItems.push(item);  
            } 

            setTime('123456789'); 

        } 

        public function setTime($number:String):void {  
            var nums:Array = $number.split("");  
            trace(nums); 

            for (var i:Number = 0; i < nums.length; i++) {  

                _listItems[i].start( int(nums[i]) ); 

            }  

        }  


    } 
}

Variation of NumbersView.as with Tweener

//...SNIPPET
public function setTime($number:String):void { 
        var nums:Array = $number.split(""); 
        for (var i:Number = 0; i < nums.length; i++) { 
            if (nums[i] == previousNums[i]) continue; 
            Tweener.removeTweens(_listItems[i]);    

            var nuNum:int = int(nums[i]);
            var nuY:int = nuNum == 0 ? 0 : (nuNum - 1) * -numHeight;

            trace("nuY = " + nuY);
            trace("cY = " + _listItems[i].y);

            Tweener.addTween(_listItems[i], { y:nuY, time:0 } );
        } 
        previousNums = nums; 
    } 

Variation of NumbersView.as that doesn’t skip 9, but resets from bottom every count

    //...SNIPPET 
    public function setTime($number:String):void { 
        var nums:Array = $number.split(""); 

        for (var i:Number = 0; i < nums.length; i++) { 
        if (nums[i] == previousNums[i]) continue; 
            Tweener.removeTweens(_listItems[i]); 

        var newY:int = int(nums[i]) * -numHeight; 
        if (_listItems[i].y < 0) _listItems[i].y = numHeight; 
            Tweener.addTween(_listItems[i], { y:newY, time:3 } ); 
        } 
        previousNums = nums; 
    }

PUBLIC CLASS extends MovieClip
place ‘NumbersView.as’ in same directory

CLASS
Library/’right-click’ Properties/Class:NumberImage

SYMBOL
number column 70×1080
numbers 70×120

TWEENER
caurina folder in local directory

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T00:10:29+00:00Added an answer on May 14, 2026 at 12:10 am

    I’m struggling to follow your code and work out exactly what you mean, so this is a bit of a guess.

    In NumbersView.as should

    (var i:Number = 0; i < 9; i++)
    

    be:

    (var i:Number = 0; i <= 9; i++)
    

    The first will go through numbers 0 to 8 and the altered will go through numbers 0 to 9.

    However I may have missed the point you were trying to explain.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I need a function that will clean a strings' special characters. I do NOT
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I want to count how many characters a certain string has in PHP, but
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a jquery bug and I've been looking for hours now, I can't
I have a small JavaScript validation script that validates inputs based on Regex. I
I've got a string that has curly quotes in it. I'd like to replace

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.