fastzone
12-23-2001, 05:30 AM
:D I want to thank Jesse Stratford for his/her Countdown timer actionscript, it help to solve my problem. This is just a small change to his/her code that made the timer display in seconds instade of milliseconds. This is by NO WAY MY CODES, I just made a small change and want to share it with others.
onClipEvent (load) {
wait = 5;
starTimer = true;
}
onClipEvent (enterFrame) {
if (starTimer) {
if (startTime == undefined) {
startTime = getTimer()/1000;
}
curTime = getTimer()/1000;
if ((curTime-startTime)>=wait) {
starTimer = false;
delete startTime;
// actions to do after time is up
trace ("bing!");
} else {
_root.timeRemaining = int(wait-(curTime-startTime));
}
}
}
The small change is at the last line, where you convert in into integer. So, now you will have seconds instade of milliseconds.
:D
onClipEvent (load) {
wait = 5;
starTimer = true;
}
onClipEvent (enterFrame) {
if (starTimer) {
if (startTime == undefined) {
startTime = getTimer()/1000;
}
curTime = getTimer()/1000;
if ((curTime-startTime)>=wait) {
starTimer = false;
delete startTime;
// actions to do after time is up
trace ("bing!");
} else {
_root.timeRemaining = int(wait-(curTime-startTime));
}
}
}
The small change is at the last line, where you convert in into integer. So, now you will have seconds instade of milliseconds.
:D