title: AS3 Custom Event not firing on Document Class ( using DispatchEvent actionscript)
body: <p>Im trying to get my head round what is needed to catch event "Beep2", using dispatchEvent. The function "DoNext" is not firing, even though Im able to produce a trace result of the dispatchEvent "Beep2 true".</p>
  
  <p>This code uses a CustomEvent Class to Extend the Event Class. Its right on my limit of knowledge so far, so any help would be appreciated. :)</p>
  
  <p>Thanks.</p>
  
  <p>package
  //Main.as (Document class)</p>
  
  <pre><code>import flash.display.MovieClip;
  import flash.events.Event;
  
  public class Main extends MovieClip 
  {
      public var ftasks:MovieClip;
      public function Main () 
      {
          ftasks = new filetasks();
          addChild(ftasks);
          ftasks.addEventListener(CustomEvent.BEEP2, DoNext);
      }
  
  //not firing
      public function DoNext (evt:Event) 
  {
          trace("DoNext"); 
      }
  
  
  }
  </code></pre>
  
  <p>package 
  //CustomEvent.as</p>
  
  <pre><code>//Extend Event class.
  import flash.events.Event;
  public class CustomEvent extends Event
  {
      public static const BEEP1 ="Beep1";
      public static const BEEP2 ="Beep2";
  
      //Declare Event Constructor
      public function CustomEvent(type:String, bubbles:Boolean)
      {
          super(type, bubbles);
          type = this.type;
          bubbles = this.bubbles;
          trace(type, bubbles);
      }
  
      public override function clone():Event
      {
          return new CustomEvent(type, bubbles);
      }
  }
  </code></pre>
  
  <p>package 
  //filetasks.as</p>
  
  <pre><code>import flash.display.MovieClip;
  import flash.events.MouseEvent;
  import flash.events.Event;
  
  public class filetasks extends MovieClip 
  {
      public var Ref;
  
      public function filetasks (_Ref) 
      {
          Ref = _Ref;
          dispatchEvent(new CustomEvent(CustomEvent.BEEP2, true));
      }
  
      public function done (evt:MouseEvent) 
      {
          dispatchEvent(new CustomEvent(CustomEvent.BEEP1, true));
      }
  }
  </code></pre>