Package | net.user1.reactor.snapshot |
Class | public class AccountSnapshot |
Inheritance | AccountSnapshot ![]() ![]() |
Since : | Reactor 1.0.0 |
// Create the snapshot var snapshot:AccountSnapshot = new AccountSnapshot("Bob"); // Register a callback function snapshot.onLoad = function ():void { // Display the user's global "highScore" attribute trace(snapshot.getAttribute("highScore")); } // Or register a listener function snapshot.addEventListener(SnapshotEvent.LOAD, loadListener); function loadListener (e:SnapshotEvent):void { // Display the user's global "highScore" attribute trace(snapshot.getAttribute("highScore")); } // Load the account's data by passing the snapshot object to // Reactor's updateSnapshot() method: reactor.updateSnapshot(snapshot);
See also
Method | Defined By | ||
---|---|---|---|
AccountSnapshot(userID:String) | AccountSnapshot | ||
getAttribute(name:String, scope:String = null):String
Returns the value of the specified account attribute. | AccountSnapshot | ||
getAttributes():Object
Returns an object whose variables represent the names and values of the
shared attributes for this snapshot's account. | AccountSnapshot | ||
![]() | getStatus():String
Returns the status of the most recent snapshot load-operation. | Snapshot | |
getUserID():String
Returns the userID for this user account snapshot object. | AccountSnapshot | ||
![]() | updateInProgress():Boolean
Indicates whether the snapshot is currently loading data. | Snapshot |
AccountSnapshot | () | Constructor |
public function AccountSnapshot(userID:String)
userID:String |
getAttribute | () | method |
public function getAttribute(name:String, scope:String = null):String
Since : | Reactor 1.0.0 |
Returns the value of the specified account attribute.
Parameters
name:String — The attribute's name.
| |
scope:String (default = null ) — The attribute's scope. For global account attributes, specify scope
null. For attributes scoped to a room, specify the room's id.
|
String — The attribute value.
|
See also
getAttributes | () | method |
public function getAttributes():Object
Since : | Reactor 1.0.0 |
Returns an object whose variables represent the names and values of the shared attributes for this snapshot's account. The object is a map of fully qualified attribute name/value pairs. For details and examples, see the Client class's getAttributes() method, which returns an object of the same format.
ReturnsObject |
See also
getUserID | () | method |
public function getUserID():String
Since : | Reactor 1.0.0 |
Returns the userID for this user account snapshot object.
ReturnsString — A string userID.
|
See also