| Previous | Next | Frames | No Frames |
| Summary: Field | Property | Contructor | Method | Detail: Field | Property | Contructor | Method |
Object | +--com.mosesSupposes.fusefx.FuseFX
Field Summary | |
| public static |
VERSION: Number |
| Enables FuseFX version to be retrieved at runtime or when reviewing a decompiled swf. | |
Method Summary | |
| public static | getKeyList ( ): Array |
| Use to check which extension keys are registered. | |
| public static | register ( classReference: Function ): Void |
| Pass any number of extension classes that implement IFuseFX. | |
| public static var VERSION: Number |
Enables FuseFX version to be retrieved at runtime or when reviewing a decompiled swf.
|
|
Use to check which extension keys are registered.
|
|
|
Pass any number of extension classes that implement IFuseFX.
|
FuseFX extensions define new tweenable properties that will work with any target type via standard doTween calls. Management of extensions is automated — they are created by FuseFX and destroyed as tweens complete or when conflicting properties are tweened elsewhere.
To set up FuseFX, use the register method to register your extension classes.
import com.mosesSupposes.fuse.*; import com.mosesSupposes.fusefx.FuseFX; import com.mosesSupposes.util.*; ZigoEngine.register(PennerEasing,Fuse); FuseFX.register( MixerFX, TextFX ); ZigoEngine.doTween(my_txt, TextFX.SIZE, "10", 2, "easeInOutQuint"); myFuse.push({ target:mySound, volumeFX:100, time:2, ease:"easeInOutQuint" });The MixerFX extension claims the string "volumeFX" as its own, so whenever that property is tweened the extension will be used. The class MixerFX declares a static constantMixerFX.VOLUME = "volumeFX", and that constant can be used in tween calls to the engine to prevent typos. However, note that when writing Object-literals for Fuse actions, you must use the string value of the constant, as in the above example.How FuseFX works:
The ZigoEngine itself is not altered by the FuseFX system. When a MixerFX user tweens the property "volumeFX" on a Sound object, that property is still written into the Sound instance and tweened, as ZigoEngine would normally do. The MixerFX extension is simply wired to the tween's update event to add further functionality -- in this case, calling setVolume on the target object. Therefore FuseFX is not a replacement for a property tween, it's just a tidy way to decorate the results of the tween.
When registered, each extension lays claim to certain keywords (strings) returned from its defineProperties method. All properties tweened using the Fuse Kit are monitored via the engine's onTweenAdd event. If FuseFX sees the user tween any extension's keyword, it automates the process of generating an internal instance of the extension, wiring event listeners to the tween, then removing the listeners and deleting it when the tween completes. This way, extension classes can be quite simple: a setup method is called once at creation, an onTweenUpdate handler decorates tween functionality, and a destroy method is called just prior to deletion to allow any cleanup to be done.
Detailed notes for authoring extensions can be found in IFuseFX documentation.