0 Replies Latest reply on Feb 5, 2012 2:58 AM by Lexxsc

    Dispatch event to a custom component

    Lexxsc Level 1

      Hi,

      I can dispatch events from a custom components to the main file in Flex like that

       

      CustomComponent.mxml:

      [Event(name="onCreateRoute", type="Event")]
      ... 
      <mx:Button label="Plan Route" click="dispatchEvent(new Event('onCreateRoute'))"/>

      Main.mxml

      <custom:CustomComponent onCreateRoute="CreateRoute(event);" />

      but I can't understand how to do the opposite,dispatching event to the custom component from the main file.I know that I should use some kind of MVC or something,but that's all.