Main Page | Packages | Class Tree | Index | Help

com.mosesSupposes.fusefx

class FuseFX

Object
  |
  +--com.mosesSupposes.fusefx.FuseFX


class FuseFX
extends Object

Easily extend ZigoEngine with extension classes to add new tweenable properties

Usage:
There are three general approaches to extending the ZigoEngine. The most basic is subclassing your tween target class, as shown in the SoundPlus example. FuseFX defines new tweenable property names and provides a high degree of automation. A third option when neither of these is practical, such as extending existing MovieClip properties like _x, is to write a small tweenable class that acts as a surrogate tween target as in the ScreenWrap example.

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 constant MixerFX.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.


Author:
Moses Gunesch

Version:
0.2


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.



Field Documentation

VERSION

public static var VERSION: Number
Enables FuseFX version to be retrieved at runtime or when reviewing a decompiled swf.

Usage:
trace(FuseFX.VERSION); // if the version is incorrect, clear your ASO cache.


Method Documentation

getKeyList

public static function getKeyList(): Array
Use to check which extension keys are registered.

Usage:
trace('Registed extension keys:\n' + FuseFX.getKeyList().join('\n\t'));

Returns:
An alphabetized array list of successfully registered extension keys

register

public static function register(classReference: Function): Void
Pass any number of extension classes that implement IFuseFX.

Usage:
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.fusefx.MixerFX;
ZigoEngine.register(PennerEasing,Fuse);
FuseFX.register( MixerFX );


The documentation was generated from the following file: