FogDevAPI v2.1 is now live. Please try out the new features we have to offer. Download Now!

FogDev API v2.1

Instructions for Flash CS4+ AND Flash Develop NEW

  1. Open Up the provided .zip file
  2. Open the "Source" folder and copy the "fog" folder into the same directory as your game (or shared library path)
  3. Insert the following code into the first frame of your game. You may need to crate a new blank frame at the start of the game for this
    	import fog.as3.FogDevAPI;
    	var FogAPI:FogDevAPI = new FogDevAPI( { id:'YOUR_ID_HERE', root:root } );
    	FogAPI.Preloader.Start();
    
  4. Replace YOUR_ID_HERE with the ID provided by the FogDev Team. If you don't, your game will run in Demo Game mode, or Site Lock mode if no ID.
  5. - If your game is a site lock, do not specify the ID parameter
  6. Optional: You can pass a function as the first parameter to Preloader.Start to execute when the Preloader is finished
  7. Optional: Add FogAPI.SiteLock(); before starting the preloader if your game is a site lock.
  8. Compile your Game, if done correctly, everything should work

API Methods

PLEASE NOTE: Use the methods below as FogAPI.method (e.g. FogAPI.LibraryCall('SuggestedGamesClip', {}));

Method Description
SiteLock()
This method will lock the game to Free Online Games only
isFogDomain()
This function will return true if the game is being played on a Free Online Games domain, otherwise false.
LibraryCall('SuggestedGamesClip', options:Object)
@options Object containing settings for displaying suggested games, including position and simple control over color scheme
 position Controls the position, variables 'top' or 'bottom'
 bar_color Controls the background color (uint)
 text_color Controls the text color (uint)
 line_color Controls the line color (uint)
Returns
MovieClip
LibraryCall('ScoresUpdate', options:Object)
@options Object containing the users score
Tracking.GotoURL(url:String)
@url Full absolute url where you wish to send the player. Must include protocol
Preloader.SetBackground(movie:MovieClip)
This will set the preloader background to the MovieClip that you specify
Preloader.SetBackgroundColor(color:uint)
This will set the preloader background color to the a solid color that you specify
Assets.MiniLogo()
This will return a MovieClip instance of our minilogo

API Constants

PLEASE NOTE: Use the constants below as FogAPI.constant

Constant Description
Tracking.HomeURL
Link: Sends user to Free Online Games Homepage
Tracking.WalkthroughURL
Link: Sends user to the walkthrough for the current game, if one exists
Tracking.TagURL
Link: Sends user to the game tag page to play more related games
Tracking.TagURL
Link: Sends user to the game tag page to play more related games
Tracking.DevURL
Link: Sends user to FogDev Homepage
Tracking.FGFYWURL
Link: Sends user to Free Games for your Website Homepage

If you would like early access to our FogSocial API please contact a member for the fogdev team for a Beta version of our API.