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

  • Home
  • SEARCH
  • 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 665069
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T23:40:10+00:00 2026-05-13T23:40:10+00:00

Can someone follow what doing, and show me how to do it correctly? I’m

  • 0

Can someone follow what doing, and show me how to do it correctly? I’m new with strings and arrays. Anything you can suggest would be appreciated.

GOAL
I want script to calling display objects to the stage, and the timer to move images up and down to appear like a scrolling numbers. I start getting sloppy, and mess up passing to Tweener.

THOUGHTS

– An explanation or strategy may be enough, “I’ve got pretty close on this one”
– There was confusion regarding the Containers and addChildren…looked like arrays

THE CODE “get as far as error with NumbersView and numbers undefined etc”

 //-------------------------IMPORT METHODS---------------------------------------
        import flash.display.DisplayObject; 
        import flash.display.MovieClip; 
        import flash.utils.Dictionary; 
        import flash.events.Event; 
        import caurina.transitions.Tweener; 

//-----------------------TIMER---------------------------------------       
    var timer:Timer = new Timer(1000);//
    //var timer:Timer;  
    var count:int = 0; 
    var fcount:int = 0; 
    var _listItems:Array = new Array();
    var previousNums:Array;
    const numHeight:int = 120;
    //var numbers:NumbersView;
    timer.addEventListener(TimerEvent.TIMER, incrementCounter);  
    timer.start(); 

//-----------------------COUNTER-CONT-----------------------
    function incrementCounter(event:TimerEvent) {  
      count++;  
      fcount=int(count*count/1000);//starts out slow... then speeds up 
    //  mytext.text = formatCount(fcount);
    NumbersView(1);
    //}

//----------------------ZERO PLACE HOLDERS-----------------------
    }
    function formatCount(i:int):String { 
         var fraction:int = i % 100; 
         var whole:int = i / 100;  
      return ("000000000" + i).substr(-9, 9); 
       // return ("0000000" + whole).substr(-7, 7) + "." + (fraction < 10 ? "0" + fraction : fraction); 
    } 

    //

//----------------------DISPLAY for loop, integer to string "puts numbers on stage"
    function NumbersView($n:int):void {
     //function NumbersView()//
     //{
        _listItems = new Array();
        previousNums = new Array();
        var item:NumberImage;
        var offset:int = _listItems.length;
        //for (var i:int = 0; i < $n; i++)
     for (var i:Number = 0; i < 9; i++)
        {
           item = new NumberImage();
           //item.x = (i + offset) * 9;
           //item.y = (i + offset) * 9;
        item.x = i * item.width; 
           _listItems.push(item); 
           addChild(item);
        }

//----------------------SPLIT STRING "pass to Tweener or some other method"---------------
    //
       function setTime($number:String):void { 
                var nums:Array = $number.split(""); 
                for (var i:Number = 0; i < nums.length; i++) { 
                if (nums[i] == NumbersView[i]) continue; 
                Tweener.removeTweens(NumbersView[i]); 
       }

The methods were proved separately. “I got a earlier version of the
document going, but I need to work through this to understand it.”

SYMBOL PROPERTIES
CLASS ImageView

TWEENER
The “caurina” folder needs to be present

ROLLING NUMBERS “SUCCESS loading numbers and connecting to counter”

——————————————————————————————–
What I did for Debu’s example
Placed the movie clip object on stage with two dynamic text fields in it.
Note
Make sure the container is placed on stage, has the two text fileds in it, and everything is given a proper instance name. Also include the caurina folder.

seconds MovieClip symbol with instance name of seconds
firstDigit Dynamic text field with instance name of firstDigit, placed in seconds
secondDigit Dynamic text field with instance name of secondDigit, placed in seconds

Symbol
Un-tick ‘Export for ActionScript’
Use ‘Name, Class, and Instance’ correctly

  • 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-13T23:40:10+00:00Added an answer on May 13, 2026 at 11:40 pm

    I’ve implemented a very simple example of what I believe you’re trying to do. It only contains one digit, the seconds, and simply counts up to 9, then back to 0 and up to 9 again. Each time the Timer object I’ve created is fired (every 1000ms, or 1s) it runs a function which tweens in the new digit. I’ve pasted the code below, and commented each line; let me know if you don’t understand any of it.

    import caurina.transitions.*;
    
    //Create a timer that will run for 1 second, and repeat
    var secondTimer:Timer = new Timer(1000);
    
    //A counter for seconds
    var secondsCount:int = 0;
    
    //The original position of the rolling numbers object on the stage
    var originalYPosition:Number = 0;
    //The position of the rolling numbers object on stage when it's displaying its second digit
    var upwardYPosition:Number = -127;
    //The speed you want the odometer to roll at. As this is the seconds counter it needs to be less than 1
    var rollSpeed:Number = 0.25; //seconds
    
    //Start the timer
    secondTimer.start();
    //Add an event listener to fire each time it reaches its limit
    secondTimer.addEventListener(TimerEvent.TIMER, updateOdometer);
    
    //Add a generic update loop, to test for when the odometer has been moved to its 'up' position
    addEventListener(Event.ENTER_FRAME, checkOdometerPosition);
    
    function updateOdometer(event:TimerEvent):void
    {
        //When the timer fires, check if secondsCount is less than 9; if it is, increment secondsCount
        if (secondsCount < 9)
        {
            secondsCount++;
        }
        else 
        {
            //Otherwise set secondsCount to 0, so the odometer will loop from 9 back to 0
            secondsCount = 0;
        }
    
        //Set the text inside seconds > secondDigit equal to the next digit it needs to display.
        seconds.secondDigit.text = secondsCount.toString();
    
        //Do the tween, so that the secondDigit changed above will become visible
        Tweener.addTween(seconds, { y: upwardYPosition, time: rollSpeed, transition:"easeOutQuad" } );
    }
    
    //This function runs all the time, to check when the rolling object has moved upwards
    function checkOdometerPosition(event:Event):void
    {
        //Do the check to see if it's in its upward position..
        if (seconds.y <= upwardYPosition)
        {
            //If it is, make the first digit equal to the current second digit
            seconds.firstDigit.text = secondsCount.toString();
            //Then move the odometer back into its original position..
            seconds.y = originalYPosition;
    
            //This is so that the odometer is ready to be moved upwards again when the timer fires again.
        }
    }
    

    All this code requires is a simple MovieClip object on the stage with two dynamic TextFields inside it; one placed exactly below the other. I’ve named the containing object ‘seconds’, the top-most TextField ‘firstDigit’, and the bottom TextField ‘secondDigit’. Re-create this inside a Flash document, save it (making sure carina is in the same folder), paste the code in on frame 1, and it should work fine. Edit: I created an image to illustrate how the objects should be structured inside your .fla:

    alt text

    Oh, and as for that expert who told you to quote yourself, he doesn’t sound like such an expert to me 😉 Anyway, hope it helps!

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

Sidebar

Related Questions

Can someone share their experiences with s#arp architecture. we have decided to follow mvp
Can someone give me an example of how I would delete a row in
Can someone tell me of a good C++ library for handling (doing operations etc...)
Can someone help me out with this please... I am doing a web form.
As someone that's new to Objective-C can someone give me an overview of the
I'm hoping someone can either tell me what I'm doing wrong correct my flawed
Can someone tell me why I cannot write a class as follows <?php class
Can someone explain it succinctly? Can it be used with non-Silverlight clients?
Can someone recommend an up to date library for data Sanitization in PHP ?
Can someone point me to an article that shows the dropdownlist being populated from

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.