PlayerIO

The fastest way to build online games without breaking a sweat.

ActionScript3 Reference

actionscript 3 PlayerIO class informationClass PlayerIO

Namespace: playerio
Language: ActionScript 3

Entry class for the initial connection to PlayerIO.

Example

Here's how to authenticate using basic authentication and get a client object:

Properties

 
public static
quickConnect :playerio:QuickConnect [read-only]

Referance to a QuickConnect instance that allows you to easly connect with 3rd party user databases.

public static
useSecureApiRequests :Boolean

Methods

 
public static
authenticate (stage:flash.display:Stage, gameId:String, connectionId:String, authenticationArguments:Object, playerInsightSegments:* = null, callback:* = null, errorHandler:* = null):void

Authenticates and connects the game to the Player.IO webservices.

public static
connect (stage:flash.display:Stage, gameId:String, connectionId:String, userId:String, auth:String, partnerId:* = null, playerInsightSegments:* = null, callback:* = null, errorHandler:* = null):void

Authenticates and connects the game to the Player.IO webservices.

public static
gameFS (gameId:String):playerio:GameFS

Referance to a GameFS instance that allows you to access GameFS

PlayerIO.quickConnect

public static
quickConnect :playerio:QuickConnect [read-only]

Referance to a QuickConnect instance that allows you to easly connect with 3rd party user databases.

PlayerIO.useSecureApiRequests

public static
useSecureApiRequests :Boolean

PlayerIO.authenticate

public static
authenticate (stage:flash.display:Stage, gameId:String, connectionId:String, authenticationArguments:Object, playerInsightSegments:* = null, callback:* = null, errorHandler:* = null):void

Authenticates and connects the game to the Player.IO webservices.

Arguments

stage:flash.display:Stage
A reference to the base stage of your project.
gameId:String
Unique ID that identifies which game the client will try to connect to
connectionId:String
Id of the connection to use when connecting to the game. Usually this is "public" unless you've set up different connections in the Player.IO admin panel.
authenticationArguments:Object
A dictionary of arguments for the given connection.
playerInsightSegments:* (Default = null)
segments for the user in PlayerInsight.
callback:* (Default = null)
Function executed on successful connect: function(client:Client):void{...}
errorHandler:* (Default = null)

PlayerIO.connect

public static
connect (stage:flash.display:Stage, gameId:String, connectionId:String, userId:String, auth:String, partnerId:* = null, playerInsightSegments:* = null, callback:* = null, errorHandler:* = null):void

Authenticates and connects the game to the Player.IO webservices.

Arguments

stage:flash.display:Stage
A reference to the base stage of your project.
gameId:String
Unique ID that identifies which game the client will try to connect to
connectionId:String
Id of the connection to use when connecting to the game. Usually this is "public" unless you've set up different connections in the Player.IO admin panel.
userId:String
Unique identifier of the current user playing the game. This can be supplied by you, or a a third party. Example userids are Username, Facebook UserID, OpenID Url etc.
auth:String
User auth. Can be left blank if the connection identified by connectionid does not require authentication.
partnerId:* (Default = null)
String that identifies a possible affiliate partner.
playerInsightSegments:* (Default = null)
segments for the user in PlayerInsight.
callback:* (Default = null)
Function executed on successful connect: function(client:Client):void{...}
errorHandler:* (Default = null)

PlayerIO.gameFS

public static
gameFS (gameId:String):playerio:GameFS

Referance to a GameFS instance that allows you to access GameFS

Arguments

gameId:String
the GameID of your game.

Example

Example of how to request the file game.swf from your games GameFS via PlayerIO