Topic: Kongregate APIs /
Unable to load AS3 API
There doesnt seem to be a search associated with just this forum, so I’m posting this question without properly researching the forums because I cannot find a way to lookup relevant information.
I’m attempting to port a game from Facebook to Kongregate. This is an IFrame game using Flash built with the Flex 3.5 SDK.
I have not been able to get the AS3 API to load due to security sandbox violations when testing through the Kongregate Preview. I do not have any issues loading the local API (http://www.kongregate.com/flash/API_AS3_Local.swf)
I have tried
Security.allowDomain(“*”);
Security.allowInsecureDomain(“*”);
I have tried with and without setting the LoaderContext.
Can someone please enlighten me? Is Kongregate.com’s crossdomain.xml file??
URL:
http://chat.kongregate.com/flash/API_AS3_de614ba32910c407ff307ec996cd79e4.swf
CODE:
var kongregateApiPath:String = "";
if (Application.application.parameters[“kongregate_api_path”])
kongregateApiPath = Application.application.parameters[“kongregate_api_path”];
else
kongregateApiPath = "http://www.kongregate.com/flash/API_AS3_Local.swf”;
Security.allowDomain(“*”);
Security.allowInsecureDomain(“*”);
var request:URLRequest = new URLRequest(kongregateApiPath);
var loader:Loader = new Loader();
var lc:LoaderContext = new LoaderContext();
lc.securityDomain = SecurityDomain.currentDomain;
lc.applicationDomain = ApplicationDomain.currentDomain;
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onKongApiLoadComplete);
loader.load(request, lc);
ERROR:
Error #2044: Unhandled SecurityErrorEvent:. text=Error #2048: Security sandbox violation: http://mydomain.com/Dev/ClientInterface_2.swf cannot load data from http://chat.kongregate.com/flash/API_AS3_de614ba32910c407ff307ec996cd79e4.swf.
Thanks for the help!