I'm not sure what your goal is. Why not just switch between several ModuleLoaders?
________________________________ From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of tdf0wler Sent: Tuesday, November 13, 2007 2:52 PM To: [email protected] Subject: [flexcoders] Re: Loading *existing* modules into a ModuleLoader Is there any way to achieve what I'm trying to do? --- In [email protected] <mailto:flexcoders%40yahoogroups.com> , "Alex Harui" <[EMAIL PROTECTED]> wrote: > > ModuleLoader.child is not watched for changes. It wasn't anticipated > that you'd try to switch out children. > > > > ________________________________ > > From: [email protected] <mailto:flexcoders%40yahoogroups.com> [mailto:[email protected] <mailto:flexcoders%40yahoogroups.com> ] On > Behalf Of tdf0wler > Sent: Tuesday, November 13, 2007 2:00 PM > To: [email protected] <mailto:flexcoders%40yahoogroups.com> > Subject: [flexcoders] Loading *existing* modules into a ModuleLoader > > > > I have a fringe use case here, and I think it may be a simple fix but > I'm a little stumped. > > I have a shell Flex application loading modules via ModuleLoader. When > a module is instantiated I also add a reference to it in a ViewLocator > class (singleton) containing a hash map. For instance, when Module1 is > loaded, the constructor for Module1's code-behind class (Module1Base) > references the ViewLocator, like so: > > class Module1Base > { > public function Module1Base() > { > // some code > ViewLocator.getInstance().addView(this); > } > . > . > . > } > > There is a case where I am loading additional modules into the same > ModuleLoader that Module1 occupies. For instance, I want to load > Module2 into said ModuleLoader. Subsequently, I will want to load > Module1 back into the aforementioned ModuleLoader. I am having > difficulty figuring this part out. I am attempting to set the > ModuleLoader's child property to the existing reference in the > ViewLocator, like so: > > // after Module1 was loaded, then another module (e.g. Module2) > // then back to Module1 > m = moduleLoaderInMainApp; > > m.child = > ViewLocator.getInstance().getView(getQualifiedClassName(Module1)); > > Does anyone have any idea if this can be done, or how to do it? > > Thanks, > > Thomas >

