title: AS3 DispatchedEvent not being heard by listener
body: <p>Hey so i have had a look at some other posts but im still not getting anywhere. </p>
  
  <p>I have 2 classes, one is Ticket_mc() and the other is TicketPurchaserFSlider(). there is a number stored in TicketPurchaserFSlider() called ticketsSelected which holds the number of tickets i have selected. Now what i want to do is to be able to increment that number by one from the Ticket_mc() class. and how i set that up was to create an dispatchEvent(new Event("selectFromList")), and then a listener and a function conected to that listener. anway its not working. Here is my code:</p>
  
  <pre><code>    package com.spay.ticketpurchaser {
  
      import com.spay.ticketpurchaser.TicketPurchaserFSlider;
      import flash.display.MovieClip;
      import flash.events.MouseEvent;
      import flash.events.Event;
      import flash.events.EventDispatcher;
  
  
      public class Ticket_mc extends MovieClip{
          public function Ticket_mc(){
              addEventListener(MouseEvent.CLICK, clickTicket);
          }
  
          public function clickTicket(event:MouseEvent){
              dispatchEvent(new Event("selectFromList"));
              gotoAndStop(2);
          }
      }
  }
  </code></pre>
  
  <p>.</p>
  
  <pre><code>    package com.spay.ticketpurchaser{
  
      import com.spay.ticketpurchaser.Ticket_mc;
      import flash.display.MovieClip;
      import flash.events.MouseEvent;
      import flash.events.Event;
      import flash.text.TextField;    
  
      public class TicketPurchaserFSlider extends MovieClip{
  
          public var ticketsSelected:Number = 0;
          private var ticket:Ticket_mc;
  
          public function TicketPurchaserFSlider(){           
              ticket = new Ticket_mc();
              ticket.addEventListener("selectFromList",addTicket , false,0,true);
              }
  
          private function addTicket(event:Event){
              ticket.removeEventListener("selectFromList", addTicket);
              ticketsSelected ++;
              trace("it works");
          }
     }
  }
  </code></pre>
  
  <p>For clarification, here is the scenerio</p>
  
  <p>I have a ticketPurchaserFSlider class that holds my ticketsSelected var. I have other methods inside the TicketPurchaserFSlider class that increments and decrements the ticketsSelected var and it all works just fine, i then use the document class to addChild(ticketPurchaser) and so on.</p>
  
  <p>I then needed the tickets, and these tickets needed to also be clickable and also increment and decrement the ticketsSelected var in the ticketPurchaserFSlider class. To display the tickets i first create the Ticket_mc and exported for actionsctript. I then created an empty MovieClip and gave it a class called Ticket_Group, this class holds an Array that created 6 instances of the tickets. I then created another empty movieclip and created another class and called it Ticket_Batch, this also holds an Array and creates more instances of tickets (in multiples of 6) the number of tickets it is creating is stored in ticketPurchaserFSlider class and is called maxTickets. i access this number by using the an instance of the ticketPurchaserFSlider and using the . syntax ( ticketPurchaser.maxTickets) i then use an instance of the Ticket_Batch class in the Document class to addChild(tickets), so i have all of my tickets displays from the document class.</p>
  
  <p>now im not sure if this was the best way to display the tickets, but it made logical sense to me and the tickets will be singlely selected and selecable by multiples of 6 (using a seperate button) and in both cases i need to be able to access the ticketsSelected var in the ticketPurchaserFSlider class.</p>
  
  <p>It fires off okay from the clickTicket function.</p>
  
  <p>I hope that has cleared things up. If you think i need a better way of setting up my classes then do say so. </p>
  
  <p>I have posted the files here: www.samuelpay.com/BingoClient.zip so take a look if you want too. </p>