# 8th Edition Fantasy Countdown Clock



## Shadow Hawk (Apr 26, 2009)

[if]http://www.efosong.co.cc/Countdown.html[/if]
Here is a countdown timer I made with flash, counting down to the release of 8th Edition (or at least 12am on the 10th)

Here's the code in a spoiler because it is long and not everyone wants to see it (ActionScript 2.0):




```
stop();

function Countdown(){
    Countdown.onEnterFrame
	var today:Date = new Date();
    var currentYear = today.getFullYear();
	var currentTime = today.getTime();
	
	
	
	var targetDate:Date =new Date(currentYear,6,10);
	var targetTime = targetDate.getTime();
	
	
	var timeLeft = targetTime - currentTime;
	var sec = Math.floor(timeLeft/1000);
	var min = Math.floor(sec/60);
	var hrs = Math.floor(min/60);
	var days = Math.floor (hrs/24);
	sec = String(sec % 60);
	if (sec.length < 2) {
		sec= "0" + sec;
	}
	
	min = String(min % 60);
	if (min.length < 2) {
		min= "0" + min;
	}
	hrs = String(hrs % 24);
	if (hrs.length < 2) {
		hrs= "0" + hrs;
	}
	days = String(days);
	
	var counter:String = days + ":" + hrs + ":" + min +":" + sec
	Time_txt.text = counter;
if(timeLeft<=0){
		time_txt.text = "00:00:00:00"
		gotoAndStop(2)
		return;
	}}
setInterval(Countdown,1000);
```



I hope it's OK to post this.


----------

