I think you made a mistake when declaring your event listener:
the method addEventListener accept as first parameter the event type and not the event class name.
 
Example :
 
package events {
public static const EVENT_NAME : String = "myevent";
 public class MyEvent {
   public function MyEvent() {
      super(EVENT_NAME);
   }
}
}
 
 
then in your code when you want to listen event
 
addEventListener(MyEvent.EVENT_NAME, myFunction);
 
Best regards.
 
2006/7/26, Ryan Stewart <[EMAIL PROTECTED]>:

I'm still not entirely clear on the event model in Flex 2, so hopefully this is an easy question. I want to add an event listener in one of my flex view components that will listen for a CairngormEvent to be dispatched and then run a function within that component. Pretty straight forward I thought. When my flex component is initialized, I call a function, doInit() that does the following:


this.addEventListener("com.example.control.MyCustomEvent",myFunction);


In this case, MyCustomEvent is a CairngormEvent but when I dispatch it using the typical Cairngorm event dispatcher, it doesn't fire myFunction. Am I totally off base on how the CairngormEventDispatcher works or how to set up Event listeners for custom events?


Thanks,


Ryan


__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




__,_._,___

Reply via email to