Hi Guys/Girls i hav a little (maybe huge?) problem with runtime listeners.
During the programmation i found this function to remove runtime listeners:
function removeAllListeners(obj) obj.\_functionListeners = nil obj.\_tableListeners = nil end
And it worked great until i discover that if i call it, the facebook.login() function stop to work.
So, i proceed with a manual removal of all my runtime listeners like this:
local function removeAllListeners() Runtime:removeEventListener("touch",dragpaniere) Runtime:removeEventListener("system", onSystemEvent) Runtime:removeEventListener( "collision", onCollision) Runtime:removeEventListener( "tap", pause) end
Now some of the EventListener like the collision one, seems to remain active, because when i add again the listeners with the code below, i had an error during collision.
Runtime:addEventListener("touch",dragpaniere) Runtime:addEventListener( "collision", onCollision) Runtime:addEventListener( "tap", pause) Runtime:addEventListener( "system", onSystemEvent)
Printing the object of the collision ( print(myObject)) during the collision function i noticed that i have double output like if there are 2 active listeners in my code.
I am sorry if my english is not good but i am Italian. I hope my problem is understandable anyway.
Thanks a lot!
Andrea.