For the past 5 days we've been having all sorts of issues with Kongregate throwing out errors that weren't there when we tested the game locally.
There was an error when I tried to load a map swf file using GameFS which I managed to fix using this:
- Code: Select all
var context:LoaderContext=new LoaderContext();
context.checkPolicyFile=true;
context.applicationDomain=ApplicationDomain.currentDomain;
if(Security.sandboxType==Security.REMOTE)context.securityDomain=SecurityDomain.currentDomain;
setTimeout(function():void{mapLoader.load(fileRequest,context);},1);
This fixed the first map loading, the Main City file.
However, none of the battle maps are loading, even though they use the exact same function to load. Everything works perfectly fine locally, but for some reason when it's on Kongregate, it still uses the Main City swf instead of the real one. The music and data is loaded fine, so the game is told which one to load correctly, it's just the Swf that it's 'choosing' is wrong..
And note that it is loading the map file from GameFS, because it loads longer the first time, which means its loading different content than the city file.
This is quite a complicated error I believe, but maybe someone has an idea what this could be.
You can check out the preview of the game here, just use the guest login and you'll see when you go in to battle (click on the portal to the left when you get to the city):
http://www.kongregate.com/games/OneShar ... 4188ac00d9
Is there any way I can trace anything from a Kong session? Just to see where exactly something might be triggered etc.
Thank you,
Fuzzy
Edit: It seems that whatever SWF passes to the loader using "mapLoader.load(fileRequest,context)", ends up being the same SWF (The first one loaded in a session is the city).
Edit 2: I've now tried inspecting the file whilst playing live on Kong, and the policy file is ok:
OK: Request for resource at http://cdn.playerio.com/rpg-mmo-ujlizgj ... ps/Morning Forest.swf by requestor from http://chat.kongregate.com/gamez/0014/3 ... 1336174824 is permitted due to policy file at http://cdn.playerio.com/crossdomain.xml
So it seems that it does load the new SWF, but then does not refer to it, even though I'm using the same variable to load it, like this (MapLoader):
- Code: Select all
//Before calling the next statement, MapLoader is a reference to the city swf.
MapLoader=new Loader();
//A little bit later, after setting the context.
MapLoader.load(fileRequest,context);
//On complete, the load function ends and calls joinedMap();
function joinedMap():void{
var MapC:Class=getExternalClass("Map",MapLoader); //getExternalClass is just grabbing the definition and outputting the class.
gameMC=MovieClip(MapC);
addChild(gameMC);
}
Basically "Map" is the definition I'm trying to grab out of the new SWF.
I don't see why this is happening, it's not happening locally.
Edit3:Looks like its happening on any website, even when I locally load the TinyLoader. It's only when i play the base game locally that it works.
I tested it removing the security context. Now it works using the TinyLoader, but Kongregate refuses to load (obviously). So this is kind of bad. I can either choose 1 bug or the other, and both ruin the game.
Hopefully its only 1 part of the security context that causes this.