I think you'll have to keep your own list of focusable objects and sort
them by x,y then call setFocus on the right one.

 

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Corey Smaller
Sent: Thursday, January 03, 2008 5:53 PM
To: [email protected]
Subject: [flexcoders] keyboard up down navigating

 

I need to have my app keyboard navigatable with the up/down/left/right
arrows. I have the left/right arrow assignments working but the
up/down not so much. 
I am also using the constraintRows and constraintColumns instead of
the deprecated Grid class. I want to navigate to the object
above/below the Focused object (which means changing rows) but I dont
get how to do it. 
Does anyone have any idea?

here is the method:
//this method is the keyboard navigation 
private function key_check(event:KeyboardEvent):void{
//right 
if(event.keyCode==39){
focusManager.getNextFocusManagerComponent().setFocus()
}
//left
if(event.keyCode==37){
focusManager.getNextFocusManagerComponent(true).setFocus()
}
//enter
if(event.keyCode==13){
popUpNav(); 
}
//UP
if(event.keyCode ==38){
trace(event.currentTarget.parent );
var testU:Number = event.currentTarget.id -5;
var testa:String = testU.toString();
//focusManager.setFocus(mainCanvas.prog5);
}
//DOWN
if(event.keyCode ==40){
//focusManager.
}
}

 

Reply via email to