2 Replies Latest reply on Dec 21, 2006 7:51 AM by KomputerMan.com

    Looking to run a script when the form gets focus

    KomputerMan.com Level 1
      Hello all flexers out there...
      I have an application that uses a tab navigator control that is embedded inside of a tab navigator control. Basically it gives me two rows of tab navigators which is way cool. My issue, well my flex related issue, is that I want to fire off some code when I select one of the tabs on the embedded tab navigator control.

      I have tried to use the activate flag in the header tag but that doesn't fire the very first time the form is opened plus it always fires when the navigator loses focus. I have tried the initialize flag but it fires only when the form is first created and before any data is passed to the form. The creationComplete only fires one time and that is after the form is created the first time but before any data gets passed to it.

      Grrr.... I need to initialize a few combo boxes but I only want to run the Action Script when the form get focus and I need to have the data available prior to running the script. Any ideas???

      Thanks in advance for the help!!!

      Have an Ordinary Day...
      KomputerMan ~|:-)
        • 1. Re: Looking to run a script when the form gets focus
          ntsiii Level 3
          How about the change event?
          Tracy
          • 2. Re: Looking to run a script when the form gets focus
            KomputerMan.com Level 1
            Thanks for the tip Tracy but the change event fired off way to many times, I quit counting before I killed my debug session.

            After checking all of the events in the template itself I finally started to move backwards in the code. It turned out that the show event in the canvas that called the 2nd tab navigator worked the best.

            This is one thing about Flex that just drives me batty. The way things get called and the number of times that things get called in Flex sometimes doesn't make much sense at all. I think that Adobe needs to clean up the sequencing of events in Flex!!! I keep seeing all sorts of events fire off multiple times and I can't figure out why. Oh well the show event solved this particular problem for me!

            Have an Ordinary Day...
            KomputerMan ~|:-)