all groups > flash actionscript > october 2006 >
You're in the

flash actionscript

group:

Flash lite button focus


Flash lite button focus leeandron
10/5/2006 6:20:45 PM
flash actionscript:
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>") {
Selection.setFocus(_root.[buttonInstanceName);
}
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?
Re: Flash lite button focus kglad
10/5/2006 6:39:35 PM
Re: Flash lite button focus leeandron
10/5/2006 6:50:37 PM
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.
Re: Flash lite button focus kglad
10/5/2006 7:26:34 PM
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.
AddThis Social Bookmark Button