[FONT=Arial]Hi![/FONT]
[FONT=Arial]I am trying to create menu for my application. To select the correct button user has to first, use “TAB” key and, them press “ENTER”. I have a problem with setting up focus, so when movie is playing default focus is on my first button.[/FONT]
[FONT=Arial]Please help![/FONT]
[FONT=Arial] [/FONT]
[FONT=Arial]
[FONT=Arial]stage.addEventListener(Event.ENTER_FRAME, main)[/FONT]
[FONT=Arial]var btn:Btn [/FONT]
[FONT=Arial]//var fm:FocusManager[/FONT]
[FONT=Arial] [/FONT]
[FONT=Arial]function main (e:Event)[/FONT]
[FONT=Arial]{ [/FONT]
[FONT=Arial] [/FONT]
[FONT=Arial]for(var i:Number=0; i<3; i++)[/FONT]
[FONT=Arial]{[/FONT]
[FONT=Arial] //fm= new FocusManager(this)[/FONT]
[FONT=Arial] btn=new Btn();[/FONT]
[FONT=Arial] btn.x=100+(50+ btn.width)* i[/FONT]
[FONT=Arial] btn.y=350[/FONT]
[FONT=Arial] btn.name=""+i[/FONT]
[FONT=Arial] btn.tabEnabled = true;[/FONT]
[FONT=Arial] [/FONT]
[FONT=Arial] btn.addEventListener(FocusEvent.FOCUS_IN, focusChange);[/FONT]
[FONT=Arial] [/FONT]
[FONT=Arial] var nextComponent:InteractiveObject[/FONT]
[FONT=Arial] //setFocus(nextComponent);[/FONT]
[FONT=Arial] addChild(btn);[/FONT]
[FONT=Arial]}[/FONT]
[FONT=Arial]stage.addEventListener(KeyboardEvent.KEY_UP, keyboardTest)[/FONT]
[FONT=Arial] [/FONT]
[FONT=Arial]}[/FONT]
[FONT=Arial] [/FONT]
[FONT=Arial] [/FONT]
[FONT=Arial]function keyboardTest(e:KeyboardEvent)[/FONT]
[FONT=Arial]{[/FONT]
[FONT=Arial]if(Keyboard.TAB)[/FONT]
[FONT=Arial] [/FONT]
[FONT=Arial] trace("tab") [/FONT]
[FONT=Arial]}[/FONT]
[FONT=Arial] [/FONT]
[FONT=Arial]function focusChange (e:FocusEvent):void[/FONT]
[FONT=Arial] [/FONT]
[FONT=Arial]{ [/FONT]
[FONT=Arial] trace(e.target) [/FONT]
[FONT=Arial]}[/FONT]
[FONT=Arial] [/FONT]
[/FONT][FONT=Arial][SIZE=3] [/SIZE][/FONT]