Package | net.user1.reactor.snapshot |
Class | public class RoomSnapshot |
Inheritance | RoomSnapshot ![]() ![]() |
Since : | Reactor 1.0.0 |
// Create the snapshot var snapshot:RoomSnapshot = new RoomSnapshot("examples.chat"); // Register a callback function snapshot.onLoad = function ():void { // Display a list of clients in the room trace("Occupants: " + snapshot.getOccupants()); } // Or register a listener function snapshot.addEventListener(SnapshotEvent.LOAD, loadListener); function loadListener (e:SnapshotEvent):void { // Display a list of clients in the room trace("Occupants: " + RoomSnapshot(e.target).getOccupants()); } // Load the room's data by passing the snapshot object to // Reactor's updateSnapshot() method: reactor.updateSnapshot(snapshot);
The RoomSnapshot object is not kept up to date after it is loaded. To update a RoomSnapshot object to match latest the state of the server, pass that object to Reactor's updateSnapshot() method.
See also
Method | Defined By | ||
---|---|---|---|
RoomSnapshot(roomID:String, password:String = null, updateLevels:UpdateLevels = null)
Constructor
| RoomSnapshot | ||
getAttribute(name:String):String
Returns the value of the specified room attribute. | RoomSnapshot | ||
getAttributes():Object
Returns an object whose variables represent the names and values of the
shared attributes for this snapshot's room. | RoomSnapshot | ||
getNumObservers():int
Returns the number of observers in the room represented by this snapshot. | RoomSnapshot | ||
getNumOccupants():int
Returns the number of occupants in the room represented by this snapshot. | RoomSnapshot | ||
getObserver(clientID:String):ClientManifest
Returns a ClientManifest object representing the room observer specified
by clientID. | RoomSnapshot | ||
getObservers():Array
Returns a list of the clients observing the room represented by this
snapshot. | RoomSnapshot | ||
getOccupant(clientID:String):ClientManifest
Returns a ClientManifest object representing the room occupant specified
by clientID. | RoomSnapshot | ||
getOccupants():Array
Returns a list of the clients in the room represented by this snapshot. | RoomSnapshot | ||
getRoomID():String
Returns the fully qualified roomID for this room snapshot object. | RoomSnapshot | ||
![]() | getStatus():String
Returns the status of the most recent snapshot load-operation. | Snapshot | |
![]() | updateInProgress():Boolean
Indicates whether the snapshot is currently loading data. | Snapshot |
RoomSnapshot | () | Constructor |
public function RoomSnapshot(roomID:String, password:String = null, updateLevels:UpdateLevels = null)
Constructor
ParametersroomID:String | |
password:String (default = null )
| |
updateLevels:UpdateLevels (default = null )
|
See also
getAttribute | () | method |
public function getAttribute(name:String):String
Since : | Reactor 1.0.0 |
Returns the value of the specified room attribute.
Parameters
name:String — The attribute's name.
|
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 room. For details and examples, see the Room class's getAttributes() method, which returns an object of the same format.
ReturnsObject |
See also
getNumObservers | () | method |
public function getNumObservers():int
Since : | Reactor 1.0.0 |
Returns the number of observers in the room represented by this snapshot.
Returnsint |
getNumOccupants | () | method |
public function getNumOccupants():int
Since : | Reactor 1.0.0 |
Returns the number of occupants in the room represented by this snapshot.
Returnsint |
getObserver | () | method |
public function getObserver(clientID:String):ClientManifest
Since : | Reactor 1.0.0 |
Returns a ClientManifest object representing the room observer specified by clientID.
Parameters
clientID:String |
ClientManifest |
See also
getObservers | () | method |
public function getObservers():Array
Since : | Reactor 1.0.0 |
Returns a list of the clients observing the room represented by this snapshot. Each item in the list is a string clientID.
ReturnsArray |
getOccupant | () | method |
public function getOccupant(clientID:String):ClientManifest
Since : | Reactor 1.0.0 |
Returns a ClientManifest object representing the room occupant specified by clientID.
Parameters
clientID:String |
ClientManifest |
See also
getOccupants | () | method |
public function getOccupants():Array
Since : | Reactor 1.0.0 |
Returns a list of the clients in the room represented by this snapshot. Each item in the list is a string clientID.
ReturnsArray |
getRoomID | () | method |
public function getRoomID():String
Since : | Reactor 1.0.0 |
Returns the fully qualified roomID for this room snapshot object.
ReturnsString — A string roomID.
|
See also