I’ve
tmr = timer.performWithDelay(duration, functionName, iteration)
What tmr return for 1 times ??
How I check this event end ??
Now… I do this
if(tmr) then
statment
else
statment
it doesn’t work.
help me pls.
Thank you [import]uid: 42761 topic_id: 8030 reply_id: 308030[/import]
Skatan
March 20, 2011, 4:12am
2
Have a flag in the timer function:
[code]
isTimerActive = true
local function
isTimerActive = false
end
tmr = timer.performWithDelay(duration, functionName, iteration)
if(isTimerActive == false) then
—statement
end
[/code] [import]uid: 14018 topic_id: 8030 reply_id: 28592[/import]
isTimerActive = true
function notActive()
isTimerActive = false
end
tmr = timer.performWithDelay(1000, createBall,loop)
if(isTimerActive == false) then
print(“Timer Ended”)
scoreLabel:setText("Your Score :: "…score)
end
function isn’t called
I test by print function
I don’t understand your code.
local function
isTimerActive = false
end
when this function call ?? no functionName and argument ?? [import]uid: 42761 topic_id: 8030 reply_id: 28636[/import]
Skatan
March 20, 2011, 3:03pm
4
Sorry my code was bad, forgot to include functionName()
use this code:
isTimerActive = true
local function notActive()
isTimerActive = false
end
timer.performWithDelay(1000, notActive, 1)
The timer calls the function notActive after 1 second only once. To make it loop, you just replace the 1 with 0, but why would you want it to loop? [import]uid: 14018 topic_id: 8030 reply_id: 28646[/import]
timer.performWithDelay(1000, createBall,20)
timer.performWithDelay(1000, notActive,1)
notActive function isn’t call. [import]uid: 42761 topic_id: 8030 reply_id: 28737[/import]
Skatan
March 21, 2011, 5:23am
6
Maybe there’s something wrong with the createBall-function [import]uid: 14018 topic_id: 8030 reply_id: 28741[/import]