Add Mouse Down listener to TitleWindow : TitleWindow « Container « Flex






Add Mouse Down listener to TitleWindow

Add Mouse Down listener to TitleWindow
     
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
    initialize="init(event)">
    <mx:Script>
    import mx.controls.Alert;
    import flash.events.MouseEvent;
    import flash.events.Event;
    public function init(e:Event):void {
        p1.addEventListener(MouseEvent.MOUSE_DOWN,showAlert);
        tw1.addEventListener(MouseEvent.MOUSE_DOWN,showAlert);
    }
    public function showAlert(e:Event):void {
        Alert.show(e.currentTarget + "\n" + e.eventPhase);
        e.stopImmediatePropagation();
    }
  </mx:Script>
    <mx:Panel id="p1" title="Panel 1">
        <mx:TitleWindow id="tw1" width="300" height="300" showCloseButton="true" title="Title Window 1">
            <mx:Button label="Enter name" />
            <mx:TextArea id="ta1" />
        </mx:TitleWindow>
    </mx:Panel>
</mx:Application>

   
    
    
    
    
  








Related examples in the same category

1.Add close event listener for TitleWindowAdd close event listener for TitleWindow
2.Adding mouse event to Panel and TitleWindowAdding mouse event to Panel and TitleWindow
3.Creates a TitleWindow container inside a Panel container.Creates a TitleWindow container inside a Panel container.
4.Resize TitleWindow with TransitionResize TitleWindow with Transition
5.Change TitleWindow position and size in stateChange TitleWindow position and size in state
6.Add control to TitleWindowAdd control to TitleWindow
7.Make TitleWindow to show Close buttonMake TitleWindow to show Close button
8.Add close handler to TitleWindowAdd close handler to TitleWindow
9.Top level TitleWindow tag
10.TitleWindow Title, close button, position, border color and border alphaTitleWindow Title, close button, position, border color and border alpha
11.Add button to window through ActionScriptAdd button to window through ActionScript