Would you like to react to this message? Create an account in a few clicks or log in to continue.


Pakistan is contributing at its best in the field of latest technologies, platforms and approaches. Here,Flex developers share their experience, knowledge and ideas to assure their best talent in the world.

Latest topics
» Advice sought on recruiting a Senior Flex developer in Lahore
Jumping to next control through pressing ENTER key from keyb EmptyTue May 11, 2010 2:41 pm by anjum

» steam boiler efficency calculator
Jumping to next control through pressing ENTER key from keyb EmptyWed Dec 23, 2009 4:55 am by imranmalik

» URLLoader and URLRequest application
Jumping to next control through pressing ENTER key from keyb EmptyTue Dec 15, 2009 6:01 pm by imranmalik

» Time display by ILOG ELIXIER PACKAGE
Jumping to next control through pressing ENTER key from keyb EmptyThu Dec 10, 2009 9:28 am by imranmalik

» how Filter XML data by Flash Builder
Jumping to next control through pressing ENTER key from keyb EmptySat Dec 05, 2009 6:33 pm by imranmalik

» drag and drop (Advance Data Grid to List Box)
Jumping to next control through pressing ENTER key from keyb EmptyThu Nov 19, 2009 7:12 pm by imranmalik

» access the xml file through HTTPService request
Jumping to next control through pressing ENTER key from keyb EmptySun Nov 15, 2009 11:46 am by imranmalik

» CURRENCY VALIDATOR
Jumping to next control through pressing ENTER key from keyb EmptyTue Nov 03, 2009 2:06 pm by imranmalik

» Synchronous Behavior
Jumping to next control through pressing ENTER key from keyb EmptySun Nov 01, 2009 8:04 pm by imranmalik

Social bookmarking
Social bookmarking reddit      

Bookmark and share the address of on your social bookmarking website


You are not connected. Please login or register

Jumping to next control through pressing ENTER key from keyb

2 posters

Go down  Message [Page 1 of 1]

nasir

nasir

<?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>

nasir

nasir

i want such technique in which no need to mention the id of next control,on pressing "Enter" control automatically go to next tab.

anjum

anjum

<?xml version="1.0" encoding="utf-8"?>
<mx:Panel xmlns:mx="http://www.adobe.com/2006/mxml" width="650" height="300" layout="absolute">
<mx:Script>
<![CDATA[
import mx.controls.TextInput;
import mx.events.FlexEvent;

protected function textinput_enterHandler(event:FlexEvent):void
{

var currentObj:Object = event.currentTarget;
var i:int;
for(i = (this.getChildIndex(currentObj as DisplayObject)+1); i<this.getChildren().length; i++)
{
if((this.getChildIndex(currentObj as DisplayObject)+1) < this.getChildren().length)
{
if((this.getChildAt(this.getChildIndex(currentObj as DisplayObject)+1)as TextInput)!=null)
{
(this.getChildAt(this.getChildIndex(currentObj as DisplayObject)+1)as TextInput ).setFocus();
break;
}else
{
currentObj = this.getChildAt(i);
continue;
}
}
}
}

]]>
</mx:Script>

<mx:Label x="76" y="23" text="label 1" height="20"/>
<mx:TextInput enter="textinput_enterHandler(event)" x="127" y="21"/>
<mx:Label x="76" y="53" text="label 2" height="20"/>

<mx:TextInput enter="textinput_enterHandler(event)" x="127" y="51"/>
<mx:CheckBox x="295" y="21" label="Checkbox"/>
<mx:Label x="76" y="83" text="label 3" height="20"/>
<mx:TextInput enter="textinput_enterHandler(event)" x="127" y="81"/>
<mx:TextInput enter="textinput_enterHandler(event)" x="127" y="111"/>
<mx:TextInput enter="textinput_enterHandler(event)" x="127" y="141"/>
<mx:TextInput enter="textinput_enterHandler(event)" x="127" y="171"/>
<mx:TextInput enter="textinput_enterHandler(event)" x="127" y="201"/>
<mx:DateField x="295" y="51"/>
<mx:RadioButton x="295" y="81" label="Radio"/>

</mx:Panel>

https://flexpakistan.board-directory.net/

Sponsored content



Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum