Login   |   Sign Up
Developer Home > Score API for AS2/AS1

MindJolt Score Submission API for AS2/AS1

To interface with our system, you simply need to add these two lines to wherever you currently compute the final score (they should not be attached to a button, but should instead be in the frame that displays the final score, which will allow it to auto-submit to us):


ScoreAPI = new LocalConnection();
ScoreAPI.send(_root.com_mindjolt_api, "submitScore", yourscorevariable);

Those lines will open up a connection to the game loader, using a variable that is passed in to your game called com_mindjolt_api (which should be accessible from your _root).

The only thing you should have to change, is to replace "yourscorevariable" with whatever variable you use to hold the final score.

For games that have multiple modes (easy, medium, hard, etc.) and should have scores tracked separately for each mode, you can add an extra variable to the call, to let us know which mode the user was playing. For example:

ScoreAPI.send(_root.com_mindjolt_api, "submitScore", yourscorevariable, "easy");

OR

ScoreAPI.send(_root.com_mindjolt_api, "submitScore", yourscorevariable, "medium");

Finally, it is probably best to do a:

_lockroot=true;

in the first frame of your game. We've had some games have problems without explicitly setting this.

That's all there is to it on the game developer's end. We tried to keep things simple for integration.