2 Replies Latest reply on Apr 28, 2010 1:10 PM by rumavi

    How to get focus on a TextInput control without mouse starting an app

    LacioDrom

      Hi everyone,

       

      I have a TextInput control and I should to be able to edit it as soon as I start my app without using mouse. My issue is to have the cursor in the TextInput without using the mouse. Unfortunately setFocus() function isn' t enough

       

       

      <?xml version="1.0" encoding="utf-8"?>

      <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" applicationComplete="init()" width="100%" height="100%">

             

      <mx:Script>

              <![CDATA[


                  private function init():void {

       

                          myInput.setFocus();

                  }

       

                ]]>

       

          </mx:Script>

       

      <mx:TextInput id="myInput"/>


      </mx:Application>

       

      I can't believe that it's impossible.... ....Could someone suggest to me a hint....

       

      Thanks a lot in advance !!!

      Greetings