FreshNova - Home

Friday 30th of July 2010

Home Flash Tutorials MindJolt API
MindJolt API PDF Print E-mail
Written by Waleed Al Bahrawy   
Wednesday, 21 January 2009 12:14
 

mindjolt

 

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.

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41

import flash.display.Loader;
 
import flash.display.LoaderInfo;
 
import flash.net.URLRequest;
 
import flash.events.Event;
 
// You'll use this variable to access the API
//(make sure you can access it from wherever
//you will later call submitScore)
 
var MindJoltAPI:Object;
 
//////
// All of this code should be executed at the very
// beginning of the game
// get the parameters passed into the game
 
var gameParams:Object = LoaderInfo(root.loaderInfo).parameters;
 
// manually load the API
 
var urlLoader:Loader = new Loader();
 
urlLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,loadFinished);
 
urlLoader.load(new URLRequest(gameParams.mjPath
"http://static.mindjolt.com/api/as3/scoreapi_as3_local.swf"));
 
this.addChild(urlLoader);
 
function loadFinished (e:Event):void {
 
MindJoltAPI=e.currentTarget.content;
 
MindJoltAPI.service.connect();
 
trace ("[MindJoltAPI] service manually loaded");
 
}

 

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

Comments

avatar Ronan
0
 
 
Hi! I already spent hours to solve this, but i don't find the reason or a solution. I am integrating the mindjolt api (as2) to my game. Locally everything is working. It says the api is loaded and when submitting sore, it says submitsore is called. But after uploading the swf to mindjolt, it's not working anymore. I tried to solve the problem myself and searched for some additional information on http://www.mp3hunting.com Search Engine. I downloaded a couple of reviews. But they could hardly help me... I'm confused.......
Name *
Email (For verification & Replies)
Code   
ChronoComments by Joomla Professional Solutions
Submit Comment
Cancel
avatar fishing hats
0
 
 
I am very happy to discover your post as it will become number 1 in my collection of favorite blogs to visit. http://fishinghat.org
Name *
Email (For verification & Replies)
Code   
ChronoComments by Joomla Professional Solutions
Submit Comment
Cancel
avatar Watch The Grown Ups Movie Online for Free
0
 
 
This was a useful post and I think it is rather easy to see from the other comments as well that this post is well written and useful. I bookmarked this blog a while ago because of the useful content and I am never being disappointed. Keep up the good work

http://www.watchhotmovieso nline.com

Name *
Email (For verification & Replies)
Code   
ChronoComments by Joomla Professional Solutions
Submit Comment
Cancel
avatar Stefani
0
 
 
Thanks! It is great you've explained how to use it! It was of great help! I'll definetely use it!
http://eventsearch.us
Name *
Email (For verification & Replies)
Code   
ChronoComments by Joomla Professional Solutions
Submit Comment
Cancel
avatar Free dating sites online
0
 
 
Good post. I am also going to write a blog post about this...
Name *
Email (For verification & Replies)
Code   
ChronoComments by Joomla Professional Solutions
Submit Comment
Cancel
avatar mortgage calculator with taxes
0
 
 
i found great articles here. And I will get back here. I just added your blog to my bookmark sites. thanks.
mortgage calculator with taxes
Name *
Email (For verification & Replies)
Code   
ChronoComments by Joomla Professional Solutions
Submit Comment
Cancel
avatar invest in rotherham
0
 
 
Name *
Email (For verification & Replies)
Code   
ChronoComments by Joomla Professional Solutions
Submit Comment
Cancel
avatar online shopping
0
 
 
The article is very interesting.it is very useful.http://www.shopbigbig.com
Name *
Email (For verification & Replies)
Code   
ChronoComments by Joomla Professional Solutions
Submit Comment
Cancel
avatar cheap shoes online
0
 
 
http://www.shopbigbig.com. You are very professional! Thank you for your sharing!
Name *
Email (For verification & Replies)
Code   
ChronoComments by Joomla Professional Solutions
Submit Comment
Cancel
avatar p
0
 
 
Name *
Email (For verification & Replies)
Code   
ChronoComments by Joomla Professional Solutions
Submit Comment
Cancel
avatar yll
0
 
 
[url=http://www.mbt-zapatos-2010.com][b]Mbt zapatos[/b][/url]como una tormenta se extendió por Europa y el mundo.[url=http://www.mbt-zapatos-2010.com/free-shipping-m bts-c-272.html][b]Mbt zapatos[/b][/url]cómo tener tanto poder? Según la investigación,[url=http://www.mbt-zapatos-2010.com/men-mbt-shoes-c -242.html][b]Mbt zapatos[/b][/url]no sólo su propio estilo de diseño único, sino también porque hay magia buena forma física, así[url=http://www.mbt-zapatos-2010.com/women-mbt-shoes-c -240.html][b]Mbt zapatos[/b][/url]no es coincidencia que es tan popular. Esta es una forma de cambio histórico[url=http://www.mbtzapatos2010.com/mens-mbt-zapato s-c-238_246_247.html][b]Mbt zapatos[/b][/url]son.
Name *
Email (For verification & Replies)
Code   
ChronoComments by Joomla Professional Solutions
Submit Comment
Cancel
Name *
Email (For verification & Replies)
Code   
ChronoComments by Joomla Professional Solutions
Submit Comment
Last Updated on Thursday, 12 February 2009 01:09
 

Archive

 

Categories


Copyright © 2009 FreshNova, by Talha Kalim and Waleed Al-Bahrawy