Skip to main content
Known Participant
Sep 7, 2011 1:25 AM UTC
Answered

Know if there is a Listener already going on? ...

Hello

Anybody could help me, I dont know how to ask if there's a Listener Running, I need to add an EventListener but I'd like to ask first if that listener is already running..

Thanks

This topic is closed to new replies. Start a new post to keep the conversation going.
Colin Holgate
Colin HolgateCorrect answer
Inspiring
Sep 7, 2011 1:33 AM UTC

There is hasEventListener(), that will tell you if the listener exists already. But you don't have to use it most times, because if you remove a listener that isn't there, there is no error, and if you add a listner a second time, it doesn't do any harm.

2 replies

Colin Holgate
Colin HolgateCorrect answer
Inspiring
Sep 7, 2011 1:33 AM UTC

There is hasEventListener(), that will tell you if the listener exists already. But you don't have to use it most times, because if you remove a listener that isn't there, there is no error, and if you add a listner a second time, it doesn't do any harm.

Translate
Known Participant
Sep 7, 2011 3:51 AM UTC

Thank you

Translate