Hello dev’s
I am newbi to corona.
I am working on a game with OOP approach.
I have 2 classes/ lua.
- puzzle1 in which
I am using timer in that class.
- Navigation Bar is a 2nd class for stuff like back to menu and all
so how can i stop timer from another class.
Here is some code.
Puzzle1.lua contains
function countTime()
i=i-1;
showTimer.text=i;
print(showTimer.text);
end
countTimer = timer.performWithDelay( 1000, countTime, 21)
Now i want to stop that timer and back_button’s listener is coded in navigation.lua
now in navigation i am doing like this
puzzle1 = require(“puzzle1”);
timer.stop(puzzle1.countTimer);
but it gives me a error (nil) value…?
Please reply me asap please.