Packagenet.user1.reactor
Classpublic class RoomManagerEvent
InheritanceRoomManagerEvent Inheritance flash.events.Event

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)
The following code shows a RoomManagerEvent.CREATE_ROOM_RESULT listener that uses getStatus() to determine whether to show an application error message.
   private function createRoomResultListener (e:RoomManagerEvent):void {
     if (e.getStatus() != Status.SUCCESS) {
       displayError();  // displayError() code not shown
     }
   }
   

See also

RoomManager
RoomManager.addEventListener()


Public Methods
 MethodDefined 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
  
Returns the qualifier ID of the room to which this event pertains.
RoomManagerEvent
  
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
Public Constants
 ConstantDefined 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
Constructor Description
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.

Parameters
type: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)
Method Descriptions
clone()method
override public function clone():Event

Returns
Event
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.

Returns
Number

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.

Returns
Room
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".

Returns
String
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".

Returns
String
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".

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, 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.

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

Returns
String
Constant Descriptions
CREATE_ROOM_RESULTConstant
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:

Note that RoomManagerEvent.CREATE_ROOM_RESULT is triggered only when the current client attempts to create a room, not when other clients attempt to create rooms, and not when the the current client gains knowledge of a room. To respond to the creation of rooms by other clients, use watchForRooms() and the RoomManagerEvent.ROOM_ADDED event.

See also

RoomManagerEvent.ROOM_ADDED
RoomManager.watchForRooms()
REMOVE_ROOM_RESULTConstant 
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_ADDEDConstant 
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.

Note the difference between ROOM_ADDED and CREATE_ROOM_RESULT: ROOM_ADDED indicates that the RoomManager has gained awareness of a room; CREATE_ROOM_RESULT merely tells the current client the result of an attempt to create a server-side room.

See also

ROOM_COUNTConstant 
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

RoomManager.getNumRooms()
getNumRooms()
RoomManagerEvent.ROOM_ADDED
RoomManagerEvent.ROOM_REMOVED
ROOM_REMOVEDConstant 
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_RESULTConstant 
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_RESULTConstant 
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