Contact us
Did you develop any game or animation and do you want to see it at LittleBigPlay.com? Contact us at and we
will publish your creation!
admin[at]littlebigplay.com
PORTAL BATTLES - HIGHSCORE API - ACTIONSCRIPT 3
Do you want to see your game in the portal battles? Go through these 4 easy steps and send us the game!
1. add this code to the first frame of you game:
import flash.events.*;
var APILoader:Loader = new Loader();
var api:MovieClip;
function loadAPI(src:String) {
APILoader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadComplete);
var request:URLRequest = new URLRequest(src);
APILoader.load(request);
addChild(APILoader);
}
function loadComplete(e:Event):void {
trace("API Loading complete");
api = APILoader.content as MovieClip;
//loads API
api.loadMe();
}
loadAPI("http://www.littlebigplay.com/LBPAPI.swf");
2. call this function on your game over screen:
api.submitResult(Number(score)); //replace score by players score
3. Compile the game and test it! (on the game over screen you should be redirected to LBP page and there should be shown your result)
4. Send us the game!
SUPPORT US