Packagenet.user1.reactor.ui
Classpublic class Avatar
InheritanceAvatar Inheritance flash.display.Sprite

Since : ReactorGUI 1.0.0

A visual representation of a user on the screen. Each Avatar instance's position is determined by the value of a position list attribute specified setPositionListAttributeName() and setPositionListAttributeScope(). If the value of that attribute changes, the Avatar animates through the list of new positions. Use the PositionList class to generate a list of positions for use with the Avatar class's position list attribute.

Note that the Avatar class extends Sprite, and, therefore, can be used in non-Flex applications.



Public Methods
 MethodDefined By
  
Avatar(speed:int = 100)
Constructor
Avatar
  
addPosition(position:Point):void
Avatar
  
addPositions(newPositions:PositionList):void
Avatar
  
animateTo(toX:Number, toY:Number):void
Avatar
  
dispose():void
Disposes of the resources used by this object, preparing it for garbage collection.
Avatar
  
getClient():IClient
Returns the underlying IClient object that provides data for this Avatar.
Avatar
  
getIcon():DisplayObject
Returns the DisplayObject instance for this Avatar's icon.
Avatar
  
setClient(client:IClient):void
Specifies the underlying IClient object that will provide data for this Avatar.
Avatar
  
setFadeInDuration(milliseconds:int = 500):void
Specifies the duration of the fade-in animation that plays when this Avatar is added to the screen for the first time.
Avatar
  
setIcon(icon:DisplayObject):void
Specifies the DisplayObject instance that will be used for this Avatar's icon.
Avatar
  
setPosition(x:Number, y:Number):void
Avatar
  
Specifies the name of the attribute to use for this Avatar's position list.
Avatar
  
setPositionListAttributeScope(scope:String = null):void
Specifies the scope of the attribute to use for this Avatar's position list.
Avatar
  
setSpeed(speed:uint):void
Specifies the length of time, in milliseconds, required for this Avatar to travel from its current position to its next position.
Avatar
Constructor Description
Avatar()Constructor
public function Avatar(speed:int = 100)

Constructor

Parameters
speed:int (default = 100)
Method Descriptions
addPosition()method
public function addPosition(position:Point):void

Parameters

position:Point

addPositions()method 
public function addPositions(newPositions:PositionList):void

Parameters

newPositions:PositionList

animateTo()method 
public function animateTo(toX:Number, toY:Number):void

Parameters

toX:Number
 
toY:Number

dispose()method 
public function dispose():void

Since : ReactorGUI 1.0.0

Disposes of the resources used by this object, preparing it for garbage collection.

getClient()method 
public function getClient():IClient

Since : ReactorGUI 1.0.0

Returns the underlying IClient object that provides data for this Avatar.

Returns
IClient
getIcon()method 
public function getIcon():DisplayObject

Since : ReactorGUI 1.0.0

Returns the DisplayObject instance for this Avatar's icon.

Returns
DisplayObject
setClient()method 
public function setClient(client:IClient):void

Since : ReactorGUI 1.0.0

Specifies the underlying IClient object that will provide data for this Avatar. The IClient object must define a shared attribute whose value contains the specified client's position list. By default, the attribute must be a global attribute whose name matches the value of PositionBroadcaster.DEFAULT_POSITION_LIST_ATTRIBUTE_NAME. However, a custom attribute name and scope can be specified via setPositionListAttributeName() and setPositionListAttributeScope().

Parameters

client:IClient

See also

setPositionListAttributeScope()
setPositionListAttributeName()
setFadeInDuration()method 
public function setFadeInDuration(milliseconds:int = 500):void

Since : ReactorGUI 1.0.0

Specifies the duration of the fade-in animation that plays when this Avatar is added to the screen for the first time.

Parameters

milliseconds:int (default = 500)

setIcon()method 
public function setIcon(icon:DisplayObject):void

Since : ReactorGUI 1.0.0

Specifies the DisplayObject instance that will be used for this Avatar's icon.

Parameters

icon:DisplayObject

setPosition()method 
public function setPosition(x:Number, y:Number):void

Parameters

x:Number
 
y:Number

setPositionListAttributeName()method 
public function setPositionListAttributeName(name:String):void

Since : ReactorGUI 1.0.0

Specifies the name of the attribute to use for this Avatar's position list. The attribute must be set by the underlying IClient object. See setClient().

Parameters

name:String (default = NaN)

See also

setPositionListAttributeScope()method 
public function setPositionListAttributeScope(scope:String = null):void

Since : ReactorGUI 1.0.0

Specifies the scope of the attribute to use for this Avatar's position list. The attribute must be set by the underlying IClient object. See setClient().

Parameters

scope:String (default = null)

See also

setSpeed()method 
public function setSpeed(speed:uint):void

Since : ReactorGUI 1.0.0

Specifies the length of time, in milliseconds, required for this Avatar to travel from its current position to its next position.

Parameters

speed:uint