Dear All
I am trying to dispatch an event from tile window and i am capturing this event 
on parent container but event is not dispatching for some reason .Here is my 
code can u point out what is wrong here thanks in advance..
Parkash Arjan
// This is my Event Class Code
    public class CloseMyTileWindowEvent  extends Event
    {
         public static var CLICK:String = "MY_TILE_WINDOW_CLICK_EVENT";
       
        public var str:Object;       
       
        public function CloseMyTileWindowEvent( str:Object )
        {
            super (CLICK, true, true);
            this.str = str;           
        }

    }

//This Is my Application Container
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"; 
creationComplete="{init()}"  >
<mx:Script>
    <![CDATA[
        import mx.managers.PopUpManager;
    public function init():void
    {                                           
        addEventListener( CloseMyTileWindowEvent.CLICK, 
closeTileWindowEventHandler );           
    }
   
    public function closeTileWindowEventHandler():void
    {
        trace( "TileWindowEventHandlede" );
    }
   
     public function showMtTileWindow():void
     {
         PopUpManager.createPopUp( this , MyTileWindow , true );
     }   
    ]]>
</mx:Script>
    <mx:Button  label="Click-Me" click="{ showMtTileWindow() }"/>
</mx:Application>

//And This is my tile window which is dispatching event
<?xml version="1.0" encoding="utf-8"?>
<mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml"; layout="absolute" 
width="400" height="300">
    <mx:Script>
        <![CDATA[
            import mx.managers.PopUpManager;
            public function tileWindowButtonHandler():void
            {
                var evt:CloseMyTileWindowEvent = new CloseMyTileWindowEvent( 
null )
                dispatchEvent( evt );
                PopUpManager.removePopUp( this );           
            }
       
        ]]>
    </mx:Script>   
    <mx:Button click="{ tileWindowButtonHandler() }"/>   
</mx:TitleWindow>



Reply via email to