API Documentation

58 posts

Flag Post

EDIT: Check out the dedicated Kongregate API Forum.

EDIT: We’ve now moved to a better layout. The old version is still up, but the new version is viewable here, or by clicking on the “Developers” link at the top navigation bar.

As some of you may have noticed, BenV completely rewrote our documentation for our APIs in our new Kongregate APIs page. You can get to this page easily by using the link in the Developers sub navigation bar at the top of the screen.

These new pages contain the most up-to-date information and are more concise and specific than the old threads have become. Because a number of changes have been made in how we handle our APIs and what features we have, we’ve decided to un-sticky and lock the older threads – too much of the information is just simply wrong at this point that we worry that keeping them around will continue to confuse people.

After reading the docs, we highly encourage you to continue posting questions about the APIs in this forum. We’ll let you guys decide on a format for these posts, be it one thread per API or a thread per question or whatever.

We’re trying to avoid mammoth threads on the topic, so please don’t post all API questions in this one. However, if you have any questions specific to the documentation pages (possible typos, missing information, etc.) do please let us know in this thread. Thanks!

 
Flag Post

Wow! The API can do all that O_O

Maybe we should have a separate “Kongregate API” topic thingy?

 
Flag Post

Whoa! Microtransactions! IFrames! Chat! Nice APIs.

EDIT: Error on this page where in the first paragraph(overview) you say “support for the AS2 drawing API.”, while everywhere else you talk only about AS3.

 
Flag Post

i would like to point out that on those pages the screen shot is of the old flash chat, which can no longer receive messages (everything else works, including sending, and logging in did a few months back… i still have a copy of it that’s included into the chat exe i had made)

 
Flag Post

I have been looking for 20 minutes and I can’t find any API.
An API is a list of all the classes and functions in a library.
All I can find is some explanations of some of the features, with very little example code.

 
Flag Post

So, I read that whole thing, or I tried to. My eyes glazed over and was very confused. So I entered the code in the onLoad of one of my .as’s and got these errors:

Import statements are not allowed inside class or interface definitions.

I got this error every time I tried to use any of the “import flash.something or others” (import flash.display.LoaderInfo;)

What am I doing wrong?

 
Flag Post

You’re using import statements inside a class or interface definition, the clue is in the error.

 
Flag Post

No duh –_– . But where do I put them instead?

 
Flag Post

Outside the class or interface definition, the clue is in the error.

 
Flag Post

Screw you troll, get out of here.

 
Flag Post

He wasn’t being a troll. A bit blatant maybe, but the answer was a little obvious.

 
Flag Post

Also, I liked the old API format the felt like an F1 Docsfile in flash. I feel it can help in showing little bits here and there and helps make experimenting a bit easier.

 
Flag Post

Where is there in code besides the class?

Like, where do I put it?

 
Flag Post

Inside the package, outside the class.

 
Flag Post

So, at the top of the .as? Before the actual class starts?

 
Flag Post

Yes. It’s really not that hard:

// outside class definition
public class Main extends MovieClip{

    // inside class definition

}
 
Flag Post

Could someone please post the link of the exact page where the API is, by API I mean a list of all the classes and functions in the Kongregate API

 
Flag Post

That’s what I’m looking for too, while this stuff works generally, there isn’t enough info!

 
Flag Post

yay documentations!

 
Flag Post
Originally posted by Cloud_9ine:

That’s what I’m looking for too, while this stuff works generally, there isn’t enough info!

There is plenty. Look under the statistics API. You load Kongregates’ API througth a .swf and call functions from it.

 
Flag Post
Originally posted by UnknownGuardian:
Originally posted by Cloud_9ine:

That’s what I’m looking for too, while this stuff works generally, there isn’t enough info!

There is plenty. Look under the statistics API. You load Kongregates’ API througth a .swf and call functions from it.

No, no. I have used the API before, you load it up call a function and such. I’m talking about the listing of all the variables and functions for the API. SO that way I can know every bit and peice of it.

 
Flag Post

Ugg. API is too confusing for me. I hate them darn variables. I always have. Can anyone explain it simpler? (even though that is nigh impossible) I posted my game for the Longest Lasting contest, and I just found out it needds API to qualify, but I don’t know how to do it right. I am thinking of making it highscore, like you get 300. But I can figure it out.
Okay I am freaking out now my flash swf file for the game dissapeared and I can’t find it… And I just opened the .fla and the first frame is gone HELP ME!!!!!!!!!!! :(

 
Flag Post

Okay nvrm I get it now. But when I try it there is an error:
Error Scene=Scene 1, layer=code, frame=6:Line 181: ‘)’ or ‘,’ expected
submit(statName:String,value:Number):void

Total ActionScript Errors: 1 Reported Errors: 1

Help? And where stat name is, do you put the name on kong like HighScore and is it in ""s?

 
Flag Post

As far as I know, my game is ready to roll, but I won’t publish until I know its connecting with Kong. Is there any simple way of knowing if its connecting?

 
Flag Post

I’m having problems submitting stats and my kongregate.users.getName(); returns null. I can connect fine (get the green light). This is in AS3. Anyone else having problems? Is there somewhere I can go for more clear directions on usage?

Edit: The problem was I was uploading a preloader as a separate .swf and using it to load my game with the API from another .swf. As soon as I got rid of the preloader and made my game the first thing uploaded it all worked.