Packagenet.user1.reactor
Classpublic class AccountEvent
InheritanceAccountEvent Inheritance flash.events.Event

Since : Reactor 1.0.0

AccountEvent is a simple data class used to pass information from a UserAccount object or AccountManager object to registered event-listeners when an account event occurs. The AccountEvent class also defines constants representing the available account events. To register for an account event, use the UserAccount class's addEventListener() method or the AccountManager class's addEventListener() method. The following code demonstrates:
   // The event-registration code
   reactor.getAccountManager().addEventListener(AccountEvent.LOGIN, loginListener);
   reactor.getAccountManager().login("ken", "secretPassword");
   
   // The event-listener code
   protected function login (e:AccountEvent):void {
     if (e.getAccount().isSelf()) {
       trace("You are now logged in as: " + e.getUserID());
     }
   }

See also

UserAccount
AccountManager


Public Methods
 MethodDefined By
  
AccountEvent(type:String, bubbles:Boolean = false, cancelable:Boolean = false, status:String = null, userID:String = null, clientID:String = null, role:String = null)
Constructor
AccountEvent
  
clone():Event
[override]
AccountEvent
  
Returns the UserAccount object pertaining to this account event.
AccountEvent
  
getClientID():String
Returns the clientID pertaining to this account event, if available.
AccountEvent
  
getRole():String
Returns the role pertaining to this account event.
AccountEvent
  
getStatus():String
Returns the status of the operation to which this event pertains.
AccountEvent
  
getUserID():String
Returns the userID pertaining to this account event.
AccountEvent
  
toString():String
[override]
AccountEvent
Public Constants
 ConstantDefined By
  ADD_ROLE_RESULT : String = ADD_ROLE_RESULT
[static] Dispatched when the result of an earlier UserAccount.addRole() or AccountManager.addRole() request is received.
AccountEvent
  CHANGE_PASSWORD : String = CHANGE_PASSWORD
[static] Dispatched when the current client's account password changes.
AccountEvent
  CHANGE_PASSWORD_RESULT : String = CHANGE_PASSWORD_RESULT
[static] Dispatched when the current client receives the result of an earlier request to change a user account's password.
AccountEvent
  LOGIN : String = LOGIN
[static] Dispatched when any client that is known to the current client logs in.
AccountEvent
  LOGIN_RESULT : String = LOGIN_RESULT
[static] Dispatched when the result of an earlier login request by the current client is received.
AccountEvent
  LOGOFF : String = LOGOFF
[static] Dispatched when any user account that is known to the current client logs off.
AccountEvent
  LOGOFF_RESULT : String = LOGOFF_RESULT
[static] Dispatched when the current client receives the result of an earlier request to logoff a client.
AccountEvent
  OBSERVE : String = OBSERVE
[static] Dispatched when the current client observes a user account.
AccountEvent
  OBSERVE_RESULT : String = OBSERVE_RESULT
[static] Dispatched when the result of an earlier UserAccount.observe() or AccountManager.observeAccount() request is received.
AccountEvent
  REMOVE_ROLE_RESULT : String = REMOVE_ROLE_RESULT
[static] Dispatched when the result of an earlier UserAccount.removeRole() or AccountManager.removeRole() request is received.
AccountEvent
  STOP_OBSERVING : String = STOP_OBSERVING
[static] Dispatched when the current client stops observing a user account.
AccountEvent
  STOP_OBSERVING_RESULT : String = STOP_OBSERVING_RESULT
[static] Dispatched when the result of an earlier UserAccount.stopObserving() or AccountManager.stopObservingAccount() request is received.
AccountEvent
  SYNCHRONIZE : String = SYNCHRONIZE
[static] Dispatched when a user account has been synchronized to match the state of the server.
AccountEvent
Constructor Description
AccountEvent()Constructor
public function AccountEvent(type:String, bubbles:Boolean = false, cancelable:Boolean = false, status:String = null, userID:String = null, clientID:String = null, role:String = null)

Constructor

Parameters
type:String
 
bubbles:Boolean (default = false)
 
cancelable:Boolean (default = false)
 
status:String (default = null)
 
userID:String (default = null)
 
clientID:String (default = null)
 
role:String (default = null)
Method Descriptions
clone()method
override public function clone():Event

Returns
Event
getAccount()method 
public function getAccount():UserAccount

