Announcement Announcement Module
Collapse
No announcement yet.
route mx.events.FlexEvent Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • route mx.events.FlexEvent

    Hi,

    im using EventBus and everything is fine. is there any way to route creationComplete - mx.event.FlexEvent in mxml file? i want to handle these kind of events via EventBus.

    i tried this:

    Code:
    <s:Group xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark"
        xmlns:mx="library://ns.adobe.com/flex/mx">
    
     <fx:Metadata>
            [RouteEvents]
            [Event(name="creationComplete", type="mx.events.FlexEvent")]
       </fx:Metadata>
    
    [EventHandler]
     public function creationComplete(event: FlexEvent): void {
                Alert.show("EventBus said:  creation completed");
    
            }
    
    </s:Group>
    regards,

  • #2
    not like that

    Hey there,

    I'm afraid this won't work, the [RouteEvents] metadata will indeed be picked up by the correct postprocessor but the main problem is that this will happen AFTER the creationComplete event has already been fired, this is because by the time the postprocessor is invoked the MXML component has been added to the stage already (so its creation has already been complete).

    You could inject the EventBus instance into your stage component and then create and dispatch a creationComplete event through the EventBus instance manually.

    cheers,

    Roland

    Comment


    • #3
      hi,

      this is very helpful thank you....

      Comment

      Working...
      X