Packagede.maxmaurer.FlashGameCommunicator.Events
Classpublic class GameEvent
InheritanceGameEvent Inheritance flash.events.Event

FlashGameCommunicator - GameEvent

This class contains the Event fired every time an Eventchange happens within the FlashGameCommunicator.

Each event carries a different number of parameters which are listed below, which of these parameters contain values depends on the Event-Type as well as the messageType

An event listener can be bound to six different types of Events that may happen:



Public Properties
 PropertyDefined by
  CONNECTED : String = "flashGameCommunicatorConnected"
[static] Fired when connection was established
GameEvent
  dataArray : Array
The dataArray contains a list of values after any server command that issues a list.
GameEvent
  DISCONNECTED : String = "flashGameCommunicatorDisconnected"
[static] Fired when connection was disconnected
GameEvent
  FAILED : String = "flashGameCommunicatorFailed"
[static] Fired when a command failed
GameEvent
  KICKED : String = "flashGameCommunicatorKicked"
[static] Fired when a user has been thrown out of the current room
GameEvent
  message : String
Contains the message that has been send after any of the MESSAGE_... eventTypes.
GameEvent
  MESSAGE : String = "flashGameCommunicatorMessage"
[static] Fired when a message is incoming from the server
GameEvent
  messageType : uint
Contains the messageType of this Event that may be either one of the ACTION_...
GameEvent
  myId : Number
Contains the users ID after a connection attempt (ACTION_CONNECTING)
GameEvent
  roomCapacity : Number
Contains the maximum room capacity after a ACTION_ROOM_INFORMATION
GameEvent
  roomId : Number
Contains the room-id after an ACTION_ROOM_CREATE or an ACTION_ROOM_JOIN
GameEvent
  roomLocked : Boolean
Contains wether the room is locked or not after an ACTION_ROOM_INFORMATION
GameEvent
  roomName : String
Contains the room-name after an ACTION_ROOM_CREATE, an ACTION_ROOM_JOIN or an ACTION_ROOM_INFORMATION
GameEvent
  roomSize : Number
Contains the room size (how many people are already in there) after an ACTION_ROOM_INFORMATION
GameEvent
  senderId : Number
Contains the id of the sender (or 0 for the server itself) after any of the MESSAGE_... eventTypes.
GameEvent
  senderName : String
Contains the name of the sender (or something like "Server") after any of the MESSAGE_... eventTypes.
GameEvent
  SUCCESS : String = "flashGameCommunicatorSuccess"
[static] Fired when a command sent to the server succeeded
GameEvent
  userId : Number
Contains the Id of a user when he has joined (INFO_USER_JOINED) or left(INFO_USER_LEFT) the room.
GameEvent
  USER_JOINED : String = "flashGameCommunicatorUserJoined"
[static] Fired when a user joined the room this user is currently in
GameEvent
  USER_LEFT : String = "flashGameCommunicatorUserLeft"
[static] Fired when a user left the room this user is currently in
GameEvent
  userName : String
Contains the Name of a user when he has joined (INFO_USER_JOINED) or left(INFO_USER_LEFT) the room.
GameEvent
Public Methods
 MethodDefined by
  
GameEvent(type:String, params:Object)
The GameEvent constructor should never be called externally
GameEvent
Property detail
CONNECTEDproperty
public static var CONNECTED:String = "flashGameCommunicatorConnected"

Fired when connection was established

dataArrayproperty 
public var dataArray:Array

The dataArray contains a list of values after any server command that issues a list. The number of values returned by the server can be retrieved via dataArray.length.

In case of an ACTION_ROOM_LIST the array contains elements with the roomId and the roomName that can be retrieved via dataArray[0].roomId or dataArray[0].roomName.

In case of an ACTION_USER_LIST or an ACTION_USER_LIST_ROOM the dataArray contains userId and userName of each user that can be access by dataArray[0].userId and dataArray[0].userName.

DISCONNECTEDproperty 
public static var DISCONNECTED:String = "flashGameCommunicatorDisconnected"

Fired when connection was disconnected

FAILEDproperty 
public static var FAILED:String = "flashGameCommunicatorFailed"

Fired when a command failed

KICKEDproperty 
public static var KICKED:String = "flashGameCommunicatorKicked"

Fired when a user has been thrown out of the current room

messageproperty 
public var message:String

Contains the message that has been send after any of the MESSAGE_... eventTypes.

MESSAGEproperty 
public static var MESSAGE:String = "flashGameCommunicatorMessage"

Fired when a message is incoming from the server

messageTypeproperty 
public var messageType:uint

Contains the messageType of this Event that may be either one of the ACTION_... values of the FlashGameCommunicator class, when a server command was issued or one of the MESSAGE_... values of the FlashGameCommunicator class when a Incoming-Message event has been fired.

myIdproperty 
public var myId:Number

Contains the users ID after a connection attempt (ACTION_CONNECTING)

roomCapacityproperty 
public var roomCapacity:Number

Contains the maximum room capacity after a ACTION_ROOM_INFORMATION

roomIdproperty 
public var roomId:Number

Contains the room-id after an ACTION_ROOM_CREATE or an ACTION_ROOM_JOIN

roomLockedproperty 
public var roomLocked:Boolean

Contains wether the room is locked or not after an ACTION_ROOM_INFORMATION

roomNameproperty 
public var roomName:String

Contains the room-name after an ACTION_ROOM_CREATE, an ACTION_ROOM_JOIN or an ACTION_ROOM_INFORMATION

roomSizeproperty 
public var roomSize:Number

Contains the room size (how many people are already in there) after an ACTION_ROOM_INFORMATION

senderIdproperty 
public var senderId:Number

Contains the id of the sender (or 0 for the server itself) after any of the MESSAGE_... eventTypes.

senderNameproperty 
public var senderName:String

Contains the name of the sender (or something like "Server") after any of the MESSAGE_... eventTypes.

SUCCESSproperty 
public static var SUCCESS:String = "flashGameCommunicatorSuccess"

Fired when a command sent to the server succeeded

userIdproperty 
public var userId:Number

Contains the Id of a user when he has joined (INFO_USER_JOINED) or left(INFO_USER_LEFT) the room.

USER_JOINEDproperty 
public static var USER_JOINED:String = "flashGameCommunicatorUserJoined"

Fired when a user joined the room this user is currently in

USER_LEFTproperty 
public static var USER_LEFT:String = "flashGameCommunicatorUserLeft"

Fired when a user left the room this user is currently in

userNameproperty 
public var userName:String

Contains the Name of a user when he has joined (INFO_USER_JOINED) or left(INFO_USER_LEFT) the room.

Constructor detail
GameEvent()constructor
public function GameEvent(type:String, params:Object)

The GameEvent constructor should never be called externally

Parameters
type:String
 
params:Object