A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: Creating a counter

  1. #1
    Junior Member
    Join Date
    Jan 2002
    Posts
    4

    Creating a counter

    Hi,

    I'm a Flash newbie and in some need of some help.

    Here's what I'm trying to do:

    Create a counter that starts with the number 298,000,303.
    The counter needs to move at 90 numbers per minute. So basically, when the first minute is up, it should read 298,000,393. I would like to make the counter depend on the host computers internal clock for accuracy. What I'm trying to do is get to the number 298,011,103 by 11am if I start the counter at 9am.

    Any assistance on this would be greatly appreciated!!!

    Thanks,
    Fernando

  2. #2
    Junior Member
    Join Date
    Nov 2001
    Posts
    21

    Re: Creating a counter

    Originally posted by Decoy007
    Hi,

    Create a counter that starts with the number 298,000,303.
    The counter needs to move at 90 numbers per minute. So basically, when the first minute is up, it should read 298,000,393. I would like to make the counter depend on the host computers internal clock for accuracy. What I'm trying to do is get to the number 298,011,103 by 11am if I start the counter at 9am.

    Any assistance on this would be greatly appreciated!!!

    Thanks,
    Fernando
    ok you could use the GetSeconds() if your keen to use the internal clock but why not just use the frame rate you set for the movie ? you need 11/2 counts per second if you set the frame rate to 15fps (wont be a problem if the scene isnt to compliacted) and decrement the counter ever 10 frames !
    of course if you dont need to count by ones you could just decrment by 90 every 60frames at 1fps

    there are heaps of options just work one out that suits your needs

    regards


  3. #3
    Junior Member
    Join Date
    Jan 2002
    Posts
    4

    Re: Re: Creating a counter

    Originally posted by robogumby
    Originally posted by Decoy007
    Hi,

    Create a counter that starts with the number 298,000,303.
    The counter needs to move at 90 numbers per minute. So basically, when the first minute is up, it should read 298,000,393. I would like to make the counter depend on the host computers internal clock for accuracy. What I'm trying to do is get to the number 298,011,103 by 11am if I start the counter at 9am.

    Any assistance on this would be greatly appreciated!!!

    Thanks,
    Fernando
    ok you could use the GetSeconds() if your keen to use the internal clock but why not just use the frame rate you set for the movie ? you need 11/2 counts per second if you set the frame rate to 15fps (wont be a problem if the scene isnt to compliacted) and decrement the counter ever 10 frames !
    of course if you dont need to count by ones you could just decrment by 90 every 60frames at 1fps

    there are heaps of options just work one out that suits your needs

    regards

    Hi,

    Thanks for the response. I need to use the internal clock because I have other movie clips that need to be called when certain numbers are reached by the counter. The clips need to play at a higher frame rate.

    Any ideas on how to use the GetSeconds?

    Thanks again,
    Fernando

  4. #4
    Senior Member
    Join Date
    Nov 2001
    Posts
    667
    Is there a reason why your number has to be so big? In my expearience variables can not be higher then 32,000,000. As to getSeconds() (actualy called getTimer() ) You could implement it sort of like this, Im not going to write the code but I can tell you how to do it.

    getTimer() gets the milliseconds from when the movie started playing.

    You would need to, every frame, getTimer, compaire it to the time in the last frame (divdide boath by 1000) figure out what percentage of 60 the diffrence between the two is, and add that percentage of 90 to the number. This of corse has a margin of error, the faster your framerate the smaller the margin.

  5. #5
    Senior Member
    Join Date
    Aug 2001
    Posts
    114
    Heya,

    ------------------
    The clips need to play at a higher frame rate.
    --------------------

    i'm just wondering how are you going to increase the frame rate within your movie when it's playing? all movies loaded after the first one play at the original frame rate no matter what rate you have specified on the new movie, and frame rate can't be changed dynamically with actionscript.

    cheers

    FK

  6. #6
    Junior Member
    Join Date
    Jan 2002
    Posts
    4
    Originally posted by Fusion_Kaster
    Heya,

    ------------------
    The clips need to play at a higher frame rate.
    --------------------

    i'm just wondering how are you going to increase the frame rate within your movie when it's playing? all movies loaded after the first one play at the original frame rate no matter what rate you have specified on the new movie, and frame rate can't be changed dynamically with actionscript.

    cheers

    FK
    Hi,

    The frame rate will be the same for all the movies. What I meant by my earlier statement was that I can't run the counter at a lower frame rate because I need the counter to call other movie clips. If the counter is running at 1 1/2 frames per second, then the other movie clips will run choppy.

    I need to figure out a way to control the counter with the internal clock. 90 numbers per minute.

    I wish I was better versed in Actionscript!!! I need to find a solution fast! I have a deadline of Friday morning or I'm screwed!

    Any suggestions are GREATLY APPRECIATED!

    Thanks,
    Fernando

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center