3

Possible Duplicate:
flash AS3 how do I remove stage event listeners

Say I have an event listener tied to a component and I want to remove the event listener from the component so it can be garbage collected. The problem is I don't know what kind of object it is or what event listeners it has.

Basically how can I find out what event listeners an object has and how can I remove one or all of them?

Community
  • 1
  • 1
smartdirt
  • 1,027
  • 3
  • 14
  • 27

1 Answers1

2

Duplicate.

When you add the event listener mark it as a weak refernce by setting the last parameter as true. You no longer need to worry about removing it. I posted a longish answer here, so you may want to take a look.

Community
  • 1
  • 1
dirkgently
  • 108,024
  • 16
  • 131
  • 187