![]() |
Login | Sign Up |
MindJolt Score Submission API for AS32008/02/27 - The MindJolt AS3 API is currently in beta release. As such, we appreciate your understanding as we work through any bugs or issues that may arise. We also welcome any comments or feedback on how we can improve the API functionality, and the ease of installation. There are four ways you can install the API. We recommend using the MXP component if possible, because it's just so easy to do! For those that can't use components, there is an actionscript snippet to use instead. Installation by using components (highly recommended)Pick one of the three choices below to install the MindJolt API using easy, packaged components: MXPThis is the recommended choice. If you haven't already done so, install the Adobe Extension Manager. Once it is installed, just click on the MXP file, and it'll automatically add the MindJolt API to your components panel, for easy access whenever you want to use it. (Now all you have to do is open your game, and drag the MindJoltAPI component from the Components panel to the stage of your game, and the API is installed!) SWCIf you do not want to use the Adobe Extension Manager, you can manually install the MindJolt API into your Components panel by doing the following:
(substitue "en" for whatever your language code is) Macintosh: Macintosh HD:Applications:Adobe Flash CS3:Configuration:Component:MindJolt (Now all you have to do is open your game, and drag the MindJoltAPI component from the Components panel to the stage of your game, and the API is installed!) FLAIf you do not want to add the MindJolt API into your Components panel (which you should do, so you only have to deal with this once!!!), then you can open our sample .fla file, copy the MindJoltAPI component from its library, and paste it onto the stage of your game. download FLA sample with included componentManual installation by using actionscript code snippetOk, so you can't (or don't want to) use components. That's ok, you can still use the API by inserting this snippet of actionscript instead. Below is a code snippet that will load the API manually. This code snippet needs to happen as EARLY as possible when your game starts. You will need access to "root" to be able to get the path to the API that we'll pass in via FlashVars. After you lead the API from that path, you need to keep track of the API instance yourself, so you have it when you want to submit the score.
How to use it!!!Now that you have the API installed through one of the above methods, you need to get access to it in the code to submit the score.If you are using one of the components, you can get access just by using the Then add the line of code that will submit the score.You simply need to provide the score. And, if you use game modes, you should provide the current mode the player is playing in. (Example game modes: "easy", "normal", "hard", etc.) The submitScore call should be placed wherever you compute the final score for the game. For example, suppose you store the score in a variable called "
Only put in a game mode if you have more than one mode in your game. This allows us to track the high scores for each game mode separately. |