remove dynamic event listeners?

I am adding event listeners dynamically (dynamic objects added to the runtime table, when i’m done with the objects how am I able to remove these listeners? i find that after a while the app slows down tremendously, i’ve assigned nil to the objects so i’m assuming that it’s the tables getting too large. thanks

I would normally define and pass it into the addEventListener so I could pass same function in to remove, but since I have to define dynamic objects passed into the table on the fly, can’t predefine the function.

function rotateObj()
–something something something
end
Code i’m actually using.
Runtime:addEventListener(“enterFrame”, function() rotateObj(newDino, 0); end);

Can I do
Runtime:removeEventListener(“enterFrame”, function() rotateObj(newDino,0); end);

would this work? [import]uid: 6317 topic_id: 1093 reply_id: 301093[/import]

Maybe I’m missing something, but even if you can’t predefine the implementation of the function you’re passing, can’t you predefine the function’s name? Functions are just another type of variable in Lua.

But assuming that idea doesn’t help, can you send your project folder (the one where the code slows down) to beta@anscamobile.com and reference this thread? [import]uid: 3007 topic_id: 1093 reply_id: 2811[/import]