Joined: 25 Apr 2011
|Posted: Wed Apr 11, 2012 5:07 pm Post subject: Multiple Context Builders and Destroying Child Context
|I have states that toggle between App1 and App2. I noticed that when I toggle between from App1 to App2 , the context destroy on App1 gets called. As I enter App2, App2 init gets called and App1 destroy is called. When I go back to App1, App2 destroy is called and App1 context is init again. So far so good.
However, when I go back into App2, the init context is never called. And on top of that the application events are unresponsive. App1 uses the main context. App2 uses a child context (it has a contextbuilder tag).
It seems tied to the fact that I have 2 context builders in App2. When the child context in App2 is destroyed as we leave the App2 state, it is never re-initialized when we change the state back. Could this also be related to how states work in Flex?
Any ideas? One sure fire way I'm guessing is to shove all of App2 objects into the Main context so it will match that of App1, but I'd like to avoid that.
<states><state name="App1"><state name="App2"/></states>
<parsley:ContextBuilder id="mainConfig" config="com.MainConfig"/>
<parsley:ContextBuilder id="anotherConfig" config="com.childConfig"/>
Thanks in advance