This content has been marked as final. Show 3 replies
Expected behaviour. You are firing the event from the component BEFORE the creationComplete event fires of the main application.
Furthermore, since you register the event on the main application using this.addEventListener you are registering for an event 'eventA' from any component in your application and you need to let eventA bubble. If you want to register for an eventA from A you should use canvasA.addEventListener("eventA", messageFromA);
Thanks! If I register event listeners for canvasA - canvasA.addEventListener("eventA", messageFromA), then it works and listens events from canvasA. If I want to listen event from anywhere - this.addEventListener("eventA", messageFromA), then it is not working (I tried to run event over Button click comand - code see below). Can I hear events from anyware in application or some component?
If you want to use addEventListener("eventA", messageFromA); in Events.mxml (the main application) then you must set the second parameter (bubbles) of the event to true.
dispatchEvent(new Event("eventA", true));