1 Replies - 2176 Views - Last Post: 26 May 2012 - 07:52 AM

#1 polska03  Icon User is offline

  • D.I.C Regular

Reputation: 5
  • View blog
  • Posts: 302
  • Joined: 28-November 09

add milliseconds to countdown

Posted 10 May 2012 - 08:56 PM

Hello I have a countdown object which countdowns from 30 seconds. I am very new to this so please bare with me. I have created a timer which counts down and displays it in a textfield. The problem is it countdown the seconds only, I want to also display the milliseconds, I have no clue how to do this?


var count:Number = 30;
var myTimer:Timer = new Timer(1000,count);

myTimer.addEventListener(TimerEvent.TIMER, countdown);

myTimer.start();


function countdown(event:TimerEvent):void {
myText_txt.text = String((count)-myTimer.currentCount);

}


Is This A Good Question/Topic? 0
  • +

Replies To: add milliseconds to countdown

#2 chinchang  Icon User is offline

  • Indie Game Developer
  • member icon

Reputation: 192
  • View blog
  • Posts: 725
  • Joined: 22-December 08

Re: add milliseconds to countdown

Posted 26 May 2012 - 07:52 AM

Decrease your timer interval from 1000 to say 1 or 5 and use the currentCount property to calculate and show the second and milliseconds passed.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1