Package | net.user1.reactor |
Class | public class AccountEvent |
Inheritance | AccountEvent ![]() |
Since : | Reactor 1.0.0 |
// 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
Method | Defined 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 |
Constant | Defined 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 |
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
Parameterstype: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 )
|
clone | () | method |
override public function clone():Event
ReturnsEvent |
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.
ReturnsUserAccount |
getClientID | () | method |
public function getClientID():String
Since : | Reactor 1.0.0 |
Returns the clientID pertaining to this account event, if available.
ReturnsString |
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:
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(); }
String |
getUserID | () | method |
public function getUserID():String
Since : | Reactor 1.0.0 |
Returns the userID pertaining to this account event.
ReturnsString |
toString | () | method |
override public function toString():String
ReturnsString |
ADD_ROLE_RESULT | Constant |
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_PASSWORD | Constant |
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_RESULT | Constant |
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
LOGIN | Constant |
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_RESULT | Constant |
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
LOGOFF | Constant |
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_RESULT | Constant |
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
OBSERVE | Constant |
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_RESULT | Constant |
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_RESULT | Constant |
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_OBSERVING | Constant |
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_RESULT | Constant |
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
SYNCHRONIZE | Constant |
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.