Level: Beginner
Third Party Services - Kongregate and More
Stencyl has partnered up with Kongregate, Mochi Media and Newgrounds to bring you direct integration of each of these popular networks’ APIs to bring Ads, Leaderboards and Achievements to your games.
Note: All of these blocks may be found under the Game > Flash section of the Palette.
Contents
-
Kongregate
-
Mochi: Basics
-
Mochi: Pre-Game Ads
-
Mochi: Troubleshooting
-
Newgrounds
-
Other APIs (CPMStar)
Kongregate
Kongregate is a popular gamer-oriented Flash portal. It’s developer friendly and towards a more sophisticated hardcore audience than typical Flash portals.
Before you Start
The bulk of our support involves sending scores over to Kongregate's servers. To do this, you first need to set up high scores on Kongregate's end. This page tells you how to do this.
Setting Up
Before you use the Kongregate API, use this block to initialize it. It doesn’t matter where or when this happens. Sticking it inside the first scene is best practice.

Submitting Scores
Unlike other services, Kongregate displays its scores as part of its site rather than in-game.

To submit a score, use this block. Be sure to set up each field you wish to record on Kongregate’s site and adhere to its best practices.

Player Info
With these blocks, you can test whether the player’s registered, a guest and their user name, if they are registered.

Achievements
The best games on Kongregate have achievements. Unfortunately, the staff picks out which games get achievements. The minimum bar is a 3.5 rating (in practice, it’s now 4+), hitting the front page and reaching at least several hundred thousand plays.
Mochi: Basics
Mochi is the leading purveyor of ads for Flash games and operator of a popular Leaderboard system.
Setup
1) Sign up on Mochi’s site and set up an entry for your game.
2) At the end of that process, you’ll have a Game ID.

Click the Settings button to open the dialog.

Next, click the Web button. Inside that dialog, you'll be able to enter the Game ID you received from Mochi's site.

Showing an Ad
Displaying an ad is simple. Add the “show Mochi ad” block precisely at the time you wish to show the ad.

Leaderboards
Displaying a leaderboard requires setting up the leaderboard first on Mochi’s site.
1) Visit the Scores page for your game by clicking “Scores” in the sidebar.
2) Click “Add Leaderboard” – it’s a small button on the right-hand side of the page.

3) Fill in an appropriate title. Leave the rest of the fields as-is and submit.
4) Click on the “actionscript code” link on the next page.
5) Look for “Leaderboard Id” and copy it to your clipboard – this is what you’ll enter in to Stencyl.
6) Now, use this block (Game > Flash APIs). Enter in the Leaderboard Id from step 5.

7) Save and run the game. The game will now show the leaderboard after finishing the level.

Mochi: Pre-Game Ads (Pro Only)
Pre-game ads display while a game is loading up. They’re a perfect time to engage a player during this waiting period.
All you have to do to enable Pre-Game Ads is go to this dropdown under Settings> Web> Loading Screen Style.

Mochi: Troubleshooting
What to do if ads and scores do not show up, or if you receive an error.
If you are testing locally, and want to be able to see ads or scores, you may need to do the following.
Add the location of your development files to your global security settings in the Adobe Flash Player Settings Manager. This way, you can give all SWF files in this location local-trusted access, allowing access to both local and remote data.
The folder you want to add is the entire Stencyl folder. This will catch everything underneath it, including the game itself. If you’ve chosen a custom workspace, you also need to add the folder for that.

Note: As of March 2012, we’ve noticed that Mochi has trouble displaying ads in Google Chrome. Try another browser if you experience issues.
Newgrounds
Newgrounds is a popular site for user-generated Flash content and games. They’re a great place to get a game sponsored.
Setup
Every Newgrounds game has 2 secret values that you must set, so that Newgrounds’ servers can communicate with your game. Set those values on the Advanced Settings page on the Dashboard.

Showing an Ad
Much like our Mochi solution, ads show at any point during the game, whether at the start or between levels.

Leaderboards
Newgrounds supports scoreboards. In order to use them, you have to set the scoreboards up on their site and get them approved by an administrator before they can be tested.

Once they are, you can opt to show the scoreboard, passing in the board’s ID/name, which you defined on Newgrounds.

Similarly, using that same board ID/name and passing in a value, you can submit a score to Newgrounds servers.

Medals
Medals are Newgrounds term for achievements. Like scoreboards, medals must be set up on Newgrounds site and approved by an administrator.

Two blocks can be used to work with medals. The move block is a one-time use block that you call at the start of the game (or anytime before a medal shows) to place the medal’s popup at an appropriate place on screen.

To unlock a medal (in other words, unlock the achievement), just use the unlock medal block.

Other APIs (CPMStar)
In the future, Stencyl will provide a way to extend the toolset and engine to support additional APIs.
On our end, we’re most interested in folding in APIs with wide adoption and interest. It’s likely that we’ll pull in an Analytics API in the future and add full support for the CPMStar ad network.
Note: As of Stencyl 2.0, we have support for CPMStar pre-game ads. These work much in the same way as the Mochi Ads. As you probably know, CPMStar is invite-only, so only those with access need worry about this.
Summary
-
Third party services let you increase your game’s engagement and provide simple ways to monetize.
-
Use services responsibly to complement a game.
-
Consider creating a mobile version of a game or receiving a sponsorship if you really want to monetize a game to its full extent.
Last Updated: 2013-01-29 by Jon
11997 have read this article
Disclaimer: The Stencyl Team does not actively monitor comments on articles. If you're seeking help for your game,
please ask a question on the forums. Thanks!
Sign In to Comment