Packagenet.flashpunk.tweens.sound
Classpublic class SfxFader
InheritanceSfxFader Inheritance Tween Inheritance Object

Sound effect fader.



Public Properties
 PropertyDefined By
 Inheritedactive : Boolean
If the tween should update.
Tween
 Inheritedcomplete : Function
Tween completion callback.
Tween
 Inheriteddelay : Number = 0
Length of time to wait before starting this tween.
Tween
 Inheritedpercent : Number
The completion percentage of the Tween.
Tween
 Inheritedscale : Number
[read-only] The current time scale of the Tween (after easer has been applied).
Tween
  sfx : Sfx
[read-only] The current Sfx this object is effecting.
SfxFader
Public Methods
 MethodDefined By
  
SfxFader(sfx:Sfx, complete:Function = null, type:uint = 0)
Constructor.
SfxFader
 Inherited
cancel():void
Immediately stops the Tween and removes it from its Tweener without calling the complete callback.
Tween
  
crossFade(play:Sfx, loop:Boolean, duration:Number, volume:Number = 1, ease:Function = null):void
Fades out the Sfx, while also playing and fading in a replacement Sfx.
SfxFader
  
fadeTo(volume:Number, duration:Number, ease:Function = null):void
Fades the Sfx to the target volume.
SfxFader
 Inherited
start():void
Starts the Tween, or restarts it if it's currently running.
Tween
 Inherited
update():void
Updates the Tween, called by World.
Tween
Public Constants
 ConstantDefined By
 InheritedLOOPING : uint = 1
[static] Looping Tween type, will restart immediately when it finishes.
Tween
 InheritedONESHOT : uint = 2
[static] Oneshot Tween type, will stop and remove itself from its core container when it finishes.
Tween
 InheritedPERSIST : uint = 0
[static] Persistent Tween type, will stop when it finishes.
Tween
Property Detail
sfxproperty
sfx:Sfx  [read-only]

The current Sfx this object is effecting.


Implementation
    public function get sfx():Sfx
Constructor Detail
SfxFader()Constructor
public function SfxFader(sfx:Sfx, complete:Function = null, type:uint = 0)

Constructor.

Parameters
sfx:Sfx — The Sfx object to alter.
 
complete:Function (default = null) — Optional completion callback.
 
type:uint (default = 0) — Tween type.
Method Detail
crossFade()method
public function crossFade(play:Sfx, loop:Boolean, duration:Number, volume:Number = 1, ease:Function = null):void

Fades out the Sfx, while also playing and fading in a replacement Sfx.

Parameters

play:Sfx — The Sfx to play and fade in.
 
loop:Boolean — If the new Sfx should loop.
 
duration:Number — Duration of the crossfade.
 
volume:Number (default = 1) — The volume to fade in the new Sfx to.
 
ease:Function (default = null) — Optional easer function.

fadeTo()method 
public function fadeTo(volume:Number, duration:Number, ease:Function = null):void

Fades the Sfx to the target volume.

Parameters

volume:Number — The volume to fade to.
 
duration:Number — Duration of the fade.
 
ease:Function (default = null) — Optional easer function.