Packagenet.user1.reactor.snapshot
Classpublic class ClientCountSnapshot
InheritanceClientCountSnapshot Inheritance Snapshot Inheritance flash.events.EventDispatcher

Since : Reactor 1.0.0

The ClientCountSnapshot class is used to retrieve the number of clients currently on the server. For example,
   // 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

SnapshotEvent
Snapshot
net.user1.reactor.Reactor.updateSnapshot()


Public Variables
 VariableDefined By
 InheritedonLoad : Function
A callback function to be invoked when this snapshot's data is loaded.
Snapshot
Public Methods
 MethodDefined By
  
Constructor
ClientCountSnapshot
  
getCount():int
Returns the total number of clients on the server.
ClientCountSnapshot
 Inherited
getStatus():String
Returns the status of the most recent snapshot load-operation.
Snapshot
 Inherited
Indicates whether the snapshot is currently loading data.
Snapshot
Events
 Event Summary Defined By
 Inherited Dispatched when a snapshot object has been updated in response to an earlier call to Reactor's updateSnapshot() method.Snapshot
 Inherited Dispatched when the result of an update request has been received by a snapshot object.Snapshot
Constructor Description
ClientCountSnapshot()Constructor
public function ClientCountSnapshot()

Constructor

Method Descriptions
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.

Returns
int

See also