AvatarEvent

Kind of class:public class
Package:com.smartfoxserver.openspace.events
Inherits from:Event
Dispatched by:
Version:1.0
Author:The gotoAndPlay() Team
http://www.smartfoxserver.com
http://www.gotoandplay.it
Classpath:com.smartfoxserver.openspace.events.AvatarEvent
File last modified:Thursday, 23 October 2008, 15:54:19
The AvatarEvent class is the base class for all the avatar-related events dispatched by the OpenSpace Engine.
This class provides the public property params which can contain a variable number of parameters, depending on the event type.
If not otherwise specified, all AvatarEvent types are dispatched both to the AvatarMovieClip class (see the IAvatarMovieClip interface for further details) and to the event listeners added to the OpenSpace class.

NAMING CONVENTIONS for this API reference: see the OpenSpace class API reference.
Usage:
  • Add a listener for this event to the main OpenSpace instance with OpenSpace.addEventListener method.

Summary


Constants
  • AVATAR_CREATED : String
    • Dispatched when an avatar has been created.
  • START_MOVEMENT : String
    • Dispatched when an avatar starts moving.
  • STOP_MOVEMENT : String
    • Dispatched when an avatar stops moving.
  • ENTER_TILE : String
    • Dispatched when an avatar enters a tile during its movement.
  • LEAVE_TILE : String
    • Dispatched when an avatar leaves a tile during its movement.
  • CHANGE_DIRECTION : String
    • Dispatched when an avatar changes direction during its movement.
  • MESSAGE : String
    • Dispatched when a public or private message is received.
  • CUSTOM_ACTION : String
    • Dispatched when a custom action is performed by an avatar.
  • SKIN_CHANGE : String
    • Dispatched when the avatar skin is changed.
  • DESTROY : String
    • Dispatched when the avatar instance is being removed from the OpenSpace instance.
  • CLICK : String
    • Dispatched when an avatar has been clicked.
  • ROLL_OVER : String
    • Dispatched when the mouse rolls over an avatar.
  • ROLL_OUT : String
    • Dispatched when the mouse rolls out of an avatar.
Instance properties
  • params : Object
    • An Object containing the event's parameters.

Constants

AVATAR_CREATED

public static const AVATAR_CREATED:String = "avatarCreated"
(read)

Dispatched when an avatar has been created.
NOTE: this event type is not dispatched to the AvatarMovieClip class.

The params object contains the following parameters.
Parameters:
id:
(int) the avatar's identifier, corresponding to the user's SmartFoxServer id.

CHANGE_DIRECTION

public static const CHANGE_DIRECTION:String = "changeDirection"
(read)

Dispatched when an avatar changes direction during its movement.
NOTE: this event type is dispatched to the AvatarMovieClip class only.

The params object contains the following parameters.
Parameters:
id :
(int) the avatar's identifier, corresponding to the user's SmartFoxServer id.
dir:
(int) the avatar's movement direction.

CLICK

public static const CLICK:String = "avClick"
(read)

Dispatched when an avatar has been clicked.
NOTE: this event type is not dispatched to the AvatarMovieClip class.

The params object contains the following parameters.
Parameters:
id :
(int) the avatar's identifier, corresponding to the user's SmartFoxServer id.
avatarMovieClip:
(IAvatarMovieClip) the AvatarMovieClip class instance.

CUSTOM_ACTION

public static const CUSTOM_ACTION:String = "customAction"
(read)

Dispatched when a custom action is performed by an avatar.
NOTE: this event type is dispatched to the AvatarMovieClip class only.

The params object contains the following parameters.
Parameters:
id :
(int) the avatar's identifier, corresponding to the user's SmartFoxServer id.
action:
(Object) an object containing any number of custom parameters describing the action to perform (for example the action name, direction of the action, etc.).

DESTROY

public static const DESTROY:String = "destroy"
(read)

Dispatched when the avatar instance is being removed from the OpenSpace instance.
NOTE: this event type is dispatched to the AvatarMovieClip class only.

The params object contains the following parameters.
Parameters:
id:
(int) the avatar's identifier, corresponding to the user's SmartFoxServer id.

ENTER_TILE

public static const ENTER_TILE:String = "enterTile"
(read)

Dispatched when an avatar enters a tile during its movement.

The params object contains the same parameters of the START_MOVEMENT event.
See also:

LEAVE_TILE

public static const LEAVE_TILE:String = "leaveTile"
(read)

Dispatched when an avatar leaves a tile during its movement.
NOTE: this event type is not dispatched to the AvatarMovieClip class.

The params object contains the same parameters of the START_MOVEMENT event.
See also:

MESSAGE

public static const MESSAGE:String = "message"
(read)

Dispatched when a public or private message is received.
NOTE: this event type is dispatched to the AvatarMovieClip class only.

The params object contains the following parameters.
Parameters:
id :
(int) the avatar's identifier, corresponding to the user's SmartFoxServer id.
message :
(String) the message text.
isPrivate:
(Boolean) the message type: true if private, false if public. NOTE: private messages are received by both the recipient and the sender.

ROLL_OUT

public static const ROLL_OUT:String = "avRollOut"
(read)

Dispatched when the mouse rolls out of an avatar.
NOTE: this event type is not dispatched to the AvatarMovieClip class.

The params object contains the same parameters of the CLICK event.
See also:

ROLL_OVER

public static const ROLL_OVER:String = "avRollOver"
(read)

Dispatched when the mouse rolls over an avatar.
NOTE: this event type is not dispatched to the AvatarMovieClip class.

The params object contains the same parameters of the CLICK event.
See also:

SKIN_CHANGE

public static const SKIN_CHANGE:String = "skinChange"
(read)

Dispatched when the avatar skin is changed.
NOTE: this event type is dispatched to the AvatarMovieClip class only.

The params object contains the following parameters.
Parameters:
id :
(int) the avatar's identifier, corresponding to the user's SmartFoxServer id.
skin:
(Object) an object containing any number of custom parameters describing the skin elements to be displayed (for example body type, avatar sex, hair type, etc.).

START_MOVEMENT

public static const START_MOVEMENT:String = "startMove"
(read)

Dispatched when an avatar starts moving.

The params object contains the following parameters.
Parameters:
id :
(int) the avatar's identifier, corresponding to the user's SmartFoxServer id.
dir :
(int) the avatar's movement direction.
tile :
(Tile) tile on which the avatar is currently located; see the Tile class for a description of the available properties.
linkedMapObject:
(flash.display.DisplayObject) the map object to which the tile is linked, as declared in OpenSpace Editor when creating the tile.
See also:

STOP_MOVEMENT

public static const STOP_MOVEMENT:String = "stopMove"
(read)

Dispatched when an avatar stops moving.

The params object contains the same parameters of the START_MOVEMENT event.
See also:

Instance properties

params

public params:Object
(read,write)

An Object containing the event's parameters.