Handle focusIn and focusOut Events : Focus « Components « Flex

Home
Flex
1.Chart
2.Components
3.Container
4.Data Model
5.Development
6.Effects
7.Event
8.Graphics
9.Grid
10.Style
Flex » Components » FocusScreenshots 
Handle focusIn and focusOut Events
Handle focusIn and focusOut Events
           
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:s="library://ns.adobe.com/flex/spark">
    <mx:Script>
        
            import mx.events.FlexMouseEvent;
            [Bindable]
            protected var displayMyPanelFlag:Boolean = false;

            protected function mouseDownOutsideHandler(event:FlexMouseEvent):void {
                if (event.relatedObject != myToggle) {
                    displayMyPanelFlag = false;
                }
            }
      
    </mx:Script>
    <s:ToggleButton id="myToggle" label="Toggle!" x="5" y="5" selected="@{displayMyPanelFlag}"/>
    <s:PopUpAnchor top="115" right="302" displayPopUp="{displayMyPanelFlag}">
        <mx:Panel id="myPanel" mouseDownOutside="mouseDownOutsideHandler(event)"/>
    </s:PopUpAnchor>
</mx:Application>

   
    
    
    
    
    
    
    
    
    
    
  
Related examples in the same category
1.Focus management and keyboard controlFocus management and keyboard control
2.Use focus manager to set focus to a controlUse focus manager to set focus to a control
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.