Package | net.user1.reactor.snapshot |
Class | public class ClientCountSnapshot |
Inheritance | ClientCountSnapshot ![]() ![]() |
Since : | Reactor 1.0.0 |
// Create the snapshot var snapshot:ClientCountSnapshot = new ClientCountSnapshot(); // Register a callback function snapshot.onLoad = function ():void { trace("There are " + snapshot.getCount() + " clients on the server."); } // Or register a listener function snapshot.addEventListener(SnapshotEvent.LOAD, loadListener); function loadListener (e:SnapshotEvent):void { var loadedSnapshot:ClientCountSnapshot = ClientCountSnapshot(e.target); trace("There are " + loadedSnapshot.getCount() + " clients on the server."); } // Load the client count by passing the snapshot object to // Reactor's updateSnapshot() method: reactor.updateSnapshot(snapshot);
See also
Method | Defined By | ||
---|---|---|---|
Constructor
| ClientCountSnapshot | ||
getCount():int
Returns the total number of clients on the server. | ClientCountSnapshot | ||
![]() | getStatus():String
Returns the status of the most recent snapshot load-operation. | Snapshot | |
![]() | updateInProgress():Boolean
Indicates whether the snapshot is currently loading data. | Snapshot |
ClientCountSnapshot | () | Constructor |
public function ClientCountSnapshot()
Constructor
getCount | () | method |
public function getCount():int
Since : | Reactor 1.0.0 |
Returns the total number of clients on the server. To refresh the count, pass this ClientCountSnapshot object to Reactor's updateSnapshot() method.
Returnsint |
See also