Package | net.user1.reactor.snapshot |
Class | public class ClientSnapshot |
Inheritance | ClientSnapshot ![]() ![]() |
Since : | Reactor 1.0.0 |
// Create the snapshot var snapshot:ClientSnapshot = new ClientSnapshot("1"); // Register a callback function snapshot.onLoad = function ():void { // Display the list of rooms the client is in trace(snapshot.getOccupiedRoomIDs()); } // Or register a listener function snapshot.addEventListener(SnapshotEvent.LOAD, loadListener); function loadListener (e:SnapshotEvent):void { // Display the list of rooms the client is in trace(ClientSnapshot(e.target).getOccupiedRoomIDs()); } // Register a listener function for status updates snapshot.addEventListener(SnapshotEvent.STATUS, statusListener); function statusListener (e:SnapshotEvent):void { trace("Client snapshot load status: " + ClientSnapshot(e.target).getStatus()); } // Load the client's data by passing the snapshot object to // Reactor's updateSnapshot() method: reactor.updateSnapshot(snapshot);
See also
Method | Defined By | ||
---|---|---|---|
ClientSnapshot(clientID:String) | ClientSnapshot | ||
getAttribute(name:String, scope:String = null):String
Returns the value of the specified client attribute. | ClientSnapshot | ||
getAttributes():Object
Returns an object whose variables represent the names and values of the
shared attributes for this snapshot's client. | ClientSnapshot | ||
getClientID():String
Returns the clientID for this client snapshot object. | ClientSnapshot | ||
getObservedRoomIDs():Array
Returns a list of the rooms observed by the client represented by this
snapshot. | ClientSnapshot | ||
getOccupiedRoomIDs():Array
Returns a list of the rooms containing the client represented by this
snapshot. | ClientSnapshot | ||
![]() | getStatus():String
Returns the status of the most recent snapshot load-operation. | Snapshot | |
getUserID():String
If the client represented by this snapshot object is logged in under
a user account, getUserID() returns that account; otherwise, getUserID()
returns null. | ClientSnapshot | ||
![]() | updateInProgress():Boolean
Indicates whether the snapshot is currently loading data. | Snapshot |
ClientSnapshot | () | Constructor |
public function ClientSnapshot(clientID:String)
clientID:String |
getAttribute | () | method |
public function getAttribute(name:String, scope:String = null):String
Since : | Reactor 1.0.0 |
Returns the value of the specified client attribute.
Parameters
name:String — The attribute's name.
| |
scope:String (default = null ) — The attribute's scope. For global client 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 client. 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
getClientID | () | method |
public function getClientID():String
Since : | Reactor 1.0.0 |
Returns the clientID for this client snapshot object.
ReturnsString — A string clientID.
|
See also
getObservedRoomIDs | () | method |
public function getObservedRoomIDs():Array
Since : | Reactor 1.0.0 |
Returns a list of the rooms observed by the client represented by this snapshot. Each item in the list a fully qualified string roomID.
ReturnsArray |
getOccupiedRoomIDs | () | method |
public function getOccupiedRoomIDs():Array
Since : | Reactor 1.0.0 |
Returns a list of the rooms containing the client represented by this snapshot. Each item in the list a fully qualified string roomID.
ReturnsArray |
getUserID | () | method |
public function getUserID():String
Since : | Reactor 1.0.0 |
If the client represented by this snapshot object is logged in under a user account, getUserID() returns that account; otherwise, getUserID() returns null.
ReturnsString — A string userID.
|
See also