Folks

Maybe I'm interpreating all the docs wrong but, I have a Custom Class which is 
one of several View Classes as part of an MVC model I'm using. I have an 
associated Controller class.

I want the Custom class to dispatch custom Event to the COntroller class, the 
Custom class is embedded somewhere in the Display list under a Base View Class.

 [Event(name="menuitemClicked", type="flash.events.Event")]
Custom Class {

  private function onClick(event:Event) {
   var e:Event = new Event("menuitemClicked", true, false);
   dispatchEvent(e);
   Alert.show("Event Dispatched");
  }
}

In the Controller Class {

 public function init() {
   Application.application.addEventListener("menuitemClicked", 
menuitemClickHandler);
  }
  
  //This MVC EventHandler
  public function menuitemClickHandler(event:Event) {
   Alert.show("Event received by COntroller");
  }
}

I've tried not using Application.appication and still get nothing, what am I 
not understanding about receiving events from another Class.

Cheers

Duncan


      ___________________________________________________________
Yahoo! Answers - Got a question? Someone out there knows the answer. Try it
now.
http://uk.answers.yahoo.com/ 

Reply via email to