Packagecom.whirled.contrib
Classpublic class Configurator

Entites that need initial configuration, e.g. after purchase from the catalog, may find this class useful. It looks up a configuration entry by key in the entity's memory, and if it does not find the entry, waits for a mouse click on the entity's sprite. The click pops up a configuration pane which asks for the value, which is then set in entity memory so nobody ever sees the popup again.



Protected Properties
 PropertyDefined by
  _configured : Function
Configurator
  _control : EntityControl
Configurator
  _key : String
Configurator
Public Methods
 MethodDefined by
  
Configurator(control:EntityControl, sprite:DisplayObject, key:String, configured:Function)
Configurator
  
requestEntry(control:EntityControl, sprite:DisplayObject, key:String, configured:Function):void
[static] Gets the requested configuration entry from entity memory or failing that, from the user; whenever the value (which is a String) is safely in hand, the callback is executed with it, and the entity may continue setting itself up.
Configurator
Protected Methods
 MethodDefined by
  
handleClick(evt:MouseEvent):void
Configurator
Protected Constants
 ConstantDefined by
  PADDING : int = 10
[static]
Configurator
  WIDTH : int = 200
[static]
Configurator
Property detail
_configuredproperty
protected var _configured:Function
_controlproperty 
protected var _control:EntityControl
_keyproperty 
protected var _key:String
Constructor detail
Configurator()constructor
public function Configurator(control:EntityControl, sprite:DisplayObject, key:String, configured:Function)Parameters
control:EntityControl
 
sprite:DisplayObject
 
key:String
 
configured:Function
Method detail
handleClick()method
protected function handleClick(evt:MouseEvent):voidParameters
evt:MouseEvent
requestEntry()method 
public static function requestEntry(control:EntityControl, sprite:DisplayObject, key:String, configured:Function):void

Gets the requested configuration entry from entity memory or failing that, from the user; whenever the value (which is a String) is safely in hand, the callback is executed with it, and the entity may continue setting itself up.

Parameters
control:EntityControl
 
sprite:DisplayObject
 
key:String
 
configured:Function
Constant detail
PADDINGconstant
protected static const PADDING:int = 10
WIDTHconstant 
protected static const WIDTH:int = 200