PDA

View Full Version : Countdown Clock



Zelwyn
December 21st, 2004, 07:39 PM
I just made a binary clock yesterday (here (http://www.makasphotos.com/ds/binaryclock.swf), and one with a readout (http://www.makasphotos.com/ds/binaryclockwithnumbers.swf)). They have a few bugs, but that's okay. I would like to make a binary countdown clock now. I followed senocular's tutorial (http://www.kirupa.com/developer/mx/countdown.htm) on making a countdown timer, but it didn't work. I need someone to help me make a countdown timer, and if possible make it use individual units of time, not just milliseconds, for the calculations. The problem with his tutorial that keeps me from changing the code to fit my needs is that it converts the numbers into a string and changes the numbers accordingly. I need to change the alpha of an mc depending on if the number goes into the binary form of the time left until the event. When I made my clock, I knew that the time could never go under 1:00:00, and never over 23:59:59. All I did was made each "light" check what the value was, and if it needed to be "on" or "off", and then changed it accordingly. The code in each "light" is about 115 lines. Imagine making a check for each value if the event date is a year away! I can't attach a *.fla for my clock, because it is too big, but it's located here (http://www.makasphotos.net/ds/binaryclock.fla). Please respond ASAP!!

reyco1
December 24th, 2004, 11:42 PM
Hi dude,

Maybe this can help. The following code is a count down timer i user for a game i made. it counts down from 10 and stops at zero. don't know if it can be of any use to you but here it is anywayz:

displayTime = 10;
countDown = function () {
displayTime--;
if (displayTime == 0) {
clearInterval(timer);
}
};
timer = setInterval(countDown, 1000);