Packageorg.as3lib.kitchensync.action.tweentarget
Classpublic class SoundTransformTarget
ImplementsITweenTarget

A tween target for setting sound transform (volume and panning). known issue: high speed transitions, such as oscicators with high frequencies, can cause clicks and distortion in the sound.



Public Properties
 PropertyDefined by
  channel : SoundChannel
The object containing the sound channel to apply the transform.
SoundTransformTarget
  currentValue : Number
The current value of the property you specified.
SoundTransformTarget
  differenceInValues : Number
[read-only] The total amount of change between the start and end values.
SoundTransformTarget
  endValue : Number
The value to end on when tweening.
SoundTransformTarget
  property : String
The property to tween.
SoundTransformTarget
  startValue : Number
The value to start from when tweening.
SoundTransformTarget
Protected Properties
 PropertyDefined by
  _channel : SoundChannel
SoundTransformTarget
  _endValue : Number
SoundTransformTarget
  _property : String
SoundTransformTarget
  _startValue : Number
SoundTransformTarget
Public Methods
 MethodDefined by
  
SoundTransformTarget(channel:SoundChannel, property:String, startValue:Number, endValue:Number)
Constructor.
SoundTransformTarget
  
SoundTransformTarget
  
reset():void
Returns the current value to the start value.
SoundTransformTarget
  
updateTween(percentComplete:Number):Number
The main function that the Tween uses to update the TweenTarget.
SoundTransformTarget
Public Constants
 ConstantDefined by
  BAD_PROPERTY_ERROR : String = "Property must be either 'pan' or 'volume'. Use SoundTransformTarget.PAN or SoundTransformTarget.VOLUME"
[static] Used when a bad property is passed to the constructor.
SoundTransformTarget
  PAN : String = "pan"
[static] Use PAN as the property to control panning.
SoundTransformTarget
  VOLUME : String = "volume"
[static] Use VOLUME as the property to control volume.
SoundTransformTarget
Property detail
_channelproperty
protected var _channel:SoundChannel
channelproperty 
channel:SoundChannel  [read-write]

The object containing the sound channel to apply the transform.

Implementation
    public function get channel():SoundChannel
    public function set channel(value:SoundChannel):void
currentValueproperty 
currentValue:Number  [read-write]

The current value of the property you specified.

Implementation
    public function get currentValue():Number
    public function set currentValue(value:Number):void
differenceInValuesproperty 
differenceInValues:Number  [read-only]

The total amount of change between the start and end values. (used internally)

Implementation
    public function get differenceInValues():Number
_endValueproperty 
protected var _endValue:Number
endValueproperty 
endValue:Number  [read-write]

The value to end on when tweening.

Implementation
    public function get endValue():Number
    public function set endValue(value:Number):void
_propertyproperty 
protected var _property:String
propertyproperty 
property:String  [read-write]

The property to tween. Either 'pan' or 'volume'

Implementation
    public function get property():String
    public function set property(value:String):void
_startValueproperty 
protected var _startValue:Number
startValueproperty 
startValue:Number  [read-write]

The value to start from when tweening.

Implementation
    public function get startValue():Number
    public function set startValue(value:Number):void
Constructor detail
SoundTransformTarget()constructor
public function SoundTransformTarget(channel:SoundChannel, property:String, startValue:Number, endValue:Number)

Constructor.

Parameters
channel:SoundChannel — The SoundChannel to apply the transform to.
 
property:String — The property of the sound channel. either pan or volume.
 
startValue:Number — the value to start from when tweening
 
endValue:Number — the value to end on when tweening
Method detail
clone()method
public function clone():ITweenTarget

Returns
ITweenTarget
reset()method 
public function reset():void

Returns the current value to the start value.

updateTween()method 
public function updateTween(percentComplete:Number):Number

The main function that the Tween uses to update the TweenTarget. Sets the percentage complete.

Parameters
percentComplete:Number — a number between 0 and 1 (but sometimes more or less) that represents the percentage of the tween that has been completed. This should update

Returns
Number — Number the new current value of the tween.
Constant detail
BAD_PROPERTY_ERRORconstant
public static const BAD_PROPERTY_ERROR:String = "Property must be either 'pan' or 'volume'. Use SoundTransformTarget.PAN or SoundTransformTarget.VOLUME"

Used when a bad property is passed to the constructor.

PANconstant 
public static const PAN:String = "pan"

Use PAN as the property to control panning.

VOLUMEconstant 
public static const VOLUME:String = "volume"

Use VOLUME as the property to control volume.