3 Replies Latest reply on Oct 5, 2006 12:26 PM by kglad

    Flash lite button focus

      Creating a flash lite app for Series 60 phone with NavigationType = 4Way. My navigation buttons are in a two column layout and I want to control the movement within the selected buttons. To do this I use something like:
      on (keyPress "<Down>") {
      The focus moves to that button but the command set from the original button continues to be executed. In other words even though it looks like the focus has moved to the new button all of the key presses correlate with the button that the cursor was on.

      Do I need to have a listener on the object being selected? Is setFocus the best way to do this?
        • 1. Re: Flash lite button focus
          kglad Adobe Community Professional & MVP
          keyPress "<Down>" will be executed every time the down button is pressed no matter what has focus.
          • 2. Re: Flash lite button focus
            leeandron Level 1
            It is my understanding that because this action is contained within a button it will only be executed when that button is selected. If the command what executed every time then you would not be able to have this command more than once in a movie. I need to find a way to move the focus from one button to another reliably.
            • 3. Re: Flash lite button focus
              kglad Adobe Community Professional & MVP
              your understanding is incorrect.

              you can test it yourself: define one on (keyPress "<Down>") handler attached to any one button, click on your swf's stage and press your down button.

              you can use one handler with Selection.getFocus() to specify different actions when different objects have focus.

              changing focus on any keydown/mousedown is probably going to fail because focus changes on keyup/mouseup.