PureMVC Architects Lounge

PureMVC Manifold => MultiCore Version => Topic started by: Tipz on March 15, 2011, 06:35:06



Title: Loading 2 multicore swf
Post by: Tipz on March 15, 2011, 06:35:06
Hi I am trying to load a swf into a container swf. The container swf is built using the PureMVC multicore framework. So is the graphic swf that I am trying to load. When the container swf loads the graphic swf. It duplicates itself. What I mean is, the container duplicates itself. So now i see 2 containers. Any advice on what I am doing wrong?

Cheers


Title: Re: Loading 2 multicore swf
Post by: puremvc on March 15, 2011, 08:11:05
Well, we'd have to see a little code to understand what the problem might be.

A few questions:
Are the multiton keys non-null and different ? (If not, you could be getting hold of the same facade when the graphic swf loads instead of it creating its own).
What's the architecture being used to communicate between the container and the graphic? (interfaces or pipes)
You see the container duplicate itself, do you mean an object in memory that you can see in the debugger, or do you mean visually in the display list?
The container couldn't be loading itself instead of the graphic swf by mistake could it?

-=Cliff>


Title: Re: Loading 2 multicore swf
Post by: Tipz on March 15, 2011, 08:37:25
Hi Cliff

I think this is the problem.

Are the multiton keys non-null and different ? (If not, you could be getting hold of the same facade when the graphic swf loads instead of it creating its own)

what do i need to do to change the multiton keys?

Cheers


Title: Re: Loading 2 multicore swf
Post by: puremvc on March 17, 2011, 10:37:06
You just need to make sure in both your app and the loaded swf that when the concrete Facade's getInstance method is called you pass in some string. In the app you might say

:
ApplicationFacade.getInstance('THE_APP');
and in the swf you might say

:
ModuleFacade.getInstance('THE_MODULE');
Remember that your concrete facades extend Facade where the multiton instances are kept. So while they may be different subclasses, every Facade in the system must have a unique multiton key. So if you're just calling getInstance in both places with a null string then you're actually ending up with the same Facade because the second call didn't create one, it returned the one mapped to the null-string multiton key which was created by the previous call.

-=Cliff>