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 2 multicore swf  (Read 10924 times)
Tipz
Full Member
***
Posts: 20


View Profile Email
« 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
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #1 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>
Logged
Tipz
Full Member
***
Posts: 20


View Profile Email
« Reply #2 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
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #3 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>
« Last Edit: March 17, 2011, 10:40:11 by puremvc » Logged
Pages: [1]
Print