1 Reply Latest reply on Sep 20, 2010 10:05 AM by Flex harUI

    Flex 4 - Focus Manager Problem

    Jagan2010

      Hi.,

       

      I have some problem in Flex 4. I have one Viewstack, in side that view stack i have lot of canvas. In my condition am going to click one button at that time am selecting one canvas and setting the focus inside that canvas textinput. but its not working. can any one give the solution for this.

       

       

      here is the code

      <mx:Script>
              <![CDATA[
                  private function testing():void{
                      vsMain.selectedChild = test;
                      focusManager.setFocus(firstName);
                  }
              ]]>
      </mx:Script>

       

      <mx:ViewStack id="vsMain" width="100%" height="100%" creationPolicy="all">

           <mx:Canvas id="empty">

            .

            .

            .

           </mx:Canvas>

           <mx:Canvas id="test" label="testing Items" width="100%" height="100%">
                <mx:Form>
                     <mx:FormItem label="Enter First Name" focusEnabled="true">
                          <mx:TextInput id="firstName" />

                     </mx:FormItem/>

                </mx:Form>
           </mx:Canvas>               
      </mx:ViewStack>

      <mx:Button id="sa" label="Checking" click="{testing();}"/>