Package | net.user1.reactor |
Class | public class ClientEvent |
Inheritance | ClientEvent ![]() |
Since : | Reactor 1.0.0 |
// 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
Method | Defined 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 |
Constant | Defined 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 |
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
Parameterstype: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 )
|
clone | () | method |
override public function clone():Event
ReturnsEvent |
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.
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.
ReturnsString |
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).
ReturnsRoom |
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).
ReturnsString |
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(); }
String |
toString | () | method |
override public function toString():String
ReturnsString |
JOIN_ROOM | Constant |
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_ROOM | Constant |
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
OBSERVE | Constant |
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_RESULT | Constant |
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_ROOM | Constant |
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_OBSERVING | Constant |
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_RESULT | Constant |
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_ROOM | Constant |
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
SYNCHRONIZE | Constant |
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