hmm, i am getting the event.currentTarget.x and y coordinates but how to move the focus up or down to other targets? each new button object created has the same var name so it just goes to the very last one created. I tried using a counter for assigning var names but that gives me an error, I also tried by ID and by Name to no avail either. I am so close. get this one and win a free fruit basket.
--- In [email protected], "Alex Harui" <[EMAIL PROTECTED]> wrote: > > 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. > } > } >

