Hey PixelRebirth
I have tried something like that >
I added those in index.html
<script type="text/javascript"
src="http://cdn.gameplayer.io/api/js/game.js"></script> ( before </head>)
and
<script>
//Spil Api
GameAPI.loadAPI(function(API) {
GameAPI.GameBreak.request(fnPause, fnResume);
});
var apiTry= 2;
function fnPause()
{
var apiTry = 0;
}
function fnResume()
{
var apiTry = 1;
}
</script> (after <script src="c2runtime.js"></script> )
Also I have added those in capx.
<img src="http://new.tinygrab.com/bd08b53d3f72a32d77a05e99619f2c09321047a8e2.png" border="0" />
After all there is no error in console and when I tried apiTry = 0 and apiTry=1 it works. But there is no ads or anything.
Just wanted to mention that in your script you keep declaring the variable apiTry every time. Actually it should just say "apiTry=value;" when you want to change it again. You only have to put "var apiTry=value;" one time.
Also I'm not sure if you just did this for testing purposes, but I noticed you put "GameAPI.GameBreak.request(fnPause, fnResume);" in the loadAPI method. Normally you should call this from within C2 whenever you want to show an ad and not when the API is readily loaded.
I also made a similar test on my localhost and didn't get any javascript errors either. And no ad either. I observed that you only ever get the fnResume callback, never fnPause, but this might be because it was on localhost. Also the branding thing seems to return "0" every time.
This might be because the game has to be on their platform servers to work. I've used a couple of APIs before and usually they have some sort of online testing environment, it wouldn't work locally. Some do have a special script for testing locally too, which is nice.
I really don't know about spilgames. Registering with them as a developer just gives you access to flash related stuff. Including such an online tester.
Probably just wait for what skyhunter93 will report. <img src="smileys/smiley4.gif" border="0" align="middle" />