Packagenet.user1.reactor
Classpublic class ClientEvent
InheritanceClientEvent Inheritance flash.events.Event

Since : Reactor 1.0.0

ClientEvent is a simple data class used to pass information from a Client object to registered event-listeners when a client event occurs. The ClientEvent class also defines constants representing the available client events. To register for a client event, use the Client class's addEventListener() method. The following code demonstrates:
   // The event-registration code
   someClient.addEventListener(ClientEvent.JOIN_ROOM,
                               joinRoomListener);
   // The event-listener code
   protected function joinRoomListener (e:ClientEvent):void {
     trace(Client(e.target) + " joined room: " + e.getRoom());
   }

See also

Client


Public Methods
 MethodDefined By
  
ClientEvent(type:String, bubbles:Boolean = false, cancelable:Boolean = false, changedAttr:Attribute = null, room:Room = null, roomID:String = null, client:IClient = null, status:String = null, clientID:String = null)
Constructor
ClientEvent
  
clone():Event
[override]
ClientEvent
  
Returns the Client object pertaining to this client event (for example, the client that was observed).
ClientEvent
  
getClientID():String
Returns the clientID of the client to which this event pertains.
ClientEvent
  
Returns the Room object pertaining to this client event (for example, the room that was joined or left).
ClientEvent
  
getRoomID():String
Returns the fully qualified room ID for the Room object pertaining to this client event (for example, the room that was joined or left).
ClientEvent
  
getStatus():String
Returns the status of the operation to which this event pertains.
ClientEvent
  
toString():String
[override]
ClientEvent
Public Constants
 ConstantDefined By
  JOIN_ROOM : String = JOIN_ROOM
[static] Dispatched when the client that triggered this event joins a room.
ClientEvent
  LEAVE_ROOM : String = LEAVE_ROOM
[static] Dispatched when the client that triggered this event leaves a room.
ClientEvent
  OBSERVE : String = OBSERVE
[static] Dispatched when the current client observes a client.
ClientEvent
  OBSERVE_RESULT : String = OBSERVE_RESULT
[static] Dispatched when the result of an earlier Client.observe() or ClientManager.observeClient() request is received.
ClientEvent
  OBSERVE_ROOM : String = OBSERVE_ROOM
[static] Dispatched when the client that triggered this event observes a room.
ClientEvent
  STOP_OBSERVING : String = STOP_OBSERVING
[static] Dispatched when the current client stops observing a client.
ClientEvent
  STOP_OBSERVING_RESULT : String = STOP_OBSERVING_RESULT
[static] Dispatched when the result of an earlier Client.stopObserving() or ClientManager.stopObservingClient() request is received.
ClientEvent
  STOP_OBSERVING_ROOM : String = STOP_OBSERVING_ROOM
[static] Dispatched when the client that triggered this event stops observing a room.
ClientEvent
  SYNCHRONIZE : String = SYNCHRONIZE
[static] Dispatched when the client that triggered this event has been synchronized to match the state of the server due to an earlier observe() request.
ClientEvent
Constructor Description
ClientEvent()Constructor
public function ClientEvent(type:String, bubbles:Boolean = false, cancelable:Boolean = false, changedAttr:Attribute = null, room:Room = null, roomID:String = null, client:IClient = null, status:String = null, clientID:String = null)

Constructor

Parameters
type:String
 
bubbles:Boolean (default = false)
 
cancelable:Boolean (default = false)
 
changedAttr:Attribute (default = null)
 
room:Room (default = null)
 
roomID:String (default = null)
 
client:IClient (default = null)
 
status:String (default = null)
 
clientID:String (default = null)
Method Descriptions
clone()method
override public function clone():Event

Returns
Event
getClient()method 
public function getClient():IClient

Since : Reactor 1.0.0

Returns the Client object pertaining to this client event (for example, the client that was observed). The getClient() method is required only when the target of the ClientEvent is ClientManager; when the target of a ClientEvent is a Client object, the event's target property provides access to the Client object.

Returns
IClient
getClientID()method 
public function getClientID():String

Since : Reactor 1.0.0

Returns the clientID of the client to which this event pertains. For example, for the ClientEvent.JOIN_ROOM event, getClientID() returns the id of the client that joined the room.

Returns
String
getRoom()method 
public function getRoom():Room

Since : Reactor 1.0.0

Returns the Room object pertaining to this client event (for example, the room that was joined or left).

Returns
Room
getRoomID()method 
public function getRoomID():String

Since : Reactor 1.0.0

Returns the fully qualified room ID for the Room object pertaining to this client event (for example, the room that was joined or left).

Returns
String
getStatus()method 
public function getStatus():String

Since : Reactor 1.0.0

Returns the status of the operation to which this event pertains. The getStatus() method's return value is always one of the Status class's constants. For example, if the ClientEvent.JOIN_RESULT event occurs in response to a successful room-join attempt, getStatus() will return the value of Status.SUCCESS. To respond to a status, compare the return of getStatus() to one of the Status constants. For example,

if (e.getStatus() != Status.SUCCESS) {
       showJoinFailedScreen();
     }
For a list of specific status values that can be returned during a particular event, see the documentation for that event.

Returns
String
toString()method 
override public function toString():String

Returns
String
Constant Descriptions
JOIN_ROOMConstant
public static const JOIN_ROOM:String = JOIN_ROOM

Since : Reactor 1.0.0

Dispatched when the client that triggered this event joins a room.

See also

LEAVE_ROOMConstant 
public static const LEAVE_ROOM:String = LEAVE_ROOM

Since : Reactor 1.0.0

Dispatched when the client that triggered this event leaves a room. This event also occurs when a room containing the target client is removed, forcing the client to leave.

See also

OBSERVEConstant 
public static const OBSERVE:String = OBSERVE

Since : Reactor 1.0.0

Dispatched when the current client observes a client. The client that is now being observed can be accessed via ClientEvent's getClient() method.

See also

OBSERVE_RESULTConstant 
public static const OBSERVE_RESULT:String = OBSERVE_RESULT

Since : Reactor 1.0.0

Dispatched when the result of an earlier Client.observe() or ClientManager.observeClient() request is received.

See also

OBSERVE_ROOMConstant 
public static const OBSERVE_ROOM:String = OBSERVE_ROOM

Since : Reactor 1.0.0

Dispatched when the client that triggered this event observes a room.

See also

STOP_OBSERVINGConstant 
public static const STOP_OBSERVING:String = STOP_OBSERVING

Since : Reactor 1.0.0

Dispatched when the current client stops observing a client. The client that is no longer being observed can be accessed via ClientEvent's getClient() method.

See also

STOP_OBSERVING_RESULTConstant 
public static const STOP_OBSERVING_RESULT:String = STOP_OBSERVING_RESULT

Since : Reactor 1.0.0

Dispatched when the result of an earlier Client.stopObserving() or ClientManager.stopObservingClient() request is received.

See also

STOP_OBSERVING_ROOMConstant 
public static const STOP_OBSERVING_ROOM:String = STOP_OBSERVING_ROOM

Since : Reactor 1.0.0

Dispatched when the client that triggered this event stops observing a room. This event also occurs when a room containing the client is removed, forcing the client to stop observing the room.

See also

SYNCHRONIZEConstant 
public static const SYNCHRONIZE:String = SYNCHRONIZE

Since : Reactor 1.0.0

Dispatched when the client that triggered this event has been synchronized to match the state of the server due to an earlier observe() request.

See also