1 Reply Latest reply on Dec 22, 2009 9:49 PM by Flex harUI

    Events jigsaw

    Klaus3891

      Supose i have an appicationthen a moduleLoader wich loads 2 modules A and B, in A i have a component C wich also has a button that dispaches a customEvent when pressed.

       

      putted listener in every component of the aplication and all can hear the custom event fired but the listeners in B can't.

       

      Could anyone enlighten me on how to make sure the event has the posibility to be heard by every component in the app.

      this way i implement each listener

      ...

          <mx:Metadata>
              [Event(name="custom", type="CustomEvent")]
          </mx:Metadata>

      ...

      init():void {

           addEventListener(CustomEvent.CUSTOM, customFunction);

      }

      ...

       

      Here is the CustomEvent

       

      package {
          import flash.events.Event;


          public class CustomEvent extends Event {
              public static const CUSTOM:String = "Custom Event";

       

              public function CustomEvent (type:String) {
                  super(type, true);
              }
              public override function clone():Event {
                  return new CustomEvent (type);
              }
          }
      }