4 Replies Latest reply on Sep 20, 2011 12:25 PM by Francisc

    How to listen for actionContent button click event in View

    Francisc Level 3

      Hello,

       

      Doing this:

      FlexGlobals.topLevelApplication.addEventListener('actionContentClick',showOptions);

       

      Results in calling showOptions() as many times as the view was showed. The handler sticks and each time I enter a view in the creationComplete hander for it I add the same listener over and over again.

       

      How should this be done?

       

      1. FlexGlobals.topLevelApplication is the right object to listen to?

      2. I can remove the listener on view deactivate, but I am not sure if that will be called each time the view goes away.

      3. Can I check if an object already has a listener and which is it?

       

      Thank you.