i have an another problem in the above code ... when i m entering the
number first its work very well... once i enter the number ,move the
cursor to the first position on the time i can enter the number...how
can i avoid this problem?

example:

1st enter in textbox: amu54tha

immediately move cursor to the 1st position

and the result is:01amu54tha

On Dec 22, 12:45 pm, veeru k <[email protected]> wrote:
> Try this:
>
> <?xml version="1.0" encoding="utf-8"?>
> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"; layout="absolute">
> <mx:Script>
>     <![CDATA[
>         public function onChange(event:Event):void
>         {
>             if(t1.text.length>0)
>             {
>                 t1.restrict="[0-9][a-z][A-Z]";
>             }
>             else if(t1.text.length<t1.text.length+1)
>             {
>                 t1.restrict="[a-z][A-Z]";
>             }
>         }
>     ]]>
> </mx:Script>
>     <mx:Label x="41" y="130" text="Enter Text Here   :" width="167"
> height="26" fontFamily="Georgia" fontSize="15" fontWeight="bold"/>
>     <mx:TextInput x="192" y="130" height="25" width="190" id="t1"
> creationComplete="onChange(event)" change="onChange(event)"/>
> </mx:Application>
>
> Veeru
> ITON Technologies

--

You received this message because you are subscribed to the Google Groups "Flex 
India Community" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/flex_india?hl=en.


Reply via email to