views:

455

answers:

1

I have added an event listener for a particular event, for e.g. CollectionEvent.COLLECTION_CHANGE. Inside that event listener, based on a certain condition, I want to call the default event handler for that event. How is it possible? One way I can think of it is :

Inside the event listener :

If(Condition)
{
  Remove event listener
  dispatch event
  add event listener again
}

This results in event overflow, which means that removing event listener is not working. How to do it?

+2  A: 

You can add multiple event listeners. Seems like you want to stop an event from propagating for certain conditions. For that you want one of these:

stopPropagation()

stopImmediatePropagation()

apphacker