| Package | Andrograde |
| Class | public class User |
| Inheritance | User flash.events.EventDispatcher |
See also
| Property | Defined by | ||
|---|---|---|---|
| experience : int [read-only]
returns how much Andrograde experience the user has
| User | ||
| identity : String [read-only]
returns the identity (user name + network) of this user
| User | ||
| level : int [read-only]
returns what level the user is on
| User | ||
| name : String [read-only]
returns the user name of this user
| User | ||
| points : int [read-only]
returns how many Andrograde points the user has
| User | ||
| premium : Boolean [read-only]
returns whether the user is a premium user or not, you can use this to give discounts to premium users
| User | ||
| Method | Defined by | ||
|---|---|---|---|
|
getRank(stat:String, type:uint, callback:Function):void
Gets the rank of this user in regards to a particular stat
Note: This is 1 based (1st, 2nd, 3rd ...) so you will need to subtract 1 to correlate it with the highscores array returned by API.getHighScores calls 'callback(ronk:uint):void' when it's done (rank = 0 if there is an error) | User | ||
|
getStat(statName:String):Object
Checks the value of a stat for this user
| User | ||
|
owns(item:String):Boolean
Checks if the user has bought this item
| User | ||
|
refresh(callback:Function = null):void
refreshes the player information from the server
calls 'callback(success:Boolean):void' when it's done
| User | ||
|
setStat(statName:String, value:Object, type:uint, callback:Function = null):void
sets a stat
calls 'callback(success:Boolean):void' when it's done
| User | ||
| Constant | Defined by | ||
|---|---|---|---|
| STAT_ADD : uint = 1 [static]
add this value to the old stat value
| User | ||
| STAT_MAX : uint = 3 [static]
sets the stat to the highest value of either the original stat or the new value
| User | ||
| STAT_MIN : uint = 4 [static]
sets the stat to the lowest value of either the original stat or the new value
| User | ||
| STAT_REPLACE : uint = 0 [static]
replace the stat that was there with the new one
| User | ||
| STAT_SUBTRACT : uint = 2 [static]
subtract this value from the old stat value
| User | ||
| experience | property |
experience:int [read-only]returns how much Andrograde experience the user has
Implementation public function get experience():int
| identity | property |
identity:String [read-only]returns the identity (user name + network) of this user
Implementation public function get identity():String
| level | property |
level:int [read-only]returns what level the user is on
Implementation public function get level():int
| name | property |
name:String [read-only]returns the user name of this user
Implementation public function get name():String
| points | property |
points:int [read-only]returns how many Andrograde points the user has
Implementation public function get points():int
| premium | property |
premium:Boolean [read-only]returns whether the user is a premium user or not, you can use this to give discounts to premium users
Implementation public function get premium():Boolean
| getRank | () | method |
public function getRank(stat:String, type:uint, callback:Function):void
Gets the rank of this user in regards to a particular stat
Note: This is 1 based (1st, 2nd, 3rd ...) so you will need to subtract 1 to correlate it with the highscores array returned by API.getHighScores
calls 'callback(ronk:uint):void' when it's done (rank = 0 if there is an error)
stat:String — which stat to get the rank of
|
|
type:uint — either HIGHSCORE_HIGHEST (from the top) or HIGHSCORE_LOWEST (from the bottom)
|
|
callback:Function |
See also
| getStat | () | method |
public function getStat(statName:String):ObjectChecks the value of a stat for this user
ParametersstatName:String — the name of the stat to check
|
Object — what the stat is currently set to
|
| owns | () | method |
public function owns(item:String):BooleanChecks if the user has bought this item
Parametersitem:String — the item to check
|
Boolean — true if the user has bought this item
|
| refresh | () | method |
public function refresh(callback:Function = null):voidrefreshes the player information from the server calls 'callback(success:Boolean):void' when it's done
Parameterscallback:Function (default = null) |
| setStat | () | method |
public function setStat(statName:String, value:Object, type:uint, callback:Function = null):voidsets a stat calls 'callback(success:Boolean):void' when it's done
ParametersstatName:String — the name of the stat to set
|
|
value:Object — what to set it to, can be any type
|
|
type:uint — how to handle comparing to the value that is already there for that stat
|
|
callback:Function (default = null) |
See also
| STAT_ADD | constant |
public static const STAT_ADD:uint = 1add this value to the old stat value
| STAT_MAX | constant |
public static const STAT_MAX:uint = 3sets the stat to the highest value of either the original stat or the new value
| STAT_MIN | constant |
public static const STAT_MIN:uint = 4sets the stat to the lowest value of either the original stat or the new value
| STAT_REPLACE | constant |
public static const STAT_REPLACE:uint = 0replace the stat that was there with the new one
| STAT_SUBTRACT | constant |
public static const STAT_SUBTRACT:uint = 2subtract this value from the old stat value