I am using the kongregate_shell.html
Below is said shell:
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”> <html> <head> <title>Dragon Knight</title> <!-- Load the Kongregate Javascript API --> <body> API is finished loading function onLoadCompleted(){ // Get a global reference to the kongregate API. This way, pages included in the // iframe can access it by using “parent.kongregate” parent.kongregate = kongregateAPI.getAPI(); var kongregate = parent.kongregate(); // Embed the game into the “contentdiv” div, which is defined below. You can also // manually create your own iframe, this function is just for convenience. // This example also passes along the kongregate user_id and game_auth_token so // that the page can use them for authentication. var params = “kongregate_user_id=” + kongregate.services.getUserId() + “&kongregate_game_auth_token=” + kongregate.services.getGameAuthToken() + “&random=” + (Math.random() * 1000000000) + “&level= <?php echo $userrow[‘level’] ?>”; kongregateAPI.embedFrame(“index.php” + params); } // Begin the process of loading the Kongregate API: kongregateAPI.loadAPI(onLoadCompleted); var level = level; if(level != NaN){ kongregate.stats.submit(Level,level); } } <div> <!-- You can manually put your game iframe in here instead of calling embedFrame above if you wish --> </div> </body> </html>
As you can see this has been modified slightly, and I can report that the server actually does receive my current level in my game which is 9.
However, when loading my game I receive this error when " kongregate.stats.submit(Level,level); " Is not " parent.kongregate.stats.submit(Level,level); "
[04:49:03.790] ReferenceError: kongregate is not defined @ http://www.gatheringofmagic.com/index.php:47
This is stating to me that kongregate doesn’t exist?
When i try “@parent.kongregate.stats.submit(Level,level);@” I receive this error:
[04:50:31.083] Error: Permission denied to access property ‘kongregate’ @ http://www.gatheringofmagic.com/?(this part is hidden).
As you can see It states I have no permissions to access this ‘kongregate’
I have emailed tech, asked a few developers and even offered money to random people outside of Kong for help, and, nothing.
I found the PHP/JS work-around via another dev, but it’s not letting me access It.
I call this function from a function called donothing(); with php, which means when you login and go to a town, you submit stats.
My game is like 98% PHP/SQL.. hosted via IFRAME, It even states I can access API within an IFRAME using parent.kongregate
So.. Am i lost or what? Because as far as I can see the data is pretty much correct?