Packagecom.whirled.game
Classpublic class GameControl
InheritanceGameControl Inheritance AbstractControl Inheritance flash.events.EventDispatcher
SubclassesLoopbackGameControl

Used to coordinate game state and control your multiplayer game.

Note: Check out the Easy GameControl Index.


Example
Typically, you create this in your top-level MovieClip/Sprite:
 public class MyGame extends Sprite
 {
     public var ctrl :GameControl;
      // Constructor
     public function MyGame ()
     {
          ctrl = new GameControl(this);
          ...
 



Public Properties
 PropertyDefined by
  game : GameSubControl
[read-only] Access the 'game' services.
GameControl
  local : LocalSubControl
[read-only] Access the 'local' services.
GameControl
  net : NetSubControl
[read-only] Access the 'net' services.
GameControl
  player : PlayerSubControl
[read-only] Access the 'player' services.
GameControl
  services : ServicesSubControl
[read-only] Access the 'services' services.
GameControl
Public Methods
 MethodDefined by
  
GameControl(disp:DisplayObject, autoReady:Boolean = true)
Creates a GameControl that connects to the Whirled game system.
GameControl
 Inherited
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Registers an event listener.
AbstractControl
 Inherited
doBatch(fn:Function, ... args):void
Execute the specified function as a batch of commands that will be sent to the server together.
AbstractControl
  
isConnected():Boolean
Are we connected and running inside the whirled environment, or has someone just loaded up our SWF by itself?
GameControl
 Inherited
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
Unregisters an event listener.
AbstractControl
Events
 EventSummaryDefined by
 Inherited Event.UNLOAD Dispatched when the SWF using this control has been unloaded.AbstractControl
Public Constants
 ConstantDefined by
  AVATAR_SHOP : String = "avatars"
[static]
GameControl
  BACKDROP_SHOP : String = "backdrops"
[static]
GameControl
  FURNITURE_SHOP : String = "furniture"
[static]
GameControl
  ITEM_PACK_SHOP : String = "item_packs"
[static]
GameControl
  LEVEL_PACK_SHOP : String = "level_packs"
[static]
GameControl
  PET_SHOP : String = "pets"
[static]
GameControl
  TOY_SHOP : String = "toys"
[static]
GameControl
Property detail
gameproperty
game:GameSubControl  [read-only]

Access the 'game' services.

Implementation
    public function get game():GameSubControl
localproperty 
local:LocalSubControl  [read-only]

Access the 'local' services.

Implementation
    public function get local():LocalSubControl
netproperty 
net:NetSubControl  [read-only]

Access the 'net' services.

Implementation
    public function get net():NetSubControl
playerproperty 
player:PlayerSubControl  [read-only]

Access the 'player' services.

Implementation
    public function get player():PlayerSubControl
servicesproperty 
services:ServicesSubControl  [read-only]

Access the 'services' services.

Implementation
    public function get services():ServicesSubControl
Constructor detail
GameControl()constructor
public function GameControl(disp:DisplayObject, autoReady:Boolean = true)

Creates a GameControl that connects to the Whirled game system.

Parameters
disp:DisplayObject — the display object that is the game's UI.
 
autoReady:Boolean (default = true) — if true, the game will automatically be started when initialization is complete, if false, the game will not start until all clients call playerReady().

See also

Method detail
isConnected()method
public override function isConnected():Boolean

Are we connected and running inside the whirled environment, or has someone just loaded up our SWF by itself?

Returns
Boolean
Constant detail
AVATAR_SHOPconstant
public static const AVATAR_SHOP:String = "avatars"
BACKDROP_SHOPconstant 
public static const BACKDROP_SHOP:String = "backdrops"
FURNITURE_SHOPconstant 
public static const FURNITURE_SHOP:String = "furniture"
ITEM_PACK_SHOPconstant 
public static const ITEM_PACK_SHOP:String = "item_packs"
LEVEL_PACK_SHOPconstant 
public static const LEVEL_PACK_SHOP:String = "level_packs"
PET_SHOPconstant 
public static const PET_SHOP:String = "pets"
TOY_SHOPconstant 
public static const TOY_SHOP:String = "toys"