00:00
00:00
Newgrounds Background Image Theme

Breakfast-Crow just joined the crew!

We need you on the team, too.

Support Newgrounds and get tons of perks for just $2.99!

Create a Free Account and then..

Become a Supporter!

AS Question 2006-08-09 03:14:50


Hey, how can i make a countdown to a day using AS?

So like, it shows how many days, hours, minutes and seconds there are untill a certain day?

I've been trying for about half an hour, can't get anything to work well.

Response to AS Question 2006-08-09 03:20:02


You can use the Date() dataType. Just create a variable and make it a new date object. Then, you'll be able to access time and such.

For the actual countdown, I'm pretty sure that setInterval is the way to go. So in essence:

1) Create a new Date object and attach it to a variable.

2) Use that variable to access the current time.

3) Use setInterval() to count down from the current time.