GODPAPER | All Packages | All Classes | Index | Frames No Frames |
PlayerIO

Package | playerio
Class | public final class PlayerIO
Inheritance | PlayerIO Object

API wrapper that is used to connect to the PlayerIO webservices

Public Properties

| Property | Defined By
--- | --- | ---
|  | quickConnect : QuickConnect [static] [read-only] Referance to a QuickConnect instance that allows you to easly connect with 3rd party user databases. | PlayerIO

Public Methods

| Method | Defined By
--- | --- | ---
|  | PlayerIO() You cannot create an instance of the PlayerIO class, all use happens via static methods. | PlayerIO
|  | connect(stage:Stage, gameid:String, connectionid:String, userid:String, auth:String, partnerId:String, callback:Function, errorhandler:Function = null):void [static] Authenticates and connects the game to the Player.IO webservices. | PlayerIO
|  | gameFS(gameId:String):GameFS [static] Referance to a GameFS instance that allows you to access GameFS | PlayerIO
|  | showLogo(stage:Stage, align:String):void [static] Gives you greater control over when and where the Player.IO logo is shown. | PlayerIO

Property Detail

quickConnect | property

`quickConnect:QuickConnect` [read-only]

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

Implementation
`public static function get quickConnect():QuickConnect`
Constructor Detail

PlayerIO | () | Constructor

`public function PlayerIO()`

You cannot create an instance of the PlayerIO class, all use happens via static methods.

Throws

| `Error` — You cannot create an instance of the PlayerIO class!

Method Detail

connect | () | method

`public static function connect(stage:Stage, gameid:String, connectionid:String, userid:String, auth:String, partnerId:String, callback:Function, errorhandler:Function = null):void`

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

Parameters

| `stage: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:String` — String that identifies a possible affiliate partner.
| `callback:Function` — Function executed on successful connect: function(client:Client):void{...}
| `errorhandler:Function` (default = `null`)`` — Function executed if the request failed: function(error:PlayerIOError):void{...}

See also

Client returned on successfull connect

gameFS | () | method |

`public static function gameFS(gameId:String):GameFS`

Referance to a GameFS instance that allows you to access GameFS

Parameters

| `gameId:String` — the GameID of your game.

Returns

| `GameFS` — An instance of GameFS

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

                 var url:String = PlayerIO.gameFS("game-id").getURL("game.swf")

showLogo | () | method |

`public static function showLogo(stage:Stage, align:String):void`

Gives you greater control over when and where the Player.IO logo is shown. If this method is called, the logo will not appear when you connect to player.io via playerio.connect nor via QuickConnect.

Parameters

| `stage:Stage` — A reference to the base stage of your project.
| `align:String` — Where should the logo appear. Valid values are TL, CL, BL, TC, CC, BC, TR, CR, BR. The first letter stands for vertical position Top, Center or Bottom. The second letter is for horizontal position Left, Center or Right.

Thu Jan 16 2014, 01:11 PM +08:00