kongregateAPI.loadAPI never calls the callback? JS integration problem

9 posts

Flag Post

I’m an experienced web developer working on integrating the Kongregate API into a JS/HTML5 iFrame game.

I downloaded the zip file example from the docs page (http://developers.kongregate.com/docs/api-overview/client-api)

I’m having a problem though: kongregateAPI.loadAPI never calls the callback function passed to it. Anyone else have this problem? Anyone get this to work?

Also, if anyone is curious, kongregateAPI.loadAPI does the following (I dug into it, trying to figure out where the bug is):

kongregateAPI.loadAPI = function(callback) {
var that = this;
var passToCreateAnsible = function() {
services = [“services”, “stats”, “mtx”, “chat”, “sharedContent”];
var faBridge = FABridge.ansible.root();
for (index = 0; index < services.length; index++) {
var service = services[index];
that._services[service] = faBridge.getServices(service);
}
if (typeof callback == “function”) {
callback();
}
};
kswfobject.addDomLoadEvent(function() {
that.createAnsible(passToCreateAnsible)
});
};

 
Flag Post

I think the problem is that the “ansible” (the Flash object that serves as a bridge between Flash and AJAX, hence the name faBridge) is not being initialized properly. Perhaps the function FABridge__bridgeInitialized isn’t being passed the correct parameter? I suggest this after debugging it more, and seeing that the ansible object is being created with data=“http://undefiend&#8221;

See below, this was what I saw in my browser:

<div><object width="1" height="1"><param><param></object></div>
 
Flag Post

Yep, I think that’s it. There’s a problem getting the ansible path: kongregateAPI.getVariable(“kongregate_ansible_path”) is returning “undefined”, which is why the #ansible object has data=“http://undefined&#8221;

Kongregate devs, can I get a response to this? Looks like a bug.

 
Flag Post

I’m new to web developing, but I also experienced that the example for integrating Kongregate APIs to JS doesn’t work. Maybe I’m doing something wrong, but I always got an error report, which says:

“kongregate is undefined”
in line:

kongregate.services.addEventListener(“login”,checkUserAuthenticated); // Register for the “login” event so we can tell when a user logs in

And there are some problems with the downloadable Kongregate JS shell too. The first error report I got, that:
‘borders’ is an unknown property

I managed to find where this problem is:
<!-- The div that the game will be placed into. Make sure to set the Width and height properly -->
div id=“contentdiv” style=“top:0px; left:0px; width:700px; height:500px; borders:none;”
<!-- You can manually put your game iframe in here instead of calling embedFrame above if you wish -->

After correcting this, the shell still doesn’t work, I get a notification:

GET http://undefined/ [2375 ms]

It seems for me, that some source file has been removed, or deleted. Does anyone know how to make the shell working?

 
Flag Post

I am also having this issue, with the http://undefined when creating the ansible object.

Any movement from Kongregate devs on this? Running out of options and time :(

 
Flag Post

same here
the thing i dont understand is this

yestereday I could submit stats etc, but couldn’t get the username
so i tried to fix that but now everything is broken
i have another game where it works perfect
i copy paste the exact same code and it still doesnt work
i make a new empty scene and put only the kong code in there, stil ldoesnt work
i take the game where it works and delete everything except the kong code and it works
makes no sense at all

 
Flag Post

Same problem for me.
I emailed support, no answer.

 
Flag Post

I’m also running into this. Has anyone received a response from kongregate? Seems pretty bad if this has been broken since January.

 
Flag Post

your game, go to the game upload page set iframe url: http://www……com/kongregate_shell.html