| Package | net.flashpunk.tweens.sound |
| Class | public class SfxFader |
| Inheritance | SfxFader Tween Object |
| Property | Defined By | ||
|---|---|---|---|
![]() | active : Boolean
If the tween should update. | Tween | |
![]() | complete : Function
Tween completion callback. | Tween | |
![]() | delay : Number = 0
Length of time to wait before starting this tween. | Tween | |
![]() | percent : Number
The completion percentage of the Tween. | Tween | |
![]() | scale : 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 | ||
| Method | Defined By | ||
|---|---|---|---|
Constructor. | SfxFader | ||
![]() | cancel():void
Immediately stops the Tween and removes it from its Tweener without calling the complete callback. | Tween | |
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 | ||
![]() | start():void
Starts the Tween, or restarts it if it's currently running. | Tween | |
![]() | update():void
Updates the Tween, called by World. | Tween | |
| sfx | property |
sfx:Sfx [read-only] The current Sfx this object is effecting.
public function get sfx():Sfx| SfxFader | () | Constructor |
public function SfxFader(sfx:Sfx, complete:Function = null, type:uint = 0)Constructor.
Parameterssfx:Sfx — The Sfx object to alter.
| |
complete:Function (default = null) — Optional completion callback.
| |
type:uint (default = 0) — Tween type.
|
| crossFade | () | method |
public function crossFade(play:Sfx, loop:Boolean, duration:Number, volume:Number = 1, ease:Function = null):voidFades 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):voidFades 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.
|