[Kongregate API] AS2 Integration page 8 (locked)

Subscribe to [Kongregate API] AS2 Integration 216 posts, 118 voices

Sign in to reply


 
avatar for HybridMind HybridMind 3 posts
Flag Post

Help with Kong Statistics API:

Hey everyone.. I’ve been scouring google, kongregate and mochiads forums and I have not yet found a proper solution to my issue. I have not been able to get my game working with the Kong Stats API yet. The light stays red and the debug window just says “info: listening for connection…” My game TurnStyle is an AS2 game that is wrapped in a MochiaAds AS3 encrypted preloader… or at least that is how their Ads API described it. I am really new to Flash and ActionScript 2 so I’m sure this is something easy.

I have read all the kong forum threads on the AS2 integration of both High Scores and Stats. I have a feeling that it could be something to do with the MochiAds preloader though. In the mochi integration they mention that you can’t use (root) references anywhere because of the AS3 wrapper. I then read that using "root" is a bad practice so I removed all traces according to some best practices guides I found.

Have any of you devs used the MochiAds preloader around your games and gotten the stats API to work yet?

I have tried using _root.kongregateServices.connect() .. I’ve tried not using it. I’ve tried setting vars that will climb “up” a parent tree incase that was what was going on once it was “wrapped” by kongs SWF. I’ve tried putting the Kong connect code in my “Actions” panel for a dedicated action script layer on the timeline (frame 1) where all the other mochiad stuff is (whis is working fine.)

I’d love any help, thanks!

 
avatar for Pimgd Pimgd 725 posts
Flag Post

I have a question that I can’t find the answer for…

If I submit via kongregateScores, can they still be used for badges? Or do I have to put kongregateStats?

 
avatar for leo828 leo828 287 posts
Flag Post

Hello. I’m trying to figure out how the API actually works, through a button test.


I have this code for the frame



_root.kongregateservers.connect();

root.kongregateScores.submit(mynstep.value);

ifFrameLoaded (1)
{
my_nstep.value = 0;
}





for the NumericStepper, I have this:


import mx.controls.NumericStepper;
var my_nstep:mx.controls.NumericStepper;

if (my_nstep.value = 100)
{
_root.connect.KongregateStats.submit(“.1% of the way there!”, 1)
}

if (my_nstep.value = 1000)
{
_root.connect.KongregateStats.submit(“1% of the way there!”, 1)
}

if (my_nstep.value = 100000)
{
_root.connect.KongregateStats.submit(“Win!”, 1)
}

 
avatar for theassassinator theassassinator 131 posts
Flag Post

i recently added a stat to my game assassins creed quiz.. when i do the debug thing it only says listening for connection.. what have i done wrong?

 
avatar for clapter clapter 6 posts
Flag Post
Originally posted by dazzer:

Judging by the code, this means that there is a standard Kongregate swf, that loads the swf that we load? Thus we need to call _root?

I will think about how this will apply to flash 9… Thanks

 
avatar for CraigBrian CraigBrian 7 posts
Flag Post
Originally posted by HybridMind:

Help with Kong Statistics API:

Hey everyone.. I’ve been scouring google, kongregate and mochiads forums and I have not yet found a proper solution to my issue. I have not been able to get my game working with the Kong Stats API yet. The light stays red and the debug window just says “info: listening for connection…” My game TurnStyle is an AS2 game that is wrapped in a MochiaAds AS3 encrypted preloader… or at least that is how their Ads API described it. I am really new to Flash and ActionScript 2 so I’m sure this is something easy.

I have read all the kong forum threads on the AS2 integration of both High Scores and Stats. I have a feeling that it could be something to do with the MochiAds preloader though. In the mochi integration they mention that you can’t use (root) references anywhere because of the AS3 wrapper. I then read that using "root" is a bad practice so I removed all traces according to some best practices guides I found.

Have any of you devs used the MochiAds preloader around your games and gotten the stats API to work yet?

I have tried using _root.kongregateServices.connect() .. I’ve tried not using it. I’ve tried setting vars that will climb “up” a parent tree incase that was what was going on once it was “wrapped” by kongs SWF. I’ve tried putting the Kong connect code in my “Actions” panel for a dedicated action script layer on the timeline (frame 1) where all the other mochiad stuff is (whis is working fine.)

I’d love any help, thanks!

1. You cant have AS3 in AS2 well you can but it will not work as well go to mochiads and get the mochi ad code there should be 2 version AS2 and AS3 select AS2 then you have to goto Flash CS3 Professional/CS4 or what ever you are using and put that line of code in the very first frame unless your advertising somewhere else like when you get a game over then you put it on the last frame

2. next you have to download the MochiAPI_v3_0.zip and copy the mochi folder to where your flash game is located for example mygame.fla then test your project if you successfully see your add then you did it right if you did not see your add then you have done something wrong probably put the wrong version of the mochi folder where your game is

I can help you with that I could make a video for you that shows you how to put mochiads in your game just email me at craig_val@hotmail.com or leave a comment in my guest book at my website

for the Kongregate game not loading I don’t know but can you at least tell us if the light is green and try it in different browsers like IE, Firefox, Opera, Safari, Google Chrome and more

 
avatar for 0_______________ 0___________... 1 post
This post has been removed by an administrator or moderator
 
