Player.IO

Build fun, powerful & scalable online and mobile games with the reliable backend your users expect

Sign Up | Sign In

ActionScript3 Reference

actionscript 3 QuickConnect class informationClass QuickConnect

Namespace: playerio
Language: ActionScript 3

Used to authenticate users towards 3rd party user bases. This class must be accessed via PlayerIO.quickConnect

Methods

 
public
facebookConnect (stage:flash.display:Stage, gameId:String, uid:String, sessionKey:String, partnerId:String, callback:Function = null, errorHandler:Function = null):void

Authenticate a user towards Facebook

public
facebookConnectPopup (stage:flash.display:Stage, gameId:String, window:String, permissions:Array, partnerId:String, callback:Function = null, errorHandler:Function = null):void

Connects the user to Player.IO via Facebook, by opening a Facebook login window where the user can enter his Facebook credentials to login to your game.

public
facebookOAuthConnect (stage:flash.display:Stage, gameId:String, accessToken:String, partnerId:String, callback:Function = null, errorHandler:Function = null):void

public
facebookOAuthConnectPopup (stage:flash.display:Stage, gameId:String, window:String, permissions:Array, partnerId:String, callback:Function = null, errorHandler:Function = null):void

public
kongregateConnect (stage:flash.display:Stage, gameid:String, userid:String, gameauthtoken:String, callback:Function = null, errorhandler:Function = null):void

Authenticate a user towards Kongreate

public
simpleConnect (stage:flash.display:Stage, gameid:String, usernameOrEmail:String, password:String, callback:Function = null, errorhandler:Function = null):void

Authenticate a user towards the Player.IO simple user database

public
simpleGetCaptcha (gameId:String, width:int, height:int, callback:Function = null, errorHandler:Function = null):void

public
simpleRecoverPassword (gameId:String, usernameOrEmail:String, callback:Function = null, errorHandler:Function = null):void

Sends an recover password email to a user stored using the Player.IO simple user database.

public
simpleRegister (stage:flash.display:Stage, gameid:String, username:String, password:String, email:String, captchaKey:String, captchaValue:String, extraData:Object = null, partnerId:String, callback:Function = null, errorhandler:Function = null):void

Creates a user in the Player.IO simple user database

facebookConnect

Authenticate a user towards Facebook

Arguments

flash.display:Stage stage
A reference to the base stage of your project.
String gameId
Unique ID that identifies which game the client will try to connect to
String uid
Faceboook userid of the user you wish to authenticate.
String sessionKey
Session key of the user you wish to authenticate
String partnerId
String that identifies a possible affiliate partner.
Function callback
Function executed on successful connect: function(client:Client):void{...}
Function errorHandler
Function executed if the request failed: function(error:PlayerIOError):void{...}

facebookConnectPopup

Connects the user to Player.IO via Facebook, by opening a Facebook login window where the user can enter his Facebook credentials to login to your game.

Arguments

flash.display:Stage stage
A reference to the base stage of your project.
String gameId
Unique ID that identifies which game the client will try to connect to
String window
The browser window or HTML frame in which to display the document indicated by the request parameter. You can enter the name of a specific window or use one of the following values: _self, _blank, _parent, _top
Array permissions
What extended facebook permissions do you want access to? see: http://developers.facebook.com/docs/authentication/permissions for more info
String partnerId
String that identifies a possible affiliate partner.
Function callback
Function executed on successful connect: function(client:Client, api_key:String, uid:String, session_key:String, secret:String):void{...}
Function errorHandler
Function executed if the request failed: function(error:PlayerIOError):void{...}

facebookOAuthConnect

Arguments

flash.display:Stage stage
A reference to the base stage of your project.
String gameId
Unique ID that identifies which game the client will try to connect to
String accessToken
Facebook OAuth access token
String partnerId
Function callback
Function executed on successful connect: function(client:Client, facebookuserid:String):void{...}
Function errorHandler
Function executed if the request failed: function(error:PlayerIOError):void{...}

facebookOAuthConnectPopup

Arguments

flash.display:Stage stage
A reference to the base stage of your project.
String gameId
Unique ID that identifies which game the client will try to connect to
String window
The browser window or HTML frame in which to display the document indicated by the request parameter. You can enter the name of a specific window or use one of the following values: _self, _blank, _parent, _top
Array permissions
What extended facebook permissions do you want access to? see: http://developers.facebook.com/docs/authentication/permissions for more info
String partnerId
String that identifies a possible affiliate partner.
Function callback
Function executed on successful connect: function(client:Client, access_token:String, facebookuserid:String):void{...}
Function errorHandler
Function executed if the request failed: function(error:PlayerIOError):void{...}

Example

Using facebookOAuthConnectPopup to connect to Player.IO

kongregateConnect

Authenticate a user towards Kongreate

Arguments

flash.display:Stage stage
A reference to the base stage of your project.
String gameid
Unique ID that identifies which game the client will try to connect to
String userid
Kongregate userid
String gameauthtoken
Kongreate gameauthtoken
Function callback
Function executed on successful connect: function(client:Client):void{...}
Function errorhandler
Function executed if the request failed: function(error:PlayerIOError):void{...}

simpleConnect

Authenticate a user towards the Player.IO simple user database

Arguments

flash.display:Stage stage
A reference to the base stage of your project.
String gameid
Unique ID that identifies which game the client will try to connect to
String usernameOrEmail
Username or email of the user you wish to authenticate
String password
Password of the user you wish to authenticate
Function callback
Function executed on successful connect: function(client:Client):void{...}
Function errorhandler
Function executed if the request failed: function(error:PlayerIOError):void{...}

Example

Example of how to connect to Player.IO using simpleConnect

simpleGetCaptcha

Arguments

String gameId
Unique ID that identifies which game the client will try to connect to
int width
the width of the generated CAPTCHA
int height
the height of the generated CAPTCHA
Function callback
Function executed when a CAPTCHA has been successfully generated: function(captchaKey:String, captchaImageUrl:String):void{...}
Function errorHandler
Function executed if the request failed: function(error:PlayerIORegistrationError):void{...}

simpleRecoverPassword

Sends an recover password email to a user stored using the Player.IO simple user database.

Arguments

String gameId
Unique ID that identifies which game the client will try to connect to
String usernameOrEmail
Username or email of the user that wishes to recover their passsword
Function callback
Function executed on successful sending of recover email: function():void{...}
Function errorHandler
Function executed if the request failed: function(error:PlayerIOError):void{...}

simpleRegister

Creates a user in the Player.IO simple user database

Arguments

flash.display:Stage stage
A reference to the base stage of your project.
String gameid
Unique ID that identifies which game the client will try to connect to
String username
Username of the user you wish to create
String password
Password of the user you wish to create
String email
Email of the user you wish to create (This field can be optional)(
String captchaKey
Used if CAPTCHA is enabled. This value is the key returned from simpleGetCaptcha
String captchaValue
Used if CAPTCHA is enabled. Should be what the users sees on the CAPTCHA image.
Object extraData
Extra data attached to the user on creation
String partnerId
String that identifies a possible affiliate partner.
Function callback
Function executed on successful connect: function(client:Client):void{...}
Function errorhandler
Function executed if the request failed: function(error:PlayerIORegistrationError):void{...}