Skip to main content
Known Participant
September 7, 2011
Answered

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

  • September 7, 2011
  • 1 reply
  • 511 views

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 has been closed for replies.
Correct answer Colin Holgate

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.

1 reply

Colin Holgate
Colin HolgateCorrect answer
Inspiring
September 7, 2011

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.

Known Participant
September 7, 2011

Thank you