1.添加键盘监听事件,监听键盘按下charcode
2.charcode为13,下一个容器获得焦点
完整代码
<?xml version="1.0"encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
initialize="init()">
<mx:Script>
<![CDATA[
privatefunction init():void
{
this.addEventListener(KeyboardEvent.KEY_DOWN,myKeyDown);
}
privatefunction myKeyDown(evt:KeyboardEvent):void
{
varjthc:String = evt.charCode.toString();
if(jthc == "13") //Keyboard.ENTER
{
focusManager.getNextFocusManagerComponent().setFocus();
}
}
]]>
</mx:Script>
<mx:VBox>
<mx:TextInputid="text1"/>
<mx:TextInputid="text2"/>
<mx:TextInputid="text3"/>
<mx:Buttοnclick="aa"/>
</mx:VBox>
</mx:Application>
http://blog.csdn.net/zc529739024/article/details/7179272