delete event listeners per object?

Hi,

how do i detect if an object has an eventlistener and delete it if it does ?

Since adding eventlisteners does not return an ID, there is no way of keeping track of object event listeners. I have removed the objects, but still see some memory leaked. does removing the object also remove the eventlisteners associated? if not, how do i detect eventlisteners and remove them during the cleanup process?

thanks [import]uid: 55009 topic_id: 12200 reply_id: 312200[/import]

First of all, no, eventlisteners are not always removed when the object is removed. The easiest way to remove them is with

object:removeEventListener

I’m not sure why you’d need to detect eventlisteners… shouldn’t you know about all of them when you added them in your code?

From my experience, using director class, I always have to manually remove “enterFrame” eventlisteners, but not “tap” or “touch”. Not sure why… [import]uid: 18951 topic_id: 12200 reply_id: 44996[/import]