LocalSubControl: Difference between revisions
Jump to navigation
Jump to search
(Created page with "'''[http://www.whirled.com/code/asdocs/com/whirled/game/LocalSubControl.html LocalSubControl]''' contains methods and events for communicating not with the Whirled server, but...") |
Whirled vox (talk | contribs) m (Text replacement - "<" to "<") |
||
| (2 intermediate revisions by the same user not shown) | |||
| 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. | ||
<actionscript> | |||
public class MyGame extends Sprite { | public class MyGame extends Sprite { | ||
public MyGame () { | public MyGame () { | ||
| Line 13: | Line 13: | ||
//like this | //like this | ||
_local = _ctrl.local; | _local = _ctrl.local; | ||
_local.feedback( | _local.feedback("hello, this is a message"); | ||
//or like this directly via the control object. | //or like this directly via the control object. | ||
_ctrl.local.feedback( | _ctrl.local.feedback("hello, this is a message"); | ||
| Line 25: | Line 25: | ||
protected _local : LocalSubControl; | protected _local : LocalSubControl; | ||
} | } | ||
</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
This article is a stub. You can help the wiki by expanding it.