Package | com.whirled.avrg |
Class | public class GameSubControlBase |
Inheritance | GameSubControlBase ![]() ![]() ![]() |
Subclasses | GameSubControlClient, GameSubControlServer |
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 | |
getItemPacks():Array
Returns the set of all item packs available to this game as an array of objects with the
following properties:
ident - string identifier of item pack name - human readable name of item pack mediaURL - URL for item pack content | GameSubControlBase | ||
getLevelPacks():Array
Returns the set of all level packs available to this game as an array of objects with the
following properties:
ident - string identifier of item pack name - human readable name of item pack mediaURL - URL for item pack content premium - boolean indicating that content is premium or not | GameSubControlBase | ||
getOccupantName(playerId:int):String
Get the name of an occupant of the game, or null if not found.
| GameSubControlBase | ||
getParty(partyId:int):PartySubControl
Get the party control for the specified party.
| GameSubControlBase | ||
getPartyIds():Array
Return the ids of all parties presently in this game.
| GameSubControlBase | ||
getPlayerIds():Array
Returns an array of the ids of all players who have joined and not yet quit the game.
| GameSubControlBase | ||
![]() |
isConnected():Boolean
Are we connected and running inside the whirled environment, or has someone just
loaded up our SWF by itself?
| AbstractSubControl | |
loadItemPackData(ident:String, onLoaded:Function, onFailure:Function):void
Loads the binary data for the item pack with the specified ident.
| GameSubControlBase | ||
loadLevelPackData(ident:String, onLoaded:Function, onFailure:Function):void
Loads the binary data for the level pack with the specified ident.
| GameSubControlBase | ||
![]() |
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
Unregisters an event listener.
| AbstractControl |
Event | Summary | Defined by | ||
---|---|---|---|---|
Dispatched when a message arrives with information that is not part of the shared game state. | GameSubControlBase | |||
Dispatched when a party arrives in the game. | GameSubControlBase | |||
Dispatched when a party leaves the game. | GameSubControlBase | |||
![]() | Event.UNLOAD Dispatched when the SWF using this control has been unloaded. | AbstractControl |
getItemPacks | () | method |
public function getItemPacks():Array
Returns the set of all item packs available to this game as an array of objects with the following properties:
ident - string identifier of item pack name - human readable name of item pack mediaURL - URL for item pack contentReturns
Array |
getLevelPacks | () | method |
public function getLevelPacks():Array
Returns the set of all level packs available to this game as an array of objects with the following properties:
ident - string identifier of item pack name - human readable name of item pack mediaURL - URL for item pack content premium - boolean indicating that content is premium or notReturns
Array |
getOccupantName | () | method |
public function getOccupantName(playerId:int):String
Get the name of an occupant of the game, or null if not found. In an AVRG all occupants are players, so this could be called getPlayerName(), but this name matches RoomSubControlBase as well as the "regular" game api. 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 |
getParty | () | method |
public function getParty(partyId:int):PartySubControl
Get the party control for the specified party. Note that this will always return a PartySubControl, even for partyIds that are not present in the game. Be careful.
ParameterspartyId:int |
PartySubControl |
getPartyIds | () | method |
public function getPartyIds():Array
Return the ids of all parties presently in this game.
ReturnsArray |
getPlayerIds | () | method |
public function getPlayerIds():Array
Returns an array of the ids of all players who have joined and not yet quit the game.
ReturnsArray |
loadItemPackData | () | method |
public function loadItemPackData(ident:String, onLoaded:Function, onFailure:Function):void
Loads the binary data for the item pack with the specified ident.
Parametersident:String — the identifier of the item pack to be loaded.
|
|
onLoaded:Function — a function with the signature: function (data :ByteArray) :void
that will be called with the item pack data if it loads successfully.
|
|
onFailure:Function — a function with the signature: function (error :Error) :void
that will be called if the pack loading fails.
|
loadLevelPackData | () | method |
public function loadLevelPackData(ident:String, onLoaded:Function, onFailure:Function):void
Loads the binary data for the level pack with the specified ident.
Parametersident:String — the identifier of the level pack to be loaded.
|
|
onLoaded:Function — a function with the signature: function (data :ByteArray) :void
that will be called with the level pack data if it loads successfully.
|
|
onFailure:Function — a function with the signature: function (error :Error) :void
that will be called if the pack loading fails.
|
MsgReceived | event |
com.whirled.net.MessageReceivedEvent
com.whirled.net.MessageReceivedEvent.MESSAGE_RECEIVED
Dispatched when a message arrives with information that is not part of the shared game state.
The type of all MessageReceivedEvents.
See also
partyEntered | event |
com.whirled.ControlEvent
com.whirled.party.PartySubControl.PARTY_ENTERED
Dispatched when a party arrives in the game.
An event type dispatched on the GameSubControl when a party joins the game.
name - not used
value - partyId
partyLeft | event |
com.whirled.ControlEvent
com.whirled.party.PartySubControl.PARTY_LEFT
Dispatched when a party leaves the game.
An event type dispatched on the GameSubControl when a party leaves the game.
name - not used
value - partyId