Packagecom.whirled.avrg
Classpublic class PlayerSubControlClient
InheritancePlayerSubControlClient Inheritance PlayerSubControlBase Inheritance TargetedSubControl Inheritance AbstractSubControl Inheritance AbstractControl Inheritance flash.events.EventDispatcher

Provides services for the client's player of an AVRG.

See also

AVRGameControl.player


Public Properties
 PropertyDefined by
 Inheritedprops : PropertySubControl
Accesses the read-write properties of this player.
PlayerSubControlBase
Public Methods
 MethodDefined by
 Inherited
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Registers an event listener.
AbstractControl
 Inherited
completeTask(taskId:String, payout:Number):void
This method calculates and awards a coin payout for the player.
PlayerSubControlBase
 Inherited
Quits the game for this player.
PlayerSubControlBase
 Inherited
doBatch(fn:Function, ... args):void
Execute the specified function as a batch of commands that will be sent to the server together.
AbstractSubControl
  
Returns the master item id of the avatar being worn by the player, or zero for guests (ghosts) or people wearing the default tofu.
PlayerSubControlClient
 Inherited
getBars():int
Returns this player's current bar balance.
PlayerSubControlBase
 Inherited
getCoins():int
Returns this player's current coin balance.
PlayerSubControlBase
  
Returns the player's Facebook info in a two element array.
PlayerSubControlClient
 Inherited
getPartyId():int
Get the party id of this player.
PlayerSubControlBase
  
Returns the id of this player.
PlayerSubControlClient
 Inherited
Returns all item packs owned by this client's player (the default) or a specified player.
PlayerSubControlBase
 Inherited
Returns all level packs owned by this client's player (the default) or a specified player.
PlayerSubControlBase
  
getPlayerName():String
Returns the name of this player.
PlayerSubControlClient
 Inherited
getRoomId():int
Accesses the id of the room that this player is in.
PlayerSubControlBase
 Inherited
Get the targetId on which this control operates.
TargetedSubControl
 Inherited
holdsTrophy(ident:String):Boolean
Returns true if this client's player (the default) or a specified player has the trophy with the specified identifier.
PlayerSubControlBase
 Inherited
isConnected():Boolean
Are we connected and running inside the whirled environment, or has someone just loaded up our SWF by itself?
AbstractSubControl
 Inherited
moveToRoom(roomId:int, exitCoords:Array = null):void
Instructs this player's client to move to the specified room, or pass 0 to put the player in no room.
PlayerSubControlBase
 Inherited
playAvatarAction(action:String):void
Plays an action on this players avatar.
PlayerSubControlBase
 Inherited
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
Unregisters an event listener.
AbstractControl
  
requestConsumeItemPack(ident:String, msg:String):Boolean
Requests to consume the specified item pack.
PlayerSubControlClient
 Inherited
setAvatarLocation(x:Number, y:Number, z:Number, orient:Number):void
Sets the location and orientation of this player's avatar in room coordinates.
PlayerSubControlBase
 Inherited
setAvatarState(state:String):void
Sets the stats of this player's avatar.
PlayerSubControlBase
Events
 EventSummaryDefined by
 Inherited Dispatched when this player has just entered a room (or was already in the room and just started playing the game).PlayerSubControlBase
 Inherited Dispatched when this player has left a room (or has chosen to leave the game).PlayerSubControlBase
   Dispatched when a message arrives with information that is not part of the shared game state.PlayerSubControlClient
 Inherited Dispatched when this player has purchased new game content.PlayerSubControlBase
 Inherited Dispatched when this player has consumed an item pack.PlayerSubControlBase
 Inherited Dispatched when this player completes a task and receives a coin payout.PlayerSubControlBase
 Inherited Event.UNLOAD Dispatched when the SWF using this control has been unloaded.AbstractControl
Method detail
getAvatarMasterItemId()method
public function getAvatarMasterItemId():int

Returns the master item id of the avatar being worn by the player, or zero for guests (ghosts) or people wearing the default tofu. The master id will be the same for all purchased copies of a particular catalog avatar and will be a unique value for every original (non-catalog purchased) avatar item.

Returns
int
getFacebookInfo()method 
public function getFacebookInfo():Array

Returns the player's Facebook info in a two element array. The first element is the player's Facebook id the second is their current Facebook session token (or the empty string if we have no session token information for the player). The return value will be null if the player is not currently playing the game through the game's Facebook app.

The Facebook id is only available to games that have specified a Facebook app configuration for their game and only when the player is playing the game through the Facebook app.

Returns
Array
getPlayerId()method 
public override function getPlayerId():int

Returns the id of this player. This id is the member id and can be used to view the member's profile (www.whirled.com/#people-{id}).

Returns
int
getPlayerName()method 
public override function getPlayerName():String

Returns the name of this player.

Returns
String
requestConsumeItemPack()method 
public function requestConsumeItemPack(ident:String, msg:String):Boolean

Requests to consume the specified item pack. The player must currently own at least one copy of the item pack. This will display a standard dialog asking the player if they wish to consume the pack.

If the player accepts the request to consume the item pack, a GameContentEvent.PLAYER_CONTENT_CONSUMED event will be dispatched on this control (on both the client and server).

Parameters
ident:String — the identifier of the item pack to be consumed.
 
msg:String — a message to display in the dialog to help the player understand what's going on.

Returns
Boolean — true if the dialog was shown, false if the dialog was not shown because the player is known not to own at least one copy of the item pack.
Event detail
MsgReceivedevent 
Event object type: com.whirled.net.MessageReceivedEvent
MessageReceivedEvent.type property = 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