3 Replies Latest reply on Sep 14, 2010 4:15 AM by IT小鸿

    How To Show Blinking Cursor In Text Input Control

    rabinprithvi Level 2

      Hi,

       

      How to show blinking cursor in a text input control?

      I am using this for login page

       

      Thanks.

        • 1. Re: How To Show Blinking Cursor In Text Input Control
          UbuntuPenguin Level 4

          use the focusmanager to set the focus to the field you want , this is off the top of my head , and i haven't used the focusmanager in Flex 4 but it goes something like this

           

          ...

          <s:TextInput id="tInput" />

          ....

           

          private function creationCompleteHandler( event:Event ):void

          {

              focusManager.setFocus( tInput );

          }

           

          If this response was helpful please mark it as such.

           

          Sincerely ,

            Ubu

          • 2. Re: How To Show Blinking Cursor In Text Input Control
            rabinprithvi Level 2

            Hi,

             

            Thanks for your time.

             

            Now the textfield gets highlighted, but the cursor is not displayed.

            • 3. Re: How To Show Blinking Cursor In Text Input Control
              IT小鸿

              Hi!

              you can try this!

               

              <?xml version="1.0" encoding="utf-8"?>
              <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" horizontalAlign="center">

              <mx:VBox horizontalAlign="center" paddingTop="100">
              <mx:HBox horizontalAlign="center">
              <mx:TextInput id = "textinput1" />
              <mx:Spacer width="10"/>
              <mx:TextInput id = "textinput2" />
              </mx:HBox>
              <mx:Spacer height="50"/>
              <mx:HBox horizontalAlign="center">
              <mx:Button label="setfocus1" click="setTextInputFocus1(event)"/>
              <mx:Spacer width="5"/>
              <mx:Button label="setfocus2" click="setTextInputFocus2(event)"/>
              </mx:HBox>
              </mx:VBox>
              <mx:Script>
              <![CDATA[
              private function setTextInputFocus1(evt:Event):void{
              textinput1.setFocus();
              textinput1.setSelection(textinput1.text.length,textinput1.text.length);
              }
              private function setTextInputFocus2(evt:Event):void{
              textinput2.setFocus();
              textinput2.setSelection(textinput2.text.length,textinput2.text.length);
              }
              ]]>
              </mx:Script>
              </mx:Application>