0 Replies Latest reply on Jun 14, 2012 1:15 AM by KlausFriese

    flex mobile - Send custom event from one view to another

    KlausFriese Level 1

      I'm working on my first small mobile application and I have a question about sending events from one view to another.

       

      In the first created a custom event with some custom data and I want to send this event to the next view when a button is klicked. In the onClick method I'm calling:

       





      dispatchEvent( new CustomEvent( CustomEvent.CUSTOM_EVENT , extradata ) );

       

      And I added this:


      <fx:Metadata>


      [Event(name="CustomEvent.CUSTOM_EVENT ", type="events.CustomEvent")]

      </fx:Metadata>

       

       

      And in the creationComplete-method of the second view I added an eventlistener:

       





      addEventListener( CustomEvent.CUSTOM_EVENT , extraAction );

       

      But the extraAction method was never called. I also added the event listener in the application and there it works - how can I add a working eventlistener in the second view?

       

      Thanks

      Klaus