Fandom

Kongregate Wiki

Flash API Reference

678pages on
this wiki
Add New Page
Talk3 Share

Kongregate has a Flash API that supports both Actionscript 2.0 and Actionscript 3.0.

OverviewEdit

ActionScript 2Edit

Before you integrate the Kongregate API into your game, first, you must go to your game page and add /statistics after the URL. For example, if I had a game named "EsI", I would go to www.kongregate.com/games/EsIeX3/Esi/statistics. Here, you get the statistics editor, where you set the names and types. There's four types, which are:

  • Max – The value on the server will be replaced if the new value is higher, for example a high score.
  • Min – The value on the server will be replaced if the new value is lower, for example the lowest time for completing a lap.
  • Add – The new value will be added to the value stored on the server, for example total number of coins collected. This can be used for statistics which are cumulative.
  • Replace – The new value will always overwrite the value on the server, this can be useful for boolean flags such as “Found key in level 1”

Now that the values are set, in the Actionscript code, add this in the first frame:

_root.kongregateServices.connect();

Yes, you can do this later, but it's recommended to add it in the first frame so that the red button lights up to green above the chat box. Now that you've connected, you can send in statistics by putting in the following code

_root.kongregateStats.submit("YourStatistic",1);//1 being the number you want to send in with it

And that's it!

ActionScript 3Edit

TODO

See AlsoEdit

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.