I seem to be having some problems with using removeEventListener. In the code below, I would expect count to go from 10 down to 0, then stop. For me, using build 243, it just keeps going down meaning that the event listener has not been removed.
count = 10
local gameLoop = function()
count = count - 1
if count \< 1 then
Runtime:removeEventListener( "enterFrame", self )
end
print(count)
end
Runtime:addEventListener( "enterFrame", gameLoop )
How should I remove event listeners properly? [import]uid: 12474 topic_id: 4918 reply_id: 304918[/import]
[import]uid: 11393 topic_id: 4918 reply_id: 15930[/import]