Focus management and keyboard control : Focus « Components « Flex






Focus management and keyboard control

Focus management and keyboard control
          

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
    <mx:Script>
      
    
        private function reset(event:Event):void {
          focusManager.setFocus(d);
        }
    
    
    </mx:Script>
    <mx:VBox height="100%">
      <mx:Grid>
        <mx:GridRow>
          <mx:GridItem>
            <mx:TextInput id="a" tabIndex="1" />
          </mx:GridItem>
          <mx:GridItem>
            <mx:TextInput id="c" tabIndex="3" />
          </mx:GridItem>
        </mx:GridRow>
        <mx:GridRow>
          <mx:GridItem>
            <mx:TextInput id="b" tabIndex="2" />
          </mx:GridItem>
          <mx:GridItem>
            <mx:TextInput id="d" tabIndex="4" />
          </mx:GridItem>
        </mx:GridRow>
      </mx:Grid>
      <mx:Button label="Reset" click="reset(event)"/>
    </mx:VBox>

</mx:Application>

   
    
    
    
    
    
    
    
    
    
  








Related examples in the same category

1.Use focus manager to set focus to a controlUse focus manager to set focus to a control
2.Handle focusIn and focusOut EventsHandle focusIn and focusOut Events