I am trying to create a countdown timer in flash. I have gather this from online searching however the numbers do not show up. I have no idea what i am doing wrong. I have embed the fonts and everything. Is the coding wrong?
this.onEnterFrame = function() {
var today:Date = new Date();
var currentYear = today.getFullYear();
var currentTime = today.getTime();
var targetDate:Date = new Date(2007,11,25);
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;
}
2007-03-22
04:21:09
·
2 answers
·
asked by
spklingstr
1
in
Computers & Internet
➔ Programming & Design
ok so after doing the trace thing it is telling me that my text is undefined. what do i do next?
2007-03-22
06:13:27 ·
update #1