Method Summary |
public
| addTween (
target: Object, prop: String, endval: Object
): Boolean |
| Setup, called just prior to tweening. Do NOT use addListener(this) on the target.
|
|
public
| defineProperties (
): Array |
| Used by FuseFX during register. Associates tweenable property strings to this extension and identifies conflicts with other tweenable properties.
|
|
public
| destroy (
target: Object
): Void |
| Cleanup, called just prior to deletion. Listeners are automatically removed by FuseFX.
|
|
public
| onTweenUpdate (
o: Object
): Void |
| Perform tween updates. Do NOT add a listener to the target, FuseFX does this for you.
|
|
|
Approach A primary advantage of FuseFX is that it allows you to choose which target makes the most intuitive sense to tween on. For example, TextFX works by tweening directly on a TextField, while actually updating the TextField's associated TextFormat. This is great for the user because it's incredibly direct. In reality though, it exploits ActionScript 2.0's loose protections by intrusively modifying a presumably final class, such as sticking a new public variable called volumeFX into a Sound object. (Remember that FuseFX extensions decorate, but do not replace, standard ZigoEngine tweens.)
Many systems in AS2.0, even the official EventDispatcher class, write properties into target objects, but it does bend the rules and presents some risk of harming a target object, like you could overwrite an internal property of the target class. So when authoring FuseFX extensions, try to remain as non-disruptive and non-intrusive as possible and of course, don't leave a mess. These examples use ASSetPropFlags calls to hide these injected properties from for-in loops, then strip the properties back out of the target on tween completion.
General rules
FuseKitCommon.outputmethod instead of trace. This keeps the Fuse Kit configurable for any logging program.