API KIZ10 INSTRUCTIONS - FLASH SETUP

DOWNLOAD API


For AS2, AS3, Haxe or Stencil, download the apropiate version for your environment:


Then add the file com/kiz10/Kiz10API.??? to your flash project, and import the api class this way:

import com.kiz10.*;

If you are using the as2 version, add this line too:
var Kiz10API = new com.kiz10.Kiz10API();
And make sure this Kiz10API variable is visible all over your game.


INITIALIZE THE API


At the start of the game (tipically before entering main menu), use the next sentence, replacing the first argument with the identifier of your game, and the second one with your actual game's api-key:

Kiz10API.init(8378, "1bd294bef3403da33dddf4d7f88f1Xa1");

The api then starts loading. You can know when it's ready for use this way:


if (Kiz10API.apiLoaded) {
	// Use the api
}

Or, alternativelly, you can provide a callback function to the init method that will be called when the api is loaded (option not available on Unity/HTML5):

Kiz10API.init(8378, "bbd294bef3403daaedddf4d7f88f1ba1", onApiLoaded);
function onApiLoaded(response:Object):void {
	// The api is ready
}

Then go back to general instructions and continue with the implementation, to submit scores and unlock achievements.


<<-- Back to General Instructions