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: Loading multiple "instances" of the same module  (Read 7519 times)
Groady
Newbie
*
Posts: 6


View Profile Email
« 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.
Logged
Tekool
Sr. Member
****
Posts: 192


View Profile WWW Email
« Reply #1 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
Logged
Pages: [1]
Print