Back Forum Reply New

route mx.events.FlexEvent

/flex/sparkquot;   xmlns:mx=quot;library--ns.adobe.com/flex/mxquot;gt;
lt;fx:Metadatagt;       [RouteEvents]       [Event(name=quot;creationCompletequot;, type=quot;mx.events.FlexEventquot;)]  lt;/fx:Metadatagt;

[EventHandler]public function creationComplete(event: FlexEvent): void {Alert.show(quot;EventBus said:  creation completedquot;);
       }

lt;/s:Groupgt;
regards,

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

hi,

this is very helpful thank you....
¥
Back Forum Reply New