Package | com.whirled.avrg |
Class | public class RoomSubControlBase |
Inheritance | RoomSubControlBase ![]() ![]() ![]() ![]() |
Subclasses | RoomSubControlClient, RoomSubControlServer |
Method | Defined by | ||
---|---|---|---|
![]() |
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Registers an event listener.
| AbstractControl | |
![]() |
doBatch(fn:Function, ... args):void
Execute the specified function as a batch of commands that will be sent to the server
together.
| AbstractSubControl | |
getAvatarInfo(playerId:int):AVRGameAvatar
Gets all available information on the avatar of a player with the given id.
| RoomSubControlBase | ||
getMusicOwnerId():int
Get the playerId of the owner of the currently playing music, aka the player who added it
to the playlist, or 0 if there is no music currently playing.
| RoomSubControlBase | ||
getOccupantIds():Array
Gets an array of the ids of all the occupants in this room.
| RoomSubControlBase | ||
getOccupantName(playerId:int):String
Get the name of the specified occupant, who may be a player, or null if not found.
| RoomSubControlBase | ||
getPlayerIds():Array
Gets an array of the ids of all the players in this room.
| RoomSubControlBase | ||
getRoomBounds():Rectangle
Get the room's bounds in pixel coordinates.
| RoomSubControlBase | ||
getRoomId():int
Gets the id of this room.
| RoomSubControlBase | ||
getRoomName():String
Returns the name of this room.
| RoomSubControlBase | ||
getSpawnedMobs():Array
Returns an array of
String s corresponding to the ids of all the MOBs in this
room. | RoomSubControlBase | ||
![]() |
getTargetId():int
Get the targetId on which this control operates.
| TargetedSubControl | |
![]() |
isConnected():Boolean
Are we connected and running inside the whirled environment, or has someone just
loaded up our SWF by itself?
| AbstractSubControl | |
isPlayerHere(id:int):Boolean
Tests if a player of a given id is in this room.
| RoomSubControlBase | ||
![]() |
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
Unregisters an event listener.
| AbstractControl |
Event | Summary | Defined by | ||
---|---|---|---|---|
Dispatched when something has changed about a player's avatar in this room. | RoomSubControlBase | |||
Dispatched when a MOB has been created. | RoomSubControlBase | |||
Dispatched when music starts playing in the room. | RoomSubControlBase | |||
Dispatched when music stops playing in the room. | RoomSubControlBase | |||
Dispatched either when somebody in this room entered our current game, or somebody playing the game entered this room. | RoomSubControlBase | |||
Dispatched either when somebody in this room left our current game, or somebody playing the game left this room. | RoomSubControlBase | |||
Dispatched when a player in this room takes up a new location. | RoomSubControlBase | |||
Dispatched when a signal has been received in this room. | RoomSubControlBase | |||
![]() | Event.UNLOAD Dispatched when the SWF using this control has been unloaded. | AbstractControl |
getAvatarInfo | () | method |
public function getAvatarInfo(playerId:int):AVRGameAvatar
Gets all available information on the avatar of a player with the given id.
ParametersplayerId:int |
AVRGameAvatar |
— if the player is not here
|
getMusicOwnerId | () | method |
public function getMusicOwnerId():int
Get the playerId of the owner of the currently playing music, aka the player who added it to the playlist, or 0 if there is no music currently playing.
Returnsint |
getOccupantIds | () | method |
public function getOccupantIds():Array
Gets an array of the ids of all the occupants in this room. The occupants is a superset of the players.
ReturnsArray |
getOccupantName | () | method |
public function getOccupantName(playerId:int):String
Get the name of the specified occupant, who may be a player, or null if not found. NOTE: names are not unique and can change at any time. You must use the playerId to identify someone, and only retrieve the name for display purposes.
ParametersplayerId:int |
String |
getPlayerIds | () | method |
public function getPlayerIds():Array
Gets an array of the ids of all the players in this room. The players are a subset of the occupants.
ReturnsArray |
getRoomBounds | () | method |
public function getRoomBounds():Rectangle
Get the room's bounds in pixel coordinates. This is essentially the width and height of the room's decor. It is an absolute coordinate system, i.e. (x, y) for one client here is the same (x, y) as for another.
ReturnsRectangle — a Rectangle anchored at (0, 0)
|
getRoomId | () | method |
public function getRoomId():int
Gets the id of this room. Room ids are the same as scene ids and are the same each time the room is visited. They may also be used directly to access a scene (www.whirled.com/#world-s{sceneId}).
Returnsint |
getRoomName | () | method |
public function getRoomName():String
Returns the name of this room.
ReturnsString |
getSpawnedMobs | () | method |
public function getSpawnedMobs():Array
Returns an array of String
s corresponding to the ids of all the MOBs in this
room.
Array |
See also
isPlayerHere | () | method |
public function isPlayerHere(id:int):Boolean
Tests if a player of a given id is in this room.
Parametersid:int |
Boolean |
avatarChanged | event |
com.whirled.avrg.AVRGameRoomEvent
com.whirled.avrg.AVRGameRoomEvent.AVATAR_CHANGED
Dispatched when something has changed about a player's avatar in this room.
An event type dispatched when something has changed about an avatar in the room.
name - not used
value :int - id of the player whose avatar changed
mobControlAvailable | event |
com.whirled.avrg.AVRGameRoomEvent
com.whirled.avrg.AVRGameRoomEvent.MOB_CONTROL_AVAILABLE
Dispatched when a MOB has been created.
An event type dispatched when the control for a MOB spawned in the room has become available.
name - the id of the MOB
value :MobSubControlBase - the new control
See also
musicStarted | event |
com.whirled.ControlEvent
com.whirled.ControlEvent.MUSIC_STARTED
Dispatched when music starts playing in the room. If the current user can hear it, id3 data aybe available shortly after this event. The sequence of events goes like this: MUSIC_STARTED, 0 or more MUSIC_ID3 tags (client only), MUSIC_STOPPED. Note however that you may not get a MUSIC_STARTED event if the music starts playing prior to your avrg being initialized. Calling getMusicOwnerId() can tell you definitively if there is music currently playing.
An event dispatched when some music starts playing. name - unused value - unused
musicStopped | event |
com.whirled.ControlEvent
com.whirled.ControlEvent.MUSIC_STOPPED
Dispatched when music stops playing in the room.
An event dispatched when some music stops playing. name - unused value - unused
See also
playerEntered | event |
com.whirled.avrg.AVRGameRoomEvent
com.whirled.avrg.AVRGameRoomEvent.PLAYER_ENTERED
Dispatched either when somebody in this room entered our current game, or somebody playing the game entered this room. On the client, the event is only dispatched if the player entering the room is not the local player. On the server agent, it is always dispatched.
An event type dispatched when a player entered the room.
name - not used
value :int - the id of the player entering
playerLeft | event |
com.whirled.avrg.AVRGameRoomEvent
com.whirled.avrg.AVRGameRoomEvent.PLAYER_LEFT
Dispatched either when somebody in this room left our current game, or somebody playing the game left this room. On the client, the event is only dispatched if the player leaving the room is not the local player. On the server agent, it is always dispatched.
An event type dispatched either when a player leaves the room.
name - not used
value :int - the id of the player leaving
playerMoved | event |
com.whirled.avrg.AVRGameRoomEvent
com.whirled.avrg.AVRGameRoomEvent.PLAYER_MOVED
Dispatched when a player in this room takes up a new location. The event is dispatched immediately when the move is initiated, not when the avatar arrives at the location. The movement itself may take a potentially long time.
An event type dispatched when a player of our game who's also in the room took up a new
location.
name - not used
value :int - the id of the player who moved
signalReceived | event |
com.whirled.avrg.AVRGameRoomEvent
com.whirled.avrg.AVRGameRoomEvent.SIGNAL_RECEIVED
Dispatched when a signal has been received in this room.
An event type dispatched when a signal has been received in this room.
name - The name of the signal.
value - The arg sent with the signal, or null.
See also