LocalSubControl: Difference between revisions

From Whirled Club Wiki
Jump to navigation Jump to search
m (Text replacement - """ to """)
m (Text replacement - "<" to "<")
 
Line 5: Line 5:
You should always access localSubControl via the gameControl, don't try to instantiate the object directly.   
You should always access localSubControl via the gameControl, don't try to instantiate the object directly.   


&lt;actionscript>
<actionscript>
public class MyGame extends Sprite {
public class MyGame extends Sprite {
     public MyGame () {
     public MyGame () {
Line 25: Line 25:
     protected _local : LocalSubControl;  
     protected _local : LocalSubControl;  
}
}
&lt;/actionscript>
</actionscript>


== Noteable Methods ==
== Noteable Methods ==

Latest revision as of 14:36, 5 September 2018

LocalSubControl contains methods and events for communicating not with the Whirled server, but the local Flash environment, e.g. finding the available size, in pixels, of the area on which the game can draw; outputting feedback to the players in the chat area; retrieving avatar headshots for the players.

Initialization

You should always access localSubControl via the gameControl, don't try to instantiate the object directly.

<actionscript> public class MyGame extends Sprite {

   public MyGame () {
       _ctrl = new GameControl(this);
       //you can either access the localSubControl via a handle
       //like this
       _local = _ctrl.local; 
       _local.feedback("hello, this is a message"); 


       //or like this directly via the control object.
       _ctrl.local.feedback("hello, this is a message");
       
   }
   protected _ctrl :GameControl;
   protected _local : LocalSubControl; 

} </actionscript>

Noteable Methods

Two popular methods on the LocalSubControl are:

  • ShowGameShop
  • SetStageQuality

Other Links


Stub.gifThis article is a stub. You can help the wiki by expanding it.