With your ID in hands, get started right away:
- Download the Flash API. The latest version is available here.
- Unzip the archive and save the uncompressed files locally.
- Copy the code included in the src directory and paste it in your game’s root classpath. As an alternative, you can add theSpilGamesAPI-<API_ver_num>.swc file to your game’s library path.
- Implement the API using the game ID that is generated when you add your game project to your account on the developer portal.
- Connect to SpilGamesServices to access the API services and components. Depending on your game, you can implement the connection in either of the following ways:
- On the first frame of the timeline, or
- In your main game class constructor.
- Test the API functionality in the test tool. This is the approved testing environment for all API games.
During development and local testing of a game implementing the Flash API, make sure you pass a value of true for the debugMode parameter of the SpilGamesServices.getInstance().connect() method. debugMode is the third parameter of the SpilGamesServices.getInstance().connect() method. Its default value is false.
When you set debugMode to true, all communication attempts with SpilGamesServices are suppressed. All calls to external services like score submission, award submission, and so on, are suppressed.
Enable this flags while testing locally to avoid security sandbox errors related to the local filesystem attempting to access a hosted service. Alternatively, the game may be hosted on a local or public server and it can tested without changing this flag.
When you copy-paste these examples, make sure you replace the dummy data with actual, valid data.
Before we can start implementing the API please read this page carefully.
Generic implementation requirements:
- Branding Logo
- More Games Button
- Cross Promo Buttons
- In-Game Ads
- Highscores (only if your game supports this)
- Awards (only if your game supports this)
What is a branding logo?
A branding logo is a small image which to be included in various game screens. Typically a branding logo appears in a game menu. It reminds the user where he can play the game. Also it complements to the cross-promotion strategies. The overall effect is that games, including yours, will be played more often. Below you can see an example of branding applied in the menu of the game Snail Bob.
The More Games button is a clickable button that has an outgoing link to the branded site. It provides the user an option to find more of the type of games as he’s currently playing. Especially when other sites publish your game through our systems, we can guide them back to the original location of the content.
The Cross Promo Buttons are clickable buttons that can link to another sequence of the game or to one of the app stores. Using the Flash API cross promo buttons images and links can be retrieved. Please contact you account manager to setup cross promo buttons before implementation.
What are In-Game ads?
In-game ads are advertisements that will be shown to a user at logical break moments within the game, we will ensure that users aren’t exposed to too much advertising and get the most relevant advertisement. These advertisements can be either a display ad or a video advertisement.
Read more details about the requirements: Integration Requirement