I didn’t see a topic about this and there doesn’t seem to be a gotcha about this, but in my code I do
local frameCount = 0 obj:state1() -- obj should reset to this after 60 frames obj:state2() obj:enterFrame() frameCount = frameCount + 1 if frameCount == 60 then frameCount = 0 obj:state1() end end Runtime:addeventlistener("enterFrame", obj)
Sometimes the obj gets stuck in state 2 and never resets to state1. I’m not sure of any other reason this might happen, other than the frameCount not triggering or skipping 60. Is that because the enterFrame event listener is skipping the code or frame somehow?