title: Custom Event not bubbling (or not heard!)
body: <p>I've been having some trauma with an event being dispatched, but I can't detect it in the main app.  I've knocked up an example of the code, removing redundant stuff, so it looks a little unusual!  </p>
  
  <p>I have a main app, (Air) which has a canvas with a single button.  This single button opens a PopUp titlewindow which has a datagrid in it.  On clicking the datagrid a really simple custom event is dispatched which is heard at the lowest level, but not calling canvas or main app.  I assume its how i define the listener at the upper levels, but it's really driving me mad!  Code Below:</p>
  
  <p>mainApp.mxml..........</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" 
                                          layout="absolute"
                                          creationComplete="{onCreationComplete()}" 
                                          xmlns:components="components.*"
                                           &gt;
  
  &lt;mx:Script&gt;
      &lt;![CDATA[
  
          import components.lowestLevel;
  
          private var lowest:lowestLevel;
  
          private  function onCreationComplete():void
          {
                   lowest = new lowestLevel;
  
                   lowest.addEventListener('myEventType',mainAppListenerHandler);
  
          }
  
  
          private function mainAppListenerHandler(event:Event):void
          {
              trace("ive been heard  in main app")
          }   
  
      ]]&gt;
  
  &lt;/mx:Script&gt;
  
          &lt;components:middleLevel/&gt;
  
  &lt;/mx:WindowedApplication&gt;
  </code></pre>
  
  <p>middleLevel.mxml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
      &lt;mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" 
                      width="900" 
                      height="50"
                      creationComplete="{ addEventListener('myEventType',listenerHandler);}"
                      &gt;
  
      &lt;mx:Script&gt;
          &lt;![CDATA[
              import mx.core.Application;
              import mx.managers.PopUpManager;
              import actionScript.sql;
  
              private function launchViewAllLoads(event:MouseEvent):void
              {            
  
                  sql.getSourceFilesToView()
  
                  var win:lowestLevel = new lowestLevel();
  
                  PopUpManager.addPopUp(win,parent,true);
                  PopUpManager.centerPopUp(win); 
  
              }
  
              private function listenerHandler(event:Event):void
              {
                  trace("im heard at the Middle level" )      
              }           
  
  ]]&gt;
  
  
      &lt;/mx:Script&gt;
  
      &lt;mx:Button  id="btnViewAllLoads"
                          label="View Current"
                          click="{launchViewAllLoads(event)};"
                           /&gt;
  
      &lt;/mx:Canvas&gt;
  </code></pre>
  
  <p>lowestLevel.mxml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml" 
      layout="vertical" width="800" height="550"
      title="View All Loads" horizontalAlign="center"
      creationComplete="{ addEventListener('myEventType',listenerHandler);}"
        &gt;
  
      &lt;mx:Script&gt;
          &lt;![CDATA[
  
              import mx.core.IFlexDisplayObject;
              import mx.events.CloseEvent;
              import mx.managers.PopUpManager;
  
  
              private function listenerHandler(event:Event):void
              {
                  trace("im heard at the lowest level" )      
              }
  
  
              private function sourceFilesToViewClickedHandler():void
              {   
                  PopUpManager.removePopUp(this as IFlexDisplayObject);
  
                  var myEvent:Event = new Event('myEventType' ,true,true);
                  dispatchEvent(myEvent); 
  
              }
  
          ]]&gt;
      &lt;/mx:Script&gt;
  
          &lt;mx:Canvas  id="cSourceFiles" width = "100%" height="100%"&gt;
  
                  &lt;mx:DataGrid    id="dgSourceFiles"  
                                          click="{sourceFilesToViewClickedHandler()}"&gt;
  
                  &lt;mx:columns&gt;
                      &lt;mx:DataGridColumn dataField="Batch"  headerText="Batch" width="80"/&gt;
                      &lt;mx:DataGridColumn dataField="LastUpdated"  headerText="Last Updated" width="85"/&gt;                                  
                  &lt;/mx:columns&gt;
  
              &lt;/mx:DataGrid&gt;
  
  
          &lt;/mx:Canvas&gt;
  &lt;/mx:TitleWindow&gt;
  </code></pre>