I’ve got a script attached to a button that runs a timer.. here’s the jist of the script:
[code:1yikgulj]
mymethod = function(modulator, newValue)
timer:setCallback (31, maxminCallback)
timer:startTimer(31,500)
function maxminCallback (timerId)
— do a bunch of setModulatorValues
timer:stopTimer(31)
end
— do a bunch of other setModulatorValues
end
[/code:1yikgulj]
I’m getting a "Lua runtime error, Callback disabled" message, strangely though after closing the message the script works on the button and does what it should indefinitely after closing the message until the panel is loaded again, then the error appears again once hitting this button with the above script attached.
After hitting this button and getting the above error, the Lua console says:
"add_file_and_line failed at lua_getstack, unknown error occured"..
I’m not sure if I’ve encountered a bug or am using the timer improperly?
note- occurred is spelled wrong in the console message ” title=”Smile” />
[b:1yikgulj]Follow-up:[/b:1yikgulj]
Ok I illiminated the error by putting the callback in its own method… so
[code:1yikgulj] function maxminCallback (timerId)
— do a bunch of setModulatorValues
timer:stopTimer(31)
end[/code:1yikgulj]
is its own method now, named "maxminCallback"… all working now. strange, i thought you could define and put the callback method anywhere… ?