Hello Everyone,
I’ve been dealing with an issue while working with the RuntimeEventListener. I’ve got class that has it’s own ‘touch’ function. I’ve been able to successfully hook up the touch function to the RuntimeEventListener, but I’m having no luck actually removing the event! So once I move into another state the touch function is still running! Even after I destroy the object! Is there something I’m missing here?
[lua] – Psuedo-code Example of the class I’ve created
function class:new(o)
– initialize object via weak table
end
function class:touch(event)
– some code
end[/lua]
[lua]-- How I add the event
Runtime:addEventListener(“touch”, self)[/lua]
[lua]-- How i’m trying to remove the event
function class:destroy()
Runtime:removeEventListener(“touch”, self)
self = nil
end[/lua] [import]uid: 99450 topic_id: 26381 reply_id: 326381[/import]