PlayerIO

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

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:* = null, playerInsightSegments:* = null, callback:* = null, errorHandler:* = null):void

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

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

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

public
kongregateConnect (stage:flash.display:Stage, gameId:String, userId:String, gameAuthToken:String, playerInsightSegments:* = null, callback:* = null, errorHandler:* = null):void

Authenticate a user towards Kongreate

public
simpleConnect (stage:flash.display:Stage, gameId:String, usernameOrEmail:String, password:String, playerInsightSegments:* = null, callback:* = null, errorHandler:* = 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, usernameOrEmail:String, password:String, email:String, captchaKey:String, captchaValue:String, extraData:Object, partnerId:* = null, playerInsightSegments:* = null, callback:* = null, errorHandler:* = 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:* = null, playerInsightSegments:* = null, callback:* = null, errorHandler:* = null):void

Arguments

stage:flash.display:Stage
gameId:String
uid:String
sessionKey:String
partnerid:* (Default = null)
playerInsightSegments:* (Default = null)
callback:* (Default = null)
errorHandler:* (Default = null)

QuickConnect.facebookConnectPopup

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

Arguments

stage:flash.display:Stage
gameId:String
window:String
permissions:Array (Default = null)
partnerId:* (Default = null)
callback:* (Default = null)
errorHandler:* (Default = null)

QuickConnect.facebookOAuthConnect

public
facebookOAuthConnect (stage:flash.display:Stage, gameId:String, accessToken:String, partnerId:* = null, playerInsightSegments:* = null, callback:* = null, errorHandler:* = 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:* (Default = null)
playerInsightSegments:* (Default = null)
callback:* (Default = null)
Function executed on successful connect: function(client:Client, facebookuserid:String):void{...}
errorHandler:* (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 = null, partnerId:* = null, playerInsightSegments:* = null, callback:* = null, errorHandler:* = 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 (Default = null)
What extended facebook permissions do you want access to? see: http://developers.facebook.com/docs/authentication/permissions for more info
partnerId:* (Default = null)
String that identifies a possible affiliate partner.
playerInsightSegments:* (Default = null)
callback:* (Default = null)
Function executed on successful connect: function(client:Client, access_token:String, facebookuserid:String):void{...}
errorHandler:* (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, playerInsightSegments:* = null, callback:* = null, errorHandler:* = null):void

Authenticate a user towards Kongreate

Arguments

stage:flash.display:Stage
A reference to the base stage of your project.
gameId:String
userId:String
gameAuthToken:String
playerInsightSegments:* (Default = null)
callback:* (Default = null)
Function executed on successful connect: function(client:Client):void{...}
errorHandler:* (Default = null)

QuickConnect.simpleConnect

public
simpleConnect (stage:flash.display:Stage, gameId:String, usernameOrEmail:String, password:String, playerInsightSegments:* = null, callback:* = null, errorHandler:* = 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.
playerInsightSegments:* (Default = null)
segments for the user in PlayerInsight.
callback:* (Default = null)
Function executed on successful connect: function(client:Client):void{...}
errorHandler:* (Default = null)

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, usernameOrEmail:String, password:String, email:String, captchaKey:String, captchaValue:String, extraData:Object, partnerId:* = null, playerInsightSegments:* = null, callback:* = null, errorHandler:* = 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
usernameOrEmail:String
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
Extra data attached to the user on creation
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)