apache-flexflex4

How to initialize some variables after creationComplete event is dispatched in Flex


I tried to send some services to fetch data in the creationComplete handler. Then I need to process the server raw data before displaying some sub-components. Where should I put this kind of code?


Solution

  • First off, I use Mate as my application framework. It definitely helps in situations like this.

    When I've needed to do this kind of thing in the past I would make my service call in my creationComplete handler and dispatch a custom event once all my data has been processed and distributed to my sub components' presentation models.

    After the data was bound to all of my sub components I set their visibility to true or add them to the app, depending on what needed to happen.