I never remember to remove eventlisteners, so I use this code:
local eventListenerStash = {} -- Create a table to store the "listeners" local function addListener(obj, whattype, func) obj:addEventListener( whattype, func ) table.insert( eventListenerStash, #eventListenerStash + 1, {obj, whattype, func} ) end
When I want to add eventlisteners I do this:
addListener(Runtime, "enterFrame", myListener)
When I want to remove the eventlisteners I use (on scene:hide):
local function destroyEventListeners() print( "Destroying listeners") for i = #eventListenerStash, 1, -1 do eventListenerStash[i][1]:removeEventListener( eventListenerStash[i][2], eventListenerStash[i][3] ) eventListenerStash[i] = nil table.remove(eventListenerStash, i) end end destroyEventListeners()
This way I just have to add the listeners and they will be removed automatically.
It works for me 
-Tom