Frame 1
fscommand ("fullscreen", true);
var seconds = 10;
var milliseconds = 60;
var microseconds = 99;
flasher._visible = false;
counting = true;
refresh = function () {
clock_txt.text = (((seconds + ":") + milliseconds) + ":") + microseconds;
};
flashOn = function () {
flasher._visible = true;
flashOnInt = setInterval(flashOff, 100);
};
flashOff = function () {
flasher._visible = false;
clearInterval(flashOnInt);
};
countDownSeconds = function () {
seconds--;
if (seconds < 10) {
seconds = "0" + seconds;
}
if (seconds == 0) {
clearInterval(timer);
clock_txt.text = "00:00:00";
setInterval(flashOn, 200);
}
};
countDownMilliseconds = function () {
milliseconds--;
if (milliseconds < 10) {
milliseconds = "0" + milliseconds;
}
if (milliseconds < 1) {
milliseconds = 60;
}
};
countDownMicroseconds = function () {
microseconds--;
if (microseconds < 10) {
microseconds = "0" + microseconds;
}
if (microseconds < 1) {
microseconds = 60;
}
};
secondInterval = setInterval(countDownSeconds, 1000);
setInterval(countDownMilliseconds, 10);
setInterval(countDownMicroseconds, 5);
timer = setInterval(refresh, 10);
btn.onPress = function () {
if (seconds > 0) {
if (counting) {
clearInterval(timer);
counting = false;
} else {
timer = setInterval(refresh, 10);
counting = true;
}
}
};