Packagede.popforge.parameter
Classpublic class Parameter
Implementsflash.utils.IExternalizable

class Parameter stores an untyped value Depending on its mapping it can handle different types of values as Number, Boolean, Array It also informs listeners if the value has changed.



Public Methods
 MethodDefined by
  
Parameter(mapping:IMapping = null, value:* = null)
Creates a Parameter instance
Parameter
  
addChangedCallbacks(callback:Function):void
adds a callback function, invoked on value changed
Parameter
  
Returns the current value of the parameter
Parameter
  
Returns the current normalized value of the parameter between 0 and 1
Parameter
  
readExternal(input:IDataInput):void
Parameter
  
removeChangedCallbacks(callback:Function):void
removes a callback function
Parameter
  
reset():void
Reset value to its initial default value
Parameter
  
setValue(value:*):void
Sets the current value of the parameter if changed, inform all callbacks
Parameter
  
setValueNormalized(normalizedValue:Number):void
Sets the current value of the parameter by passing a normalized value between 0 and 1 if changed, inform all callbacks
Parameter
  
writeExternal(output:IDataOutput):void
Parameter
Constructor detail
Parameter()constructor
public function Parameter(mapping:IMapping = null, value:* = null)

Creates a Parameter instance

Parameters
mapping:IMapping (default = null) — The mapping used to map/mapInverse the normalized value
 
value:* (default = null) — The default values
Method detail
addChangedCallbacks()method
public function addChangedCallbacks(callback:Function):void

adds a callback function, invoked on value changed

Parameters
callback:Function — The function, that will be invoked on value changed
getValue()method 
public function getValue():*

Returns the current value of the parameter

Returns
*
getValueNormalized()method 
public function getValueNormalized():Number

Returns the current normalized value of the parameter between 0 and 1

Returns
Number
readExternal()method 
public function readExternal(input:IDataInput):voidParameters
input:IDataInput
removeChangedCallbacks()method 
public function removeChangedCallbacks(callback:Function):void

removes a callback function

Parameters
callback:Function — The function, that will be removed
reset()method 
public function reset():void

Reset value to its initial default value

setValue()method 
public function setValue(value:*):void

Sets the current value of the parameter if changed, inform all callbacks

Parameters
value:*
setValueNormalized()method 
public function setValueNormalized(normalizedValue:Number):void

Sets the current value of the parameter by passing a normalized value between 0 and 1 if changed, inform all callbacks

Parameters
normalizedValue:Number — A normalized value between 0 and 1
writeExternal()method 
public function writeExternal(output:IDataOutput):voidParameters
output:IDataOutput