title: Flash AS3 problem with eventListener
body: <p>I'm having problem with listening to an event dispatched from a child class, and I don't know why?</p>
  
  <p>I have to classes:
  class 1, witch draws a rectangle and dispatches a custom Event</p>
  
  <p>package
  {
      import flash.display.<em>;
      import flash.events.</em>;
      import flash.text.*;</p>
  
  <pre><code>public class clase1 extends Sprite
  {
      private var labelField:TextField;
      public function clase1(label:String = "buttono") {
          // draw the background for the button.
          graphics.beginFill(0x3366CC);
          graphics.drawRect(0, 0, 100, 30);
          // store the label as the button’s name.
          name=label;
          // create a TextField to display the button label.
          labelField = new TextField();
          // ensure clicks are sent from labelField rather than the button.
          labelField.mouseEnabled=false;
          labelField.selectable=false;
          labelField.text=label;
          labelField.x=10;
          labelField.y=10;
          labelField.width=80;
          labelField.height=20;
          addChild(labelField);
          dispatchEvent(new Event("Hello",true));
      }
  
  
  }
  </code></pre>
  
  <p>}</p>
  
  <p>class 2, witch draws another rectangle and listens to the event</p>
  
  <p>package {
      import flash.display.<em>;
      import flash.events.</em>;
      import flash.text.*;</p>
  
  <pre><code>public class clase2 extends Sprite {
      private var labelField:TextField;
      public function clase2(label:String = "buttono") {
          // draw the background for the button.
          graphics.beginFill(0xFFFCCC);
          graphics.drawRect(200, 0, 100, 30);
          // store the label as the button’s name.
          name=label;
          // create a TextField to display the button label.
          labelField = new TextField();
          // ensure clicks are sent from labelField rather than the button.
          labelField.mouseEnabled=false;
          labelField.selectable=false;
          labelField.text=label;
          labelField.x=210;
          labelField.y=10;
          labelField.width=80;
          labelField.height=20;
          addChild(labelField);
          addEventListener( "Hello",eventHandler,true);
  
      }
      function eventHandler( event: Event )
      {
          trace( "event received ");
      }
  }
  </code></pre>
  
  <p>}</p>
  
  <p>and on the fla I have</p>
  
  <p>import clase1;</p>
  
  <p>var c1:clase1 = new clase1();</p>
  
  <p>import clase2;</p>
  
  <p>var c2:clase2 = new clase2();</p>
  
  <p>addChild(c2);</p>
  
  <p>c2.addChild(c1);</p>
  
  <p>, making c2 parent of c1, but no message appears, why??</p>
  
  <p>thankyou</p>