PlayerIO

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

ActionScript3 Reference

actionscript 3 PlayerInsight class informationClass PlayerInsight

Namespace: playerio
Language: ActionScript 3

Provides access to the PlayerInsight services provided by Player.IO.

Properties

 
public
playersOnline :int [read-only]

Exposes how many unique users are currently online, as counted by PlayerInsight

Methods

 
public
getSegment (segmentGroup:String):String

Get the value of a specific PlayerInsight segment

public
refresh (callback:Function = null, errorHandler:Function = null):void

Refreshes PlayerInsight, including online and segments

public
setSegments (segments:Array, callback:Function = null, errorHandler:Function = null):void

Set segments for the current user

public
trackEvents (events:Array, callback:Function = null, errorHandler:Function = null):void

Track custom events.

public
trackExternalPayment (currency:String, amount:int, callback:Function = null, errorHandler:Function = null):void

Track payments from external payment sources.

public
trackInvitedBy (invitingUserId:String, invitationChannel:String, callback:Function = null, errorHandler:Function = null):void

Track invitation and social retention relations. Should be called when a user replies on an asynchronous action initialized by another user.

PlayerInsight.playersOnline

public
playersOnline :int [read-only]

Exposes how many unique users are currently online, as counted by PlayerInsight

PlayerInsight.getSegment

public
getSegment (segmentGroup:String):String

Get the value of a specific PlayerInsight segment

Arguments

segmentGroup:String
Segment to read.

PlayerInsight.refresh

public
refresh (callback:Function = null, errorHandler:Function = null):void

Refreshes PlayerInsight, including online and segments

Arguments

callback:Function (Default = null)
method called when PlayerInsight has successfully refreshed
errorHandler:Function (Default = null)
method called if refreshing PlayerInsight resulted in an error

PlayerInsight.setSegments

public
setSegments (segments:Array, callback:Function = null, errorHandler:Function = null):void

Set segments for the current user

Arguments

segments:Array
Array of PlayerInsight segments formated as ["segment1:value", "segment2:value"] where both segment name and value is optional.
callback:Function (Default = null)
Method called when the segments have been successfully set.
errorHandler:Function (Default = null)
method called if setting segment failed.

PlayerInsight.trackEvents

public
trackEvents (events:Array, callback:Function = null, errorHandler:Function = null):void

Track custom events.

Arguments

events:Array
events to track, passed as an alternating array of event type and value. E.g. if the user reached level 1 and bought 3 upgrades the array would look as follows: ["level1", 1, "buy_upgrade",3]
callback:Function (Default = null)
Method called when the event has been successfully tracked.
errorHandler:Function (Default = null)
Method called if tracking the event failed.

PlayerInsight.trackExternalPayment

public
trackExternalPayment (currency:String, amount:int, callback:Function = null, errorHandler:Function = null):void

Track payments from external payment sources.

Arguments

currency:String
Name of currency, E.g. "USD", "FBC", etc.
amount:int
Amount of currency purcached.
callback:Function (Default = null)
Method called when the external payment has been successfully tracked
errorHandler:Function (Default = null)
Method called if the external payment failed.

PlayerInsight.trackInvitedBy

public
trackInvitedBy (invitingUserId:String, invitationChannel:String, callback:Function = null, errorHandler:Function = null):void

Track invitation and social retention relations. Should be called when a user replies on an asynchronous action initialized by another user.

Arguments

invitingUserId:String
The user which created the action we are responding to.
invitationChannel:String
Optional channel description, E.g. "facebook_feed"
callback:Function (Default = null)
Method called when the action has been successfully tracked.
errorHandler:Function (Default = null)
Method called if tracking the event failed.