| Package | Andrograde |
| Class | public final class APIClient |
| Inheritance | APIClient flash.display.Sprite |
| Implements | API |
| Property | Defined by | ||
|---|---|---|---|
| debugDisplay : TextField [read-only]
Gets a display object that shows the Andrograde API log for non debug build testing
| APIClient | ||
| game : String [read-only]
returns the game code for this game
| APIClient | ||
| ip : String [read-only]
returns the IP of the user playing the game
| APIClient | ||
| live : Boolean [read-only]
returns whether the game is live or not
| APIClient | ||
| parameters_server : Object [read-only]
Returns all of the server variables for the game as an Object with all the parameters as member variables (like URLVariables)
| APIClient | ||
| parameters_url : Object [read-only]
Returns all of the url parameters to the swf as an Object with all the parameters as member variables (like URLVariables)
| APIClient | ||
| plays : uint [read-only]
Returns how many global plays this game has had
| APIClient | ||
| points_per_dollar : uint [read-only]
returns how many Andrograde points there is in a dollar
| APIClient | ||
| title : String [read-only]
Returns the title of the game
| APIClient | ||
| UI : UI
[read-only]
return the Andrograde UI object so you can draw all sorts of cool stuff
| APIClient | ||
| user : User
[read-only]
Gets the current user if there is one logged in, null if not logged in
| APIClient | ||
| valid : Boolean [read-only]
returns whether this is a valid Andrograde Session
| APIClient | ||
| Method | Defined by | ||
|---|---|---|---|
|
APIClient(game:String, callback:Function = null, debug:Boolean = false)
Initializes the Andrograde API
calls 'callback(success:Boolean):void' when done
| APIClient | ||
|
buy(cost:uint, item:String, image:DisplayObject = null, callback:Function = null, container:DisplayObjectContainer = null, x:int = -1, y:int = -1):void
Shows a dialog allowing the user to buy a game item
calls 'callback(success:Boolean):void' when it's done
| APIClient | ||
|
buypoints(callback:Function = null, container:DisplayObjectContainer = null, x:int = -1, y:int = -1):void
Shows a dialog allowing the user to buy/get andrograde points
calls 'callback():void' when it's done
| APIClient | ||
|
getHighScores(stat:String, type:uint, startingOffset:uint, howMany:uint, callback:Function):void
Fetches a list of highscores of a certain stat from the server
calls 'callback(highscores:Array):void' when it's done where result is a 2d array of name/value pairs
| APIClient | ||
|
getIdentity(name:String, callback:Function):void
Resolves a name to all matching identities in the system
calls 'callback(identities:Array):void' (identities=null if failed)
| APIClient | ||
|
getUserInfo(identity:String, callback:Function = null):void
gets the stats from the server for any user
calls 'callback(user:User):void' user= null if failed | APIClient | ||
|
login(callback:Function = null, container:DisplayObjectContainer = null, x:int = -1, y:int = -1):void
Shows a dialog allowing a user to login to their Andrograde account
calls 'callback(success:Boolean):void' when it's done
| APIClient | ||
|
logout(callback:Function = null):void
logs a user out
calls 'callback(success:Boolean):void' when done
| APIClient | ||
|
parameters_server_sync(callback:Function = null):void
synchronizes the server parameters with the server
| APIClient | ||
| Constant | Defined by | ||
|---|---|---|---|
| HIGHSCORE_HIGHEST : uint = 0 [static]
use this in getHighScores to fetch the highest scores
| APIClient | ||
| HIGHSCORE_LOWEST : uint = 1 [static]
use this in getHighScores to fetch the lowest scores
| APIClient | ||
| debugDisplay | property |
debugDisplay:TextField [read-only]Gets a display object that shows the Andrograde API log for non debug build testing
Implementation public function get debugDisplay():TextField
| game | property |
game:String [read-only]returns the game code for this game
Implementation public function get game():String
| ip | property |
ip:String [read-only]returns the IP of the user playing the game
Implementation public function get ip():String
| live | property |
live:Boolean [read-only]returns whether the game is live or not
Implementation public function get live():Boolean
| parameters_server | property |
parameters_server:Object [read-only]Returns all of the server variables for the game as an Object with all the parameters as member variables (like URLVariables)
Implementation public function get parameters_server():Object
| parameters_url | property |
parameters_url:Object [read-only]Returns all of the url parameters to the swf as an Object with all the parameters as member variables (like URLVariables)
Implementation public function get parameters_url():Object
| plays | property |
plays:uint [read-only]Returns how many global plays this game has had
Implementation public function get plays():uint
| points_per_dollar | property |
points_per_dollar:uint [read-only]returns how many Andrograde points there is in a dollar
Implementation public function get points_per_dollar():uint
| title | property |
title:String [read-only]Returns the title of the game
Implementation public function get title():String
| UI | property |
UI:UI [read-only]return the Andrograde UI object so you can draw all sorts of cool stuff
Implementation public function get UI():UI
See also
| user | property |
user:User [read-only]Gets the current user if there is one logged in, null if not logged in
Implementation public function get user():User
| valid | property |
valid:Boolean [read-only]returns whether this is a valid Andrograde Session
Implementation public function get valid():Boolean
| APIClient | () | constructor |
public function APIClient(game:String, callback:Function = null, debug:Boolean = false)Initializes the Andrograde API calls 'callback(success:Boolean):void' when done
Parametersgame:String — the game code given to you on the website for your game
|
|
callback:Function (default = null) — whether to run in debug mode or not
|
|
debug:Boolean (default = false) |
| buy | () | method |
public function buy(cost:uint, item:String, image:DisplayObject = null, callback:Function = null, container:DisplayObjectContainer = null, x:int = -1, y:int = -1):voidShows a dialog allowing the user to buy a game item calls 'callback(success:Boolean):void' when it's done
Parameterscost:uint — how many Andrograde points it costs
|
|
item:String — the name of the item
|
|
image:DisplayObject (default = null) — an image to use to display what the item looks like in the buy dialog
|
|
callback:Function (default = null) — the callback function to call when it's done
|
|
container:DisplayObjectContainer (default = null) — what to display the dialog ontop of (defaults to root)
|
|
x:int (default = -1) — the x position to place the window at (defaults to the middle of the stage)
|
|
y:int (default = -1) — the y position to place the window at (defaults to the middle of the stage)
|
| buypoints | () | method |
public function buypoints(callback:Function = null, container:DisplayObjectContainer = null, x:int = -1, y:int = -1):voidShows a dialog allowing the user to buy/get andrograde points calls 'callback():void' when it's done
Parameterscallback:Function (default = null) — the callback function to call when it's done
|
|
container:DisplayObjectContainer (default = null) — what to display the dialog ontop of (defaults to root)
|
|
x:int (default = -1) — the x position to place the window at (defaults to the middle of the stage)
|
|
y:int (default = -1) — the y position to place the window at (defaults to the middle of the stage)
|
| getHighScores | () | method |
public function getHighScores(stat:String, type:uint, startingOffset:uint, howMany:uint, callback:Function):voidFetches a list of highscores of a certain stat from the server calls 'callback(highscores:Array):void' when it's done where result is a 2d array of name/value pairs
Parametersstat:String — which stat to receive the list for
|
|
type:uint — either HIGHSCORE_HIGHEST or HIGHSCORE_LOWEST
|
|
startingOffset:uint — the starting offset to start getting scores from
|
|
howMany:uint — how many scores to get (this must be <= 100)
|
|
callback:Function |
See also
| getIdentity | () | method |
public function getIdentity(name:String, callback:Function):voidResolves a name to all matching identities in the system calls 'callback(identities:Array):void' (identities=null if failed)
Parametersname:String — the name of the person who you want the identity matches of
|
|
callback:Function |
| getUserInfo | () | method |
public function getUserInfo(identity:String, callback:Function = null):void
gets the stats from the server for any user
calls 'callback(user:User):void' user= null if failed
identity:String — the user's identity (user.identity)
|
|
callback:Function (default = null) |
See also
| login | () | method |
public function login(callback:Function = null, container:DisplayObjectContainer = null, x:int = -1, y:int = -1):voidShows a dialog allowing a user to login to their Andrograde account calls 'callback(success:Boolean):void' when it's done
Parameterscallback:Function (default = null) — what function to call when the login succeeds/fails
|
|
container:DisplayObjectContainer (default = null) — what to display the login box ontop of (defaults to root)
|
|
x:int (default = -1) — the x position to place the login window at (defaults to the middle of the stage)
|
|
y:int (default = -1) — the y position to place the login window at (defaults to the middle of the stage)
|
| logout | () | method |
public function logout(callback:Function = null):voidlogs a user out calls 'callback(success:Boolean):void' when done
Parameterscallback:Function (default = null) |
| parameters_server_sync | () | method |
public function parameters_server_sync(callback:Function = null):voidsynchronizes the server parameters with the server
Parameterscallback:Function (default = null) |
| HIGHSCORE_HIGHEST | constant |
public static const HIGHSCORE_HIGHEST:uint = 0use this in getHighScores to fetch the highest scores
| HIGHSCORE_LOWEST | constant |
public static const HIGHSCORE_LOWEST:uint = 1use this in getHighScores to fetch the lowest scores