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

QuickConnect.facebookConnect

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

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
uid:String
Faceboook userid of the user you wish to authenticate.
sessionKey:String
Session key of the user you wish to authenticate
partnerId:String
String that identifies a possible affiliate partner.
callback:Function (Default = null)
Function executed on successful connect: function(client:Client):void{...}
errorHandler:Function (Default = null)
Function executed if the request failed: function(error:PlayerIOError):void{...}

QuickConnect.facebookConnectPopup

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.

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
window:String
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
permissions:Array
What extended facebook permissions do you want access to? see: http://developers.facebook.com/docs/authentication/permissions for more info
partnerId:String
String that identifies a possible affiliate partner.
callback:Function (Default = null)
Function executed on successful connect: function(client:Client, api_key:String, uid:String, session_key:String, secret:String):void{...}
errorHandler:Function (Default = null)
Function executed if the request failed: function(error:PlayerIOError):void{...}

QuickConnect.facebookOAuthConnect

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

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
accessToken:String
Facebook OAuth access token
partnerId:String
callback:Function (Default = null)
Function executed on successful connect: function(client:Client, facebookuserid:String):void{...}
errorHandler:Function (Default = null)
Function executed if the request failed: function(error:PlayerIOError):void{...}

QuickConnect.facebookOAuthConnectPopup

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

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
window:String
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
permissions:Array
What extended facebook permissions do you want access to? see: http://developers.facebook.com/docs/authentication/permissions for more info
partnerId:String
String that identifies a possible affiliate partner.
callback:Function (Default = null)
Function executed on successful connect: function(client:Client, access_token:String, facebookuserid:String):void{...}
errorHandler:Function (Default = null)
Function executed if the request failed: function(error:PlayerIOError):void{...}

Example

Using facebookOAuthConnectPopup to connect to Player.IO

QuickConnect.kongregateConnect

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

Authenticate a user towards Kongreate

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
userid:String
Kongregate userid
gameauthtoken:String
Kongreate gameauthtoken
callback:Function (Default = null)
Function executed on successful connect: function(client:Client):void{...}
errorhandler:Function (Default = null)
Function executed if the request failed: function(error:PlayerIOError):void{...}

QuickConnect.simpleConnect

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

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
usernameOrEmail:String
Username or email of the user you wish to authenticate
password:String
Password of the user you wish to authenticate
callback:Function (Default = null)
Function executed on successful connect: function(client:Client):void{...}
errorhandler:Function (Default = null)
Function executed if the request failed: function(error:PlayerIOError):void{...}

Example

Example of how to connect to Player.IO using simpleConnect

QuickConnect.simpleGetCaptcha

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

Arguments

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

QuickConnect.simpleRecoverPassword

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.

Arguments

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

QuickConnect.simpleRegister

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

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
username:String
Username of the user you wish to create
password:String
Password of the user you wish to create
email:String
Email of the user you wish to create (This field can be optional)(
captchaKey:String
Used if CAPTCHA is enabled. This value is the key returned from simpleGetCaptcha
captchaValue:String
Used if CAPTCHA is enabled. Should be what the users sees on the CAPTCHA image.
extraData:Object (Default = null)
Extra data attached to the user on creation
partnerId:String
String that identifies a possible affiliate partner.
callback:Function (Default = null)
Function executed on successful connect: function(client:Client):void{...}
errorhandler:Function (Default = null)
Function executed if the request failed: function(error:PlayerIORegistrationError):void{...}