Sublime directory Surf the web anonymous Pagerank Monitor


Beautifying the end of countdown timer

seimiya
Tue 19 January 2010, 03:45 am GMT +0100
Hi,  :)
I'm Seimiya, I'm new to this community and I found here through yahoo search. I hope this community can help solve my queries.

1st of all, I created a countdown timer before the new year eve. And when new year arrived, I saw my timer goes to negative (-) sign.
E.e - Days, - Hrs, - Mins, - Sec - > - 00 days, - 08 hrs, - 12 mins, - 43 secs. Which I don't quite like it.

So what my problem now is the (-) sign, because I don't know how to make the timer stop when the day is arrived. So I need help from anyone here in this comunnity. I humbly request please do teach me, you can add me to msn (maxim_seimiya@hotmail.com) and leave some message like
"Hi, my name is ... and I'm willing to help you ... blah!"  :-[

These are the things I hope you guys can teach me:
1) what's the script to remove the (-) sign.
2) what's the script to stop the timer when the day arrived.
3) Is it possible that I can make a picture show up when the countdown date arrived just like animated gif that will change the instance?  If can, the how do I make a new picture layer to show up?


Thank you and I'm looking forward for replies ^_^

Nikolas
Tue 19 January 2010, 09:14 am GMT +0100
To get some help, first you need to post here the code you used to create the countdown timer you have at the moment.

seimiya
Tue 19 January 2010, 10:07 pm GMT +0100
ok ^_^ here is my scripts, Thanks for helping.

Quote
this.onEnterFrame = function() {

var today:Date = new Date();
var currentYear = today.getFullYear();
var currentTime = today.getTime();

var targetDate:Date = new Date(2010,1,1);
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;
timer_txt.text = counter;

}


Archive for SMF v1.00 by N.P. Valid XHTML 1.0 Transitional