Would be really easy to find out by adding two identical event listeners to a button. I'd expect it to be called twice.

----- Original Message ----- From: "ben gomez farrell" <[EMAIL PROTECTED]>
To: "Flash Coders List" <flashcoders@chattyfig.figleaf.com>
Sent: Tuesday, September 30, 2008 6:23 PM
Subject: [Flashcoders] Is it possible to create duplicate event listeners?


Hi all,
I'm curious if I need to clean up my event listeners before adding a duplicate one.
For example if I have an initialization routine

function init():void {
   addEventListener( Event.SomeEvent, $somehandler, false, 0, true );
   // some other stuff that builds the app/game
}

If I finish up what I'm doing and want to re-initialize my game or application, should I clean up my event listener before I add the exact same one?

So another way to ask this is if I do:

addEventListener( Event.SomeEvent, $somehandler, false, 0, true );
addEventListener( Event.SomeEvent, $somehandler, false, 0, true );

Do I have 2 event listeners at this point, or just one? Is it smart enough to not add an identical one?

thanks!
ben
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to