Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought


Welcome, Guest. Please login or register.
August 21, 2017, 01:24:56 AM
Home Help Search Login Register
News: Please DM @puremvc on Twitter to gain forum access. Spambots are why we can't have nice things.
Pages: [1]
Print
Author Topic: Loading 2 multicore swf  (Read 4409 times)
Tipz
Full Member
***
Posts: 20


View Profile
« on: March 15, 2011, 06:35:06 AM »

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: 2870



View Profile WWW
« Reply #1 on: March 15, 2011, 08:11:05 AM »

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
« Reply #2 on: March 15, 2011, 08:37:25 AM »

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: 2870



View Profile WWW
« Reply #3 on: March 17, 2011, 10:37:06 AM »

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

Code:
ApplicationFacade.getInstance('THE_APP');

and in the swf you might say

Code:
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 AM by puremvc » Logged
Pages: [1]
Print
Jump to: