# 24 hours looping countdown clock

**URL:** https://forum.kirupa.com/t/24-hours-looping-countdown-clock/315013
**Category:** flash
**Created:** [October 14, 2010, 9:43pm UTC](https://forum.kirupa.com/t/24-hours-looping-countdown-clock/315013 "2010-10-14T21:43:35Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![tomdesign](https://avatars.discourse-cdn.com/v4/letter/t/8c91f0/32.png) [@tomdesign](https://forum.kirupa.com/u/tomdesign)
#### Post date: [October 14, 2010, 9:43pm UTC](https://forum.kirupa.com/t/24-hours-looping-countdown-clock/315013/1 "2010-10-14T21:43:35Z")

</div>

Hi i am trying to create a 24 hour countdown clock that will loop and play backwards counting it self back down to 00:00:00:00, being new to flash As3 i am struggling to create this animation

the AS3 code i have put into my actions is as follows:

var timer:Timer = new Timer(1000);  
var currentSeconds:int = 86400;  
var milliseconds:int = 86400000;  
var result:String = “”;

timer.addEventListener(TimerEvent.TIMER, countDown);

function countDown(e:TimerEvent):void {

currentSeconds -= 1;  
milliseconds -= 1000;

var minutes:int = (currentSeconds / 60 \>= 1)?currentSeconds / 60:0;  
var hours:int = minutes\*60;  
var seconds:int =  
currentSeconds \< 59?currentSeconds:currentSeconds - (int(currentSeconds / 60)\*60);

result = ((hours \>= 10)?hours:“0”+hours)+":"+((minutes \>= 10)?minutes:“0”+minutes) +":" + ((seconds \>= 10)?seconds:“0”+seconds)+":"+milliseconds/100+"";

}

When i press to test the movie the numbers are still 00:00:00:00

if any one could shed some light on what i am doing wrong it would be very helpfull !

below i have attached a link to an image to give a better idea of where i am at with this animation:

![](http://forum.kirupa.com/uploads/kirupa/6363/18b26d992a3c8518.png)

thanks in advance

tom
