My timer is buggy. I send updatetimer on preloadcard, and the first time the card is loaded it works like a charm. When I leave the card, gTimerOn is false, but updatetimer is still being sent. Then, when I reload the card, updatetimer is a sent a second time, which stacks onto the first.
Now, I was able to solve this problem by moving the last line of the following code INTO the conditional, and sending updatetimer again with a button that unpauses it (I need to be able to pause and unpause the timer, but the timer is only reset when the card is loaded). That way updatetimer "dies out" and can't stack when I put false into gTimerOn.
Code: Select all
on updatetimer
global gTimerOn, gSeconds
if gTimerOn is true then
add 1 to gSeconds
put gSeconds into fld "Timer"
end if
send updatetimer to me in 1 second
end updatetimer