Package | net.user1.reactor |
Class | public class RoomManagerEvent |
Inheritance | RoomManagerEvent ![]() |
Since : | Reactor 1.0.0 |
RoomManagerEvent is a simple data class used to pass information from an application's RoomManager to registered event-listeners when a room-management event occurs. The RoomManagerEvent class also defines constants representing the available room-management events.
To register for a room-management event, use RoomManager's addEventListener() method, as shown in the following code:
var roomMan:RoomManager = reactor.getRoomManager(); roomMan.addEventListener(RoomManagerEvent.ROOM_ADDED, addedListener)
private function createRoomResultListener (e:RoomManagerEvent):void { if (e.getStatus() != Status.SUCCESS) { displayError(); // displayError() code not shown } }
See also
Method | Defined By | ||
---|---|---|---|
RoomManagerEvent(type:String, bubbles:Boolean = false, cancelable:Boolean = false, roomID:String = null, status:String = null, roomIdQualifier:String = null, room:Room = null, numRooms:int = -1)
Constructor. | RoomManagerEvent | ||
clone():Event [override] | RoomManagerEvent | ||
getNumRooms():Number
Returns the total number of rooms known to the current client. | RoomManagerEvent | ||
Returns a reference to the Room object to which this event pertains. | RoomManagerEvent | ||
getRoomID():String
Returns the full room ID of the room to which this event pertains. | RoomManagerEvent | ||
getRoomIdQualifier():String
Returns the qualifier ID of the room to which this event pertains. | RoomManagerEvent | ||
getSimpleRoomID():String
Returns the simple room ID of the room to which this event pertains. | RoomManagerEvent | ||
getStatus():String
Returns the status of the operation to which this
event pertains. | RoomManagerEvent | ||
toString():String [override] | RoomManagerEvent |
Constant | Defined By | ||
---|---|---|---|
CREATE_ROOM_RESULT : String = CREATE_ROOM_RESULT [static]
Dispatched when the server reports the result of an attempt to create
a room by the current client. | RoomManagerEvent | ||
REMOVE_ROOM_RESULT : String = REMOVE_ROOM_RESULT [static]
Dispatched when the server reports the result of a remove-room
attempt by the current client. | RoomManagerEvent | ||
ROOM_ADDED : String = ROOM_ADDED [static]
Dispatched when the current client gains knowledge of a new room. | RoomManagerEvent | ||
ROOM_COUNT : String = ROOM_COUNT [static]
Dispatched whenever the RoomManager gains or loses knowledge of a room,
as described under RoomManagerEvent.ROOM_ADDED and
RoomManagerEvent.ROOM_REMOVED. | RoomManagerEvent | ||
ROOM_REMOVED : String = ROOM_REMOVED [static]
Dispatched when the current client loses knowledge of a new room. | RoomManagerEvent | ||
STOP_WATCHING_FOR_ROOMS_RESULT : String = STOP_WATCHING_FOR_ROOMS_RESULT [static]
Dispatched when the server reports the result of a stop-watching-for-rooms
attempt by the current client. | RoomManagerEvent | ||
WATCH_FOR_ROOMS_RESULT : String = WATCH_FOR_ROOMS_RESULT [static]
Dispatched when the server reports the result of a watch-for-rooms
attempt by the current client. | RoomManagerEvent |
RoomManagerEvent | () | Constructor |
public function RoomManagerEvent(type:String, bubbles:Boolean = false, cancelable:Boolean = false, roomID:String = null, status:String = null, roomIdQualifier:String = null, room:Room = null, numRooms:int = -1)
Constructor.
Parameterstype:String | |
bubbles:Boolean (default = false )
| |
cancelable:Boolean (default = false )
| |
roomID:String (default = null )
| |
status:String (default = null )
| |
roomIdQualifier:String (default = null )
| |
room:Room (default = null )
| |
numRooms:int (default = -1 )
|
clone | () | method |
override public function clone():Event
ReturnsEvent |
getNumRooms | () | method |
public function getNumRooms():Number
Since : | Reactor 1.0.0 |
Returns the total number of rooms known to the current client.
The getNumRooms() method applies to the RoomManagerEvent.ROOM_COUNT event only.
ReturnsNumber |
See also
getRoom | () | method |
public function getRoom():Room
Since : | Reactor 1.0.0 |
Returns a reference to the Room object to which this event pertains. For example, for the RoomManagerEvent.ROOM_ADDED event, getRoom() returns a reference to the room that was added.
ReturnsRoom |
getRoomID | () | method |
public function getRoomID():String
Since : | Reactor 1.0.0 |
Returns the full room ID of the room to which this event pertains. The "full room ID" is the qualified identifier for the room; for example, for a room with the qualified id "examples.chat", this method would return "examples.chat".
ReturnsString |
getRoomIdQualifier | () | method |
public function getRoomIdQualifier():String
Since : | Reactor 1.0.0 |
Returns the qualifier ID of the room to which this event pertains. For example, for a room with the fully qualified id "examples.chat", this method would return "examples".
ReturnsString |
getSimpleRoomID | () | method |
public function getSimpleRoomID():String
Since : | Reactor 1.0.0 |
Returns the simple room ID of the room to which this event pertains. The "simple room ID" is the unqualified identifier for the room; for example, for a room with the fully qualified id "examples.chat", this method would return "chat".
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, when a RoomManagerEvent.WATCH_FOR_ROOMS_RESULT event occurs for a room the current client is already watching, getStatus() returns the value of Status.ALREADY_WATCHING. For a list of specific status values that are available for a particular RoomManagerEvent event, see that event's documentation.
ReturnsString |
toString | () | method |
override public function toString():String
ReturnsString |
CREATE_ROOM_RESULT | Constant |
public static const CREATE_ROOM_RESULT:String = CREATE_ROOM_RESULT
Since : | Reactor 1.0.0 |
Dispatched when the server reports the result of an attempt to create a room by the current client. To determine the result of the attempt, use getStatus(), which has the following possible return values:
See also
REMOVE_ROOM_RESULT | Constant |
public static const REMOVE_ROOM_RESULT:String = REMOVE_ROOM_RESULT
Since : | Reactor 1.0.0 |
Dispatched when the server reports the result of a remove-room attempt by the current client. To determine the result of the attempt, use getStatus(), which has the following possible return values:
See also
ROOM_ADDED | Constant |
public static const ROOM_ADDED:String = ROOM_ADDED
Since : | Reactor 1.0.0 |
Dispatched when the current client gains knowledge of a new room. The current client gains knowledge of a room in the following circumstances.
See also
ROOM_COUNT | Constant |
public static const ROOM_COUNT:String = ROOM_COUNT
Since : | Reactor 1.0.0 |
Dispatched whenever the RoomManager gains or loses knowledge of a room, as described under RoomManagerEvent.ROOM_ADDED and RoomManagerEvent.ROOM_REMOVED. To determine the new number of rooms, use RoomManagerEvent's getNumRooms() method or RoomManager's getNumRooms() method.
See also
ROOM_REMOVED | Constant |
public static const ROOM_REMOVED:String = ROOM_REMOVED
Since : | Reactor 1.0.0 |
Dispatched when the current client loses knowledge of a new room. The current client loses knowledge of a room in the following circumstances.
See also
STOP_WATCHING_FOR_ROOMS_RESULT | Constant |
public static const STOP_WATCHING_FOR_ROOMS_RESULT:String = STOP_WATCHING_FOR_ROOMS_RESULT
Since : | Reactor 1.0.0 |
Dispatched when the server reports the result of a stop-watching-for-rooms attempt by the current client. To determine the result of the attempt, use getStatus(), which has the following possible return values:
See also
WATCH_FOR_ROOMS_RESULT | Constant |
public static const WATCH_FOR_ROOMS_RESULT:String = WATCH_FOR_ROOMS_RESULT
Since : | Reactor 1.0.0 |
Dispatched when the server reports the result of a watch-for-rooms attempt by the current client. To determine the result of the attempt, use getStatus(), which has the following possible return values:
See also