1 Reply Latest reply on Apr 22, 2010 3:36 AM by David_F57

    setfocus to textInput while loading theapplication itself ?

    welcomecan Level 1

      help me anybody  setfocus to textInput while loading theapplication itself ?

        • 1. Re: setfocus to textInput while loading theapplication itself ?
          David_F57 Level 5

          hi,

           

          on you application completehandler just set the focus i.e. myinput.setfocus();

           

          David.

           

           

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

          <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"

             xmlns:s="library://ns.adobe.com/flex/spark"

             xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600"

             creationComplete="application1_creationCompleteHandler(event)">

          <fx:Script>

          <![CDATA[

          import mx.events.FlexEvent;

           

          protected function application1_creationCompleteHandler(event:FlexEvent):void

          {

          in3.setFocus();

          }

          ]]>

          </fx:Script>

          <s:TextInput id="in1" x="145" y="278"/>

          <s:TextArea x="389" y="278"/>

          <s:TextInput id="in2" x="145" y="330"/>

          <s:TextInput id="in3" x="145" y="383"/>

          </s:Application>