PDA

View Full Version : Returning all events


TacoRock
09-03-2008, 06:05 AM
I want to end all the events that are running in my class at once so i can delete it.

Is there some easy way to find all the events that are running in an object? Or do you just need to keep track of them all and remove them all before you delete it? Or is there some way to delete the object as well as removing all events at once?

wvxvw
09-03-2008, 07:48 AM
Nut sure what do you mean... Event is an object, you cannot run it... And events are deleted after they've being dispatched...

TacoRock
09-03-2008, 09:16 PM
I may not have worded it correctly then. I mean that if I try to remove a movieclip where theres an addEventListener(Event.ENTER_FRAME...) going on, it says theres an error so is there some way to just remove the movieclip without having to go in and type removeEventListener for all the events?

senocular
09-03-2008, 09:31 PM
You will have to remove your listeners using removeEventListener.

There's the option of using weak listeners (5th parameter), but they may still take a while to go away. Its actually a good idea to make them weak regardless.
http://livedocs.adobe.com/flex/3/langref/flash/events/EventDispatcher.html#addEventListener()