1 Reply Latest reply on Aug 26, 2009 7:21 PM by David_F57

    is there any event that triggers when you switch between components?

    cyber0897 Level 1

      is there any event that triggers when you switch between components?

      like for example... when i switch between components, i need a function to fire everytime i switch...

      ive tried show, hide, and initialize... and none of them work...

       

      any ideas or help is greately appretiated!!

        • 1. Re: is there any event that triggers when you switch between components?
          David_F57 Level 5

          Depends on what you are trying to do,

           

          you have mouseover and mouseout and mouseclick events which you can use on the component and write code to deal with what you want to happen when you change focus. You have keypress event which would allow you to monitor tabbing between components, remember that in most events the currentTarget and target values will give you the information you need to handle component interaction.

           

          so

           

          [Bindable] private var CurrentObject: Object; <-------  use this as a pointer to what ever object you are currently focused on or just to indicate things have changed

           

          addeventListener(MouseEvent.CLICK,myCompponentSwap);

           

          protected function myComponentSwap(e:event): void

          {

              if (CurrentObject !=e.currentTarget && CurrentObject != null)

              {

                   do what you want becuase a component switch just happened

              }

              CurrentObject = e.currentTarget;

          }

           

          Hope this gets you started.

           

           

          David