Since : Reactor 1.0.0

Returns the UserAccount object pertaining to this account event. For example, for an AccountEvent.LOGIN event, getAccount() returns the UserAccount object for the account that logged in.

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

Since : Reactor 1.0.0

Returns the clientID pertaining to this account event, if available.

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

Since : Reactor 1.0.0

Returns the role pertaining to this account event. This method applies to the following events:

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 AccountEvent.LOGIN_RESULT event occurs in response to a successful login 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) {
       showLoggedInScreen();
     }
For a list of specific status values that can be returned during a particular event, see the documentation for that event.

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

Since : Reactor 1.0.0

Returns the userID pertaining to this account event.

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

Returns
String
Constant Descriptions
ADD_ROLE_RESULTConstant
public static const ADD_ROLE_RESULT:String = ADD_ROLE_RESULT

Since : Reactor 1.0.0

Dispatched when the result of an earlier UserAccount.addRole() or AccountManager.addRole() request is received.

See also

CHANGE_PASSWORDConstant 
public static const CHANGE_PASSWORD:String = CHANGE_PASSWORD

Since : Reactor 1.0.0

Dispatched when the current client's account password changes. A user can change its own password via the AccountManager's changePassword() method or the UserAccount object's changePassword() method. With sufficient privileges, the current client can change another user's password. Server-side code can change any user's password.

See also

CHANGE_PASSWORD_RESULTConstant 
public static const CHANGE_PASSWORD_RESULT:String = CHANGE_PASSWORD_RESULT

Since : Reactor 1.0.0

Dispatched when the current client receives the result of an earlier request to change a user account's password. To determine the result of the change-password request, use getStatus(), which has the following possible return values:

See also

LOGINConstant 
public static const LOGIN:String = LOGIN

Since : Reactor 1.0.0

Dispatched when any client that is known to the current client logs in. For a list of the situations in which a client becomes known to the current client, see the ClientManager's clientIsKnown() method. Note however, that the current client can opt out of login notification for room occupants and room observers by disabling "occupant-login-logoff updates" and "observer-login-logoff updates" via the Room class's setUpdateLevels() method.

The AccountEvent.LOGIN event is dispatched via the Client object for the client that logged in, then the UserAccount object for the logged-in account, then the AccountManager.

See also

LOGIN_RESULTConstant 
public static const LOGIN_RESULT:String = LOGIN_RESULT

Since : Reactor 1.0.0

Dispatched when the result of an earlier login request by the current client is received. To determine the result of the login request, use getStatus(), which has the following possible return values:

See also

LOGOFFConstant 
public static const LOGOFF:String = LOGOFF

Since : Reactor 1.0.0

Dispatched when any user account that is known to the current client logs off. For a list of the situations in which a client becomes known to the current client, see the ClientManager's clientIsKnown() method. Note however, that the current client can opt out of logoff notification for room occupants and room observers by disabling "occupant-login-logoff updates" and "observer-login-logoff updates" via the Room class's setUpdateLevels() method.

The AccountEvent.LOGOFF event is dispatched via the Client object for the client that logged off, then the UserAccount object for the logged-off account, then the AccountManager.

See also

LOGOFF_RESULTConstant 
public static const LOGOFF_RESULT:String = LOGOFF_RESULT

Since : Reactor 1.0.0

Dispatched when the current client receives the result of an earlier request to logoff a client. To determine the result of the logoff request, use getStatus(), which has the following possible return values:

See also

OBSERVEConstant 
public static const OBSERVE:String = OBSERVE

Since : Reactor 1.0.0

Dispatched when the current client observes a user account. For complete details, see the AccountManager's observeAccount() 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 UserAccount.observe() or AccountManager.observeAccount() request is received.

See also

REMOVE_ROLE_RESULTConstant 
public static const REMOVE_ROLE_RESULT:String = REMOVE_ROLE_RESULT

Since : Reactor 1.0.0

Dispatched when the result of an earlier UserAccount.removeRole() or AccountManager.removeRole() request is received.

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 user account.

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 UserAccount.stopObserving() or AccountManager.stopObservingAccount() request is received.

See also

SYNCHRONIZEConstant 
public static const SYNCHRONIZE:String = SYNCHRONIZE

Since : Reactor 1.0.0

Dispatched when a user account has been synchronized to match the state of the server.