DefaultButton property sets up Enter. There is no builtin support for focus navigation via arrow keys.
Ya... but can we do programatically with keyboard events???
You can call setFocus on any component based on a keyDown event.
Ya did it..Its working for first state but now, when i change shift from one state to next state,
focus is not working, and i need to have focus to images also.
Components should implement IFocusManagerComponent to receive focus in Flex.
Ok.. Can we focus on images??
If you make them implement IFocusManagerComponent. They do not by default. What interaction is planned? Maybe you want to use an image in a button?
No.. The interaction is that, there are images Like level1,level2,etc for quiz, so whenever the
user presses right/left arrow keys, images has to be focused and when he hits enter it
should move to the related state. thats how the interaction is. I tried with getNextFocusManagerComponent()
but its working for only one state, when state changes keys are working,but not focusing.
It will be bit easy if you send me page links related such interaction.
All this has to be done using keyboard only, thts the problem m facing
GetNextFocusManagerComponent only goes in tab order. Sounds like you want multi-directional navigation. In that case, you’d have to compute the next component yourself and call setFocus on it.
Yup..Thanks i have computed the next focus, but the problem m facing now is
when i change the state, keyboard event is not working. Whether we need to
focus each states individually when the particular state changes?
Example: For login state,focus n keyEvents are working, but when i hit enter
on submit button and change the state, keyevents are not working. I have
written key events globally for all states. Is this correct??
if(event.keyCode==Keyboard.ENTER && (getFocus()==submitBtn))
when the if(event.keyCode==Keyboard.ENTER && (getFocus()==submitBtn)) is executed
then next when user presses keyboard.Down key this if(event.keyCode==Keyboard.DOWN)
should work. but its not working.
If you remove the focused component from the stage, focus will be null. Your state change code will have to choose a new component to give focus to.
It seems like you might not be listening to the systemManager.stage for keyboard events. That will get all keyboard events no matter what has focus.
Ya Flex harUI, correct. I m not using systemManager.stag thing is I m completely new to this flex
language i dnt have any idea what and how to do,all m doing is with your help.So If you dnt mind
i need some more help from you. can you say me how to use SystemManager with keyboard
events with a small example or a link.