阅读背景:

Corona SDK -取消了小部件糖果按钮onPress处理器的定时器。

来源:互联网 

I am trying to cancel a timer within the onPress event handler of a Widget Candy button. However, the timerId is always nil even though I have defined it as a local variable within the file scope. I am new to Lua development so I am assuming that this issue has to do with variable scope but I am having difficulty figuring out a way to access the timer variable without making it a true global variable (i.e. declaring it without the "local" keyword). See the code snippet below.I am trying to cancel a timer within the onPres




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: