| MindJolt API |
|
|
|
| Written by Waleed Al Bahrawy | ||
| Wednesday, 21 January 2009 12:14 | ||
|
MindJolt provides high score api for developers to use in their flash games. They say there are 4 ways to install the API, 3 of them using components and the last one is manually done using action script, lets take a look at them. Note: If you dont want to deal with adobe extensions jump to step 3.
Installation using components (highly recommended): 1-MXP -Install Adobe Extension Manager . -download the MXP component. -After installing the extention, run it and goto file>Install Extension and choose the MindJoltAPI component. -Now go to your flash file and go to Window>Components and you will find the component under the name MindJoltAPI drag it and drop it on te stage.
2-SWC If you dont want to download the extension manager do the following: -Close adobe flash -Download the SWC File. -Follow this path C:\Program Files\Adobe\Adobe Flash CS3\en\Configuration\Components\ in Components create a new folder and name it MindJolt and paste the SWC file inside it. -Now open flash and go to Window>Components and you will find the component under the name MindJoltAPI drag it and drop it on te stage.
3-FLA If you dont want to deal with adobe extensions, then do the following: -Download the Sample FLA File . -Open it and copy the MindJoltAPI component from the library and paste it in your flash file.
Manual installation by using actionscript code snippet: 4-Action Script 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 import statement below. But, if you were using the manual code snippet, then you'll have to get access to the MindJoltAPI variable you declared in the script instead. import com.mindjolt.api.as3.MindJoltAPI;
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 "currentScore".
1-Submitting a score without a game mode MindJoltAPI.service.submitScore(currentScore);
2-Submitting a score with a game mode MindJoltAPI.service.submitScore(currentScore, "easy");
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.
For more info visit MindJolt API Related Articles
|
||
| Last Updated on Thursday, 12 February 2009 01:09 |
Copyright © 2009 FreshNova, by Talha Kalim and Waleed Al-Bahrawy





Comments
http://www.watchhotmovieso nline.com
http://eventsearch.us
mortgage calculator with taxes
http://www.locations4business.com/europe/uk/yorkshire-and-h umber/south-yorkshire/rotherham-inves tment-and-devel opment-office/
http://directory2009.com/