PureMVC Architects Lounge

PureMVC Manifold => MultiCore Version => Topic started by: Groady on October 27, 2009, 03:30:35



Title: Loading multiple "instances" of the same module
Post by: Groady on October 27, 2009, 03:30:35
Just wondering if I'm likely to encounter problems loading the multiple instances of the same module into my main application since each module's core needs a unique key, right? I figured I could somehow create a unique-random string for it's key (maybe based off the time?) when instantiated but this seems a little hacky.

My module is really a 'layout' which will be populated with content provided by XML when it's loaded into the shell so I want to re-use it multiple times.

This is a Flash CS4 app, not Flex.


Title: Re: Loading multiple "instances" of the same module
Post by: Tekool on October 28, 2009, 06:06:39
Have a look at the PipeWorks demo. There is a module that create and declare its own unique ID each time it is constructed. There is no Flex dependence in this class, even if the demo is for Flex.

http://puremvc.org/pages/demos/AS3/Demo_AS3_MultiCore_Flex_PipeWorks/srcview/source/org/puremvc/as3/multicore/demos/flex/pipeworks/modules/PrattlerModule.as.html