Hey there…
I’ve got a little ‘timer function’, witch basicly just counts the seconds, and can be restarted and paused - this works fine in MX, but when trying to use the code in MX2004, it just won’t work… :h:
Here my code:
function restartTimer()
{
seconds = "0";
buttonPressTime = getTimer() / 1000 - pauseLength;
pause();
} // End of the function
function pause()
{
pauseTime = getTimer() / 1000;
timing = false;
} // End of the function
function unpause()
{
unpauseTime = getTimer() / 1000;
pauseLength = unpauseTime - pauseTime + pauseLength;
timing = true;
} // End of the function
_root.onEnterFrame = function ()
{
totalTime = getTimer() / 1000 - pauseLength;
goTime = totalTime - buttonPressTime;
if (timing)
{
seconds = Math.floor(goTime);
if (seconds < 10)
{
_root.seconds = seconds;
} // end if
} // end if
};
Any help would be nice…