avatar for coocooletmoi coocooletmoi 4 posts
Flag Post

How do I do a statistic which like…. Obtain a score of 20 on EASY mode?

 
avatar for coocooletmoi coocooletmoi 4 posts
Flag Post

Do I like, do something like this :

if(score>=20) {
_root.kongregateStats.submit(“easyScore20’”,20);
}

??

 
avatar for Tukkun Tukkun 77 posts
Flag Post
Originally posted by coocooletmoi:

Do I like, do something like this :

if(score>=20) {

_root.kongregateStats.submit(“easyScore20’”,20);

}

??

Yes, or you can do something similar to this:

_root.kongregateStats.submit(“easyScore”, score)

By doing that, you can also make a scoreboard…

You DON’T have to write the badge requirements in your game. Greg will make the badges and the requirements like easyScore >= 20. If you use _root.kongregateStats.submit(“easyScore20’”,20);, then the badge requirement will be easyScore20 >= 1.

 
avatar for casimodo casimodo 25 posts
Flag Post

It seems a statistic of my game is going crazy; I’d appreciate some help :)

_root.kongregateStats.submit(“SecondsEnd”, time);
_root.kongregateStats.submit(“TacklesEnd”, tackle);

How come the first variable is updated smoothely without any problems and the second one not? “tackle” is not the problem, because it works fine with other game modes (Normal and Difficult). The name “TacklesEnd” is exactly the same given in the “…/statistics”, and it sometimes works, but usually doesn’t. Is it perhaps that I have too many variables? Or maybe it is related with the new chat? I don’t remember having any problems before the change.

Thank you very much in advance!!

 
avatar for Mastercool2 Mastercool2 9 posts
Flag Post

“” – this type of quotation mark is not allowed

but if I use the normal one it wont work ?!

 
avatar for Jabor Jabor 9707 posts
Flag Post

If you copy-paste “smart-quoted” text, then it will break.

You need to use straight double quotes ""

 
avatar for itwastillAntwan itwastillAntwan 19 posts
Flag Post

hey guys, I am new to this whole programming thing, and, I am clueless of what to do, I am trying to add buttons to my game, but I do not yet know how. I also want to add sounds, but I cant find out that either. Please help!

 
avatar for Frogmanex Frogmanex 3648 posts
Flag Post

The better thing to do, Antwan, is to figure out a specific question you need help answering, then post it as its own topic in the forum. This topic is supposed to be focused primarily on the AS2 Kong API integration…

 
avatar for Meox Meox 1 post
Flag Post

ok i have made some statistics and put it in my game re uploaded it and the plug is green so now what?

 
avatar for twister twister 2 posts
Flag Post

hey so I have a problem getting the API to work on the game block dodger. my code connects when the play button is pushed with _root.kongregateServices.connect(); and when the player loses _root.kongregateScores.submit(“finalscore”, finalscore); is run. I have a finalscore statistic set upfor the game however there is no achievements/highscore for my game, and I am recieving 40% ad rev.

Any tips/advice that would help me get my API working would be much appreciated

 
avatar for UnknownGuardian UnknownGuardian 1700 posts
Flag Post
Originally posted by twister:

hey so I have a problem getting the API to work on the game block dodger. my code connects when the play button is pushed with _root.kongregateServices.connect(); and when the player loses _root.kongregateScores.submit(“finalscore”, finalscore); is run. I have a finalscore statistic set upfor the game however there is no achievements/highscore for my game, and I am recieving 40% ad rev.

Any tips/advice that would help me get my API working would be much appreciated

You might have missed something when uploading. You have to check the “has stats” box and write in what stats it has.

 
avatar for twister twister 2 posts
Flag Post

when I go to http://www.kongregate.com/games/twister/block-dodger/statistics it says that I have a finalscore statistic that is a max type

 
avatar for Pierz2 Pierz2 1 post
Flag Post

How to re-upload the game with API?

 
avatar for mp630 mp630 36 posts
Flag Post

I seem to be having problems also with the scores and such. It seems that I only get one or two reports to the server even if I have it send the score, say on every players move.

_root.kongregateStats.submit(“HighScore”, myscore);
trace(“Kong > highscore:”+myscore);

seems to only work once??

HighScore is a max, leaderboard stat.

 
avatar for Zuriki Zuriki 62 posts
Flag Post

Does the “connection” return a value that I can fetch?

Say, if the connection breaks, my game can retrieve a value of 0 and I can display a warning like:

“Alert: Connection broken, highscores and badges disabled. Attempting to reconnect…”

And if it returns a 1 after that I can then display a message like:

“Alert: Connection established, highscores and badges enabled.”

 
avatar for Zuriki Zuriki 62 posts
Flag Post

=Bump=
I don’t wish to appear impatient, but I would appreciate an answer to my question. Thank you.

 
avatar for Vegard20 Vegard20 188 posts
Flag Post

Does the highscore thing work in preview version?

 
avatar for hzipperz hzipperz 2 posts
Flag Post

Thanks so much, I get disconnetcted all of the time!

Sign in to reply


Click Here