AS3 GamesChart API Implementation - Flash Develop

Implement the API using flash Develop by following 8 simple steps: {|

Step 1 - Download the 'GamesChart Developer Pack'
This folder contains all the files you need in order to implement the GamesChart API. 

Step 2 - Open Main.as
Launch Flash Develop and open the ‘Main.as’ file of your game.



Step 3 - Add Classpath

 * 1) Select Project > Properties, then select the Classpaths tab.
 * 2) Click on Add Classpath and browse to the GamesChartAPI-AS3 folder (GamesChartDeveloperPack\GamesChart API\GamesChartAPI-AS3).
 * 3) Select the folder and click OK.
 * 4) Click OK to close the Project Properties window.



Step 4 - Add 'GamesChartAPI-AS3' to library

 * 1) Left click the GamesChartAPI-AS3 node in the Project panel to view contents.
 * 2) Right click the GamesChartAPI-AS3.swc and select Add To Library.
 * 3) The GamesChart API is now added to your project.



Step 5 - Get your Unique Game ID
To get a Unique Game ID you must create an instance of the game on GamesChart.com.

Go to your Developer Console and select Add Game, then enter your game name and select Create.



Step 6 - Call the GamesChart 'setup' function
For the GamesChart API to work you must call the static GamesChart function: setup.

This function should be run at the very start of your game.

Insert your Unique Game ID into the setup function.

Example Setup Function GamesChart.setup(Stage,”bc055fe4f21c9617e6463b7c0ecc7101”);

Step 7 - Publish .swf
Now publish your game..

You should ensure in Project Properties (Project > Properties) that you select Flash Player version 8 or higher.

The GamesChart tab will automatically display in the top right hand corner of your game.

You can adjust the tab position by adding the following static function. Replace x and y with the desired tab co-ordinates. GamesChart.showTab(x, y);



Step 8 - Upload Game
Return to the GamesChart website to complete the Upload Game procedure.

The Upload Game pages will provide information on how to complete this process.

The implementation is now complete!

If you are getting error messages then refer to the Error Messages section below.

See the Learn More section below for information on customizing the behaviour of the API.

Error Messages
AS3 Error Messages include:


 * noInterface:"[GC-API] ERROR! Please call gc.setup first." More Info


 * alreadyDefinedInterface:"[GC-API] ERROR! Can only call setup once!" More Info


 * noContainerMC:"[GC-API] ERROR! You must supply the stage and it must not be null!" More Info


 * noGameIDHash:"[GC-API] ERROR! You must supply the game ID key associated with this game!" More Info



Learn More!
GamesChart static functions can be used to control the behaviour of the API.

For example, you can:


 * Hide the GamesChart button when required


 * Display the GamesChart button when required


 * Adjust the position of the GamesChart button


 * Open the GamesChart window on an event

Tell me more about Static Functions


 * }