views:

54

answers:

1

I have five SWF files that are loaded into a main SWF. All five load when testing in the Flash CS3 IDE.

When testing in the browser, only three of the five SWF files load. Loading just haults after the first three. No IOErrorEvent is triggered, and I am sure that the URLs for the SWFs are correct.

I have used MonsterDebugger to pinpoint this issue. I have tried removing the two non-loading SWFs from the load queue, and the site commences normally when I do this. I have tried recompiling the SWFs that are not loading and have combed through them looking for strange run-time errors.

Are there any reasons that can be shared as to why this would be happening?

The URLS are absolute.

+1  A: 

You can always try to see what's going on with a debug player ( http://www.adobe.com/support/flashplayer/downloads.html )

Anyway, the most common errors for this to happen is that you either are trying to load a cross-domain asset, which makes the flash player look for the crossdomain.xml file ( see http://aralbalkan.com/740 ) Also it may have something to do with the security sandbox you're in ( http://stackoverflow.com/questions/304271/security-sandbox-in-as3 ) . Try compiling your swf by enabling network-sandbox .

Waneck
Thanks Waneck. I just solved the issue by removing a static method from the Document class of one of the non-loading SWFs. Any idea why a static method would prevent the SWF from loading?
letseatfood
what did that method do? I really recommend you to download a debug player in your browser, so you can see what error message there was
Waneck
Security sandbox of a the sub swf trying to access the master swf.that probably caused a violation. You have to say something like, this if from my AS2 System.security.allowDomain("*"); // means all swfs loaded into your swf are allowed to call your code.
John Ballinger
@Waneck - I am using MonsterDebugger. But no error message was displaying. Will the debug player display information that MonsterDebugger won't?
letseatfood
Here's the static method that I removed:`public static function getIndex(clickedName:String):int{ return int(String(clickedName).substr(5, 7));}`
letseatfood
@John - Thanks I am seeing if that is the issue
letseatfood
I've never used MonsterDebugger, but it surely can't catch all errors. It's good to be able to trace things and take a look at your display list tree, but not much else.Well, the only error that this method you removed could throw is if you passed a null string to its clickedName parameter. Apart from that, nothing that would prevent it to load another swf.
Waneck
@John @Waneck The static method was definitely the reason that the loading was haulted and it was a security sandbox issue. For now I just removed the static method. I need learn more about security sandbox and how to work with it before I try again. Thanks a lot!
letseatfood