Package | net.user1.reactor.motion |
Class | public class PositionBroadcaster |
Inheritance | PositionBroadcaster ![]() |
Since : | ReactorGUI 1.0.0 |
Broadcasts the positions in a PositionList to interested clients.
The PositionBroadcaster broadcasts updates to other clients by setting
an attribute on itself at a specified send-rate. By default, the
attribute is global, so all clients that have specified interest in the
current client (for example, by joining a room containing the current
client) receive position-list attribute updates. To limit the updates to
a single room, set the PositionBroadcaster's constructor's scope
parameter to that room's fully qualified identifier
(e.g., "examples.avatarchat").
Every time the PositionBroadcaster sends a list of positions from its corresponding PositionList, it clears the contents of that list. If new positions are subsequently added to the PositionList, they are sent during the next broadcast.
Method | Defined By | ||
---|---|---|---|
PositionBroadcaster(reactor:Reactor, sendRate:int, scope:String = null)
Constructor
| PositionBroadcaster | ||
dispose():void
Disposes of the resources used by this object, preparing it for garbage
collection. | PositionBroadcaster | ||
Returns the PositionList object whose positions are broadcast to
other clients by this PositionBroadcaster. | PositionBroadcaster | ||
getPositionListAttributeName():String
Returns the attribute name used by this PositionBroadcaster to send
position list updates to other clients. | PositionBroadcaster | ||
setPositionList(positionList:PositionList):void
Specifies the PositionList object whose positions will be broadcast to
other clients by this PositionBroadcaster. | PositionBroadcaster | ||
setPositionListAttributeName(name:String):void
Specifies the attribute name used by this PositionBroadcaster to send
position list updates to other clients. | PositionBroadcaster | ||
start():void
Enables position-list broadcasts. | PositionBroadcaster | ||
stop():void
Enables position-list broadcasts. | PositionBroadcaster |
Constant | Defined By | ||
---|---|---|---|
DEFAULT_POSITION_LIST_ATTRIBUTE_NAME : String = POS_LIST [static]
The default attribute name used for PositionList updates. | PositionBroadcaster | ||
DEFAULT_SEND_RATE : int = 300 [static]
The default rate at which to send PositionList updates. | PositionBroadcaster |
PositionBroadcaster | () | Constructor |
public function PositionBroadcaster(reactor:Reactor, sendRate:int, scope:String = null)
Since : | ReactorGUI 1.0.0 |
Constructor
Parametersreactor:Reactor — The Reactor object through which position list updates
will be sent.
| |
sendRate:int (default = NaN ) — The rate at which to send position list updates.
| |
scope:String (default = null ) — The attribute scope for position list updates. To limit
position-list recipients to a single room, set
scope to that room (e.g.,
"examples.avatarchat").
|
dispose | () | method |
public function dispose():void
Since : | ReactorGUI 1.0.0 |
Disposes of the resources used by this object, preparing it for garbage collection.
getPositionList | () | method |
public function getPositionList():PositionList
Since : | ReactorGUI 1.0.0 |
Returns the PositionList object whose positions are broadcast to other clients by this PositionBroadcaster.
ReturnsPositionList — A PositionList object.
|
getPositionListAttributeName | () | method |
public function getPositionListAttributeName():String
Since : | ReactorGUI 1.0.0 |
Returns the attribute name used by this PositionBroadcaster to send position list updates to other clients.
ReturnsString |
setPositionList | () | method |
public function setPositionList(positionList:PositionList):void
Since : | ReactorGUI 1.0.0 |
Specifies the PositionList object whose positions will be broadcast to other clients by this PositionBroadcaster.
Parameters
positionList:PositionList — A PositionList object.
|
setPositionListAttributeName | () | method |
public function setPositionListAttributeName(name:String):void
Since : | ReactorGUI 1.0.0 |
Specifies the attribute name used by this PositionBroadcaster to send position list updates to other clients.
Parameters
name:String |
start | () | method |
public function start():void
Since : | ReactorGUI 1.0.0 |
Enables position-list broadcasts. Note that if Reactor is not currently connected to Union, no updates are sent, even if the PositionBroadcaster is enabled.
stop | () | method |
public function stop():void
Since : | ReactorGUI 1.0.0 |
Enables position-list broadcasts.
DEFAULT_POSITION_LIST_ATTRIBUTE_NAME | Constant |
public static const DEFAULT_POSITION_LIST_ATTRIBUTE_NAME:String = POS_LIST
Since : | ReactorGUI 1.0.0 |
The default attribute name used for PositionList updates. To specify a custom name, use setPositionListAttributeName().
See also
DEFAULT_SEND_RATE | Constant |
public static const DEFAULT_SEND_RATE:int = 300
Since : | ReactorGUI 1.0.0 |
The default rate at which to send PositionList updates.
See also