<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Label x="8" y="18" text="First Name:" fontWeight="bold"/>
<mx:TextInput x="95" y="14" tabIndex="1" keyDown="enterCheck(event,'1')" id="txtfn"/>
<mx:Label x="8" y="48" text="Second Name:" fontWeight="bold"/>
<mx:TextInput x="95" y="44" tabIndex="2" keyDown="enterCheck(event,'2')" id="txtsn"/>
<mx:Label x="8" y="78" text="Last Name:" fontWeight="bold"/>
<mx:TextInput x="95" y="74" tabIndex="3" keyDown="enterCheck(event,'3')" id="txtln"/>
<mx:Label x="8" y="108" text="Designation:" fontWeight="bold"/>
<mx:TextInput x="95" y="104" tabIndex="4" keyDown="enterCheck(event,'4')" id="txtd"/>
<mx:Label x="8" y="138" text="Address:" fontWeight="bold"/>
<mx:TextInput x="95" y="134" tabIndex="5" keyDown="enterCheck(event,'5')" id="txta"/>
<mx:Script>
<![CDATA[
import mx.controls.Alert;
private function enterCheck(event:KeyboardEvent, ind:String):void
{
if (event.keyCode == Keyboard.ENTER)
{
if (ind == '1')
{
txtsn.setFocus();
}
if (ind == '2')
{
txtln.setFocus();
}
if (ind == '3')
{
txtd.setFocus();
}
if (ind == '4')
{
txta.setFocus();
}
if (ind == '5')
{
txtfn.setFocus();
}
}
}
]]>
</mx:Script>
</mx:Application>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Label x="8" y="18" text="First Name:" fontWeight="bold"/>
<mx:TextInput x="95" y="14" tabIndex="1" keyDown="enterCheck(event,'1')" id="txtfn"/>
<mx:Label x="8" y="48" text="Second Name:" fontWeight="bold"/>
<mx:TextInput x="95" y="44" tabIndex="2" keyDown="enterCheck(event,'2')" id="txtsn"/>
<mx:Label x="8" y="78" text="Last Name:" fontWeight="bold"/>
<mx:TextInput x="95" y="74" tabIndex="3" keyDown="enterCheck(event,'3')" id="txtln"/>
<mx:Label x="8" y="108" text="Designation:" fontWeight="bold"/>
<mx:TextInput x="95" y="104" tabIndex="4" keyDown="enterCheck(event,'4')" id="txtd"/>
<mx:Label x="8" y="138" text="Address:" fontWeight="bold"/>
<mx:TextInput x="95" y="134" tabIndex="5" keyDown="enterCheck(event,'5')" id="txta"/>
<mx:Script>
<![CDATA[
import mx.controls.Alert;
private function enterCheck(event:KeyboardEvent, ind:String):void
{
if (event.keyCode == Keyboard.ENTER)
{
if (ind == '1')
{
txtsn.setFocus();
}
if (ind == '2')
{
txtln.setFocus();
}
if (ind == '3')
{
txtd.setFocus();
}
if (ind == '4')
{
txta.setFocus();
}
if (ind == '5')
{
txtfn.setFocus();
}
}
}
]]>
</mx:Script>
</mx:Application>