I want to display a count down from 100 to 1.
I have this script but not able to reverse the countdown i.e., from 100 to 1
if (time3 == 100) {
time3 = 100;
//gotoAndPlay(“end”);
} else {
time3 = Math.floor(getTimer()/1000);
}
I want to display a count down from 100 to 1.
I have this script but not able to reverse the countdown i.e., from 100 to 1
if (time3 == 100) {
time3 = 100;
//gotoAndPlay(“end”);
} else {
time3 = Math.floor(getTimer()/1000);
}
[quote=neilmmm;2323682]i would use setInterval
var num:Number = 100;
my_txt.text = num;
var countInt:Number;
function countDown() {
trace(num);
if (num>0) {
num--;
my_txt.text = num;
} else {
clearInterval(countInt);
}
}
countInt = setInterval(countDown, 1000);
[/quote]
Thanks a lot neilmmm.
:: Copyright KIRUPA 2024 //--