Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought


Over 10 years of community discussion and knowledge are maintained here as a read-only archive.

New discussions should be taken up in issues on the appropriate projects at https://github.com/PureMVC

Pages: [1]
Print
Author Topic: flex 4 and ApplicationMediator  (Read 4456 times)
inconduit
Newbie
*
Posts: 9


View Profile Email
« on: December 03, 2010, 06:28:00 »

i'm switching from flex 3 to flex 4 and i'm hitting a few snags.

i create all my mediators in ApplicationMediator.  in flex 3, i listened for the ADDED_TO_STAGE event in ApplicationMediator to get references to all the instantiated views in the app.  now in flex 4, i get null references on a lot of the views within that added_to_stage event.

i'm probably missing something very basic here, but haven't been able to figure it out.  what event should i be listening to with ApplicationMediator to ensure that all of my views in the app are instantiated?
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #1 on: December 05, 2010, 10:50:46 »

If you don't startup your PureMVC app until after applicationComplete, then all of your children that aren't deferred1 should be created by the time ApplicationMediator is registered. Which means in its onRegister you should be able to wrap Mediators around those children by name. Most ADDED_TO_STAGE events would be dispatched during the creation of the app before applicationComplete.

Can you tell us a little more about your startup timing?

-=Cliff>

1  i.e. unseen children of a ViewStack whose creationPolicy isn't 'all'
Logged
inconduit
Newbie
*
Posts: 9


View Profile Email
« Reply #2 on: January 06, 2011, 04:26:53 »

i never replied to this and i should have.

thanks cliff for the response, indeed i needed to wait until after applicationComplete before doing all of my mediator instantiation.  why i was triggering on added_to_stage i don't really know, i think it was just very old code that i wrote when i was just learning puremvc.
Logged
Pages: [1]
Print