Skip to main content
November 26, 2009
Question

Timer progress

  • November 26, 2009
  • 1 reply
  • 396 views

Hi, can anyone tell me what's the best way to display a timer progress ?

I want to create a my own progress bar and connect it to the timer, but everything i try

doesn't work!

Thanks

This topic has been closed for replies.

1 reply

Ned Murphy
Legend
November 26, 2009

Can you explain what you mean?  I can only guess that you mean you want to know how much time out of a particular duration has past, but don't want to waste an effort offering a possible solution to the wrong goal.

November 26, 2009

Hi Ned,

What im trying to do is to connect a timer to a progress bar.

So if the timer event is executed every 3 sec i want the progress bar to represent those 3 seconds,

when the timer is triggerd again the progress bar will start from 0 when the timer will reach 3 seconds the progress bar will be on 100%.

Thanks

Ned Murphy
Legend
November 27, 2009

If I'm interpretting it correctly, then what you can do is use the getTimer() function to keep track of the passage of time from when the Timer starts, and divide that by the Timer.delay property to get the percentage of the Timer that has elapsed.  When the Timer starts you use getTimer() to record the timerStart time, and then use an ENTER_FRAME event listener to continuously execute getTimer() to get the timerCurrent time.

Timer % done = (timerCurrent - timerStart) / Timer.delay