Game > Flash


For a walkthrough of how to integrate Kongregate and Newgrounds into your game, read our article on Stencylpedia.


Kongregate

Start Kongregate API

start api

Starts up the Kongregate API. Must be used before doing anything with the API.

kongregateInitAPI();

Submit Score

submit score number to with name text

Submit a score to Kongregate. First field is the name of the statistic. Second field is the value of it (a number).

kongregateSubmitStat([TEXT], [NUMBER]);

Is a Guest? (vs. logged in)

player is a guest

Returns true if a guest is playing your game on Kongregate.

kongregateIsGuest()

Name of Player

name of player

Returns the username of the player who is playing your game on Kongregate, if one is logged in. If it's a guest, the name will be Guest.

kongregateGetUsername()

User ID of Player

id of player

Returns the user ID of the player who is playing your game on Kongregate, if one is logged in. If it's a guest, this will come back as blank.

kongregateGetUserID()

Newgrounds

Show Ad

show ad

Immediately shows a Newgrounds ad in the center of the screen. Can be shown at any point in the game.

newgroundsShowAd();

Submit Score

submit score number to for board text

Submits a score to the specified Newgrounds leaderboard.

newgroundsSubmitScore([TEXT], [NUMBER]);

Show Scoreboard

show scoreboard for board text

Shows the specified Newgrounds leaderboard.

newgroundsShowScore([TEXT]);

Unlock Medal

unlock medal for text

Unlocks a medal (achievement) by name. Medals are set up on Newgrounds.

medal

newgroundsUnlockMedal([TEXT]);

Move Medal Window

move medal to x number y number

Sets the default location where the medals are shown. Call this at the beginning of the game - only has to be done once, but it has to be called before the medal shows. This cannot move medal windows that are already visible.

newgroundsSetMedalPosition([NUMBER], [NUMBER]);