[Kongregate API] AS2 Integration page 9 (locked)

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

Sign in to reply


 
avatar for richard11166 richard11166 36 posts
Flag Post

Do I have a game already made to post it or does it have the program to make it as you post it?

 
avatar for Morticella Morticella 6 posts
Flag Post

hello I got some problem with the API AS2

i write [ first frame ]

_root.kongregateServices.connect();

and when the game it’s over

root.kongregateStats.submit(“HighScore”,root.hs);

but doesn’t work do you know why ?

thx

 
avatar for Morticella Morticella 6 posts
Flag Post

hello I got some problem with the API AS2

i write [ first frame ]

_root.kongregateServices.connect();

and when the game it’s over

root.kongregateStats.submit(“HighScore”,_root.hs);

but doesn’t work do you know why ?

thx

 
avatar for dasmitimsad dasmitimsad 1544 posts
Flag Post

root.kongregateStats.submit(“HighScore”,_root.hs);

That should be _root.kongregateStats.submit(“HighScore”,_root.hs); with the ‘_’ before root.

But since it’s on the first frame you shouldn’t need the _root. anyway. You could just use kongregateStats.submit(“HighScore”,_root.hs);

 
avatar for Morticella Morticella 6 posts
Flag Post

no is not the _ the problem but thx

 
avatar for dasmitimsad dasmitimsad 1544 posts
Flag Post
Originally posted by Morticella:

no is not the _ the problem but thx

Well it will not work with no _

Although, often the API doesn’t work. This was when I was testing it out in a game but nothing worked.

 
avatar for Morticella Morticella 6 posts
Flag Post

yeah i know that doen’t work without _ but i mean that is only an error on the post

the error arrive on the debug when i publish the file in swf.

 
avatar for liljbug liljbug 1 post
This post has been removed by an administrator or moderator
 
avatar for Morticella Morticella 6 posts
Flag Post

yeah nothing new in the post [ it’s like the first one ] but doesn’t work there is something wrong or some stuff i didn’t understaind. this post is useless but.. anyway thanks

if someone konw some new stuff please post here.

 
avatar for kaisen kaisen 1 post
Flag Post

Like in kongregate tutorial put this to function onLoad of the object that exists from beginning:
_root.kongregateServices.connect();

When let’s say your hero dies put this in place where this happens:
_root.kongregateStats.submit(“HighScore”, score);
Where score is variable in this file and represents your score(obviously)

Are you sure “hs” is a variable tracking your score?

Another idea did you add this variable to Statistics API when you upload a game? (I am not sure if this is needed but worth trying)

 
avatar for speedy090594 speedy090594 1 post
This post has been removed by an administrator or moderator
 
avatar for ManUChamp ManUChamp 4 posts
Flag Post

I need some help implementing my API on Brick Breaker Classic

var score:Number = 0; (My variable for the score)
_root.score += 10; (code for increasing score when hitting bricks)

When adding the API codes in, i publish a preview which doesnt work at all.
_root.kongregateServices.connect();
_root.kongregateStats.submit("Highscore, ?);

I dont know what to put in the _root.kongregateStats line, game doesnt work even when i have no script errors. Anyone help with coding ?

 
avatar for ManUChamp ManUChamp 4 posts
Flag Post

ok i got the code to work ^^ I hope it does connect and submit to kongregate correctly.

 
avatar for ruudiluca ruudiluca 3366 posts
Flag Post

Thanks

http://www.kongregate.com/games/ruudiluca/phobia-quiz

 
avatar for dagamer3 dagamer3 8 posts
Flag Post

this is what i have someone tell me how to fix so API will work plz
_root.kongregateServices.connect();
_root.kongregateStats.submit(str,1); _root.kongregateStats.submit(money,1); _root.kongregateStats.submit(rank,1);

 
avatar for nlween nlween 3 posts
Flag Post

try putting quotes around the name like this:
_root.kongregateStats.submit(“rank”,1);

Sign in to reply


Click Here