Fusekit class Shortcuts

com.mosesSupposes.fuse

class Shortcutsflash

Object
  |
  +--com.mosesSupposes.fuse.Shortcuts
download pdf

What is the Fuse Kit?

com.mosesSupposes.fuse

class Shortcuts

Object
  |
  +--com.mosesSupposes.fuse.Shortcuts

 


class Shortcuts
extends Object

Pass this class to ZigoEngine.register or ZigoEngine.simpleSetup to enable tween-shortcut functionality and ‘easyfunc’ callback parsing.

Usage:
Example 1: You can use shortcut syntax without modifying prototypes or targets. 

import com.mosesSupposes.fuse.*;
import mx.transitions.easing.Elastic;
ZigoEngine.register(Shortcuts);

ZigoEngine.doShortcut(my_mc, 'brightOffsetTo', 100, 1, Elastic.easeOut);

Example 2: You can copy and remove shortcut methods to individual targets without modifying prototypes.

import com.mosesSupposes.fuse.*;
import mx.transitions.easing.Elastic;
ZigoEngine.register(Shortcuts);

ZigoEngine.initialize(my_mc);
my_mc.brightOffsetTo(200, 1, Elastic.easeOut);
//later...
ZigoEngine.deinitialize(my_mc);

Example 3: Use simpleSetup instead of register to modify prototypes for classic lmc_tween style usage. Remember that any setup command only needs to be called once at the beginning of your program.

import com.mosesSupposes.fuse.*;
ZigoEngine.simpleSetup(Shortcuts, PennerEasing);

my_mc.brightOffsetTo(200, 1, 'easeOutElastic');

// If you also pass FuseItem during simpleSetup,
// you can use Object Syntax with the tween shortcut:
my_mc.tween({ start_x:"-100", start_y:"-100", ease:"easeInOutBack", time:1.5 });

Shortcut methods are variations on ZigoEngine.doTween syntax and return a formatted string indicating properties successfully tweened. In each method listed below target refers to whatever MovieClip or TextField you wish to tween. 

Shortcut Properties:

If you’ve extended prototypes with ZigoEngine.simpleSetup, you may use these the same as normal properties like _x:

my_mc._brightness = 50;
  • _brightness (See brightnessTo)
  • _brightOffset (See brightOffsetTo)
  • _colorReset (See colorResetTo)
  • _colorTransform Accepts or returns a generic color-transform object with properties like ra, rb, etc. (See colorTransformTo)
  • _contrast (See contrastTo)
  • _fade A proxy for _alpha that sets _visible false for any value less than 50, typically used with 0 or 100 values.
  • _frame Sets or retrieves the current frame of a MovieClip’s timeline.
  • _invertColor (See invertColorTo)
  • _scale Sets _xscale and _yscale to the same value.
  • _size Sets _width and _height to the same value.
  • _tint Accepts 0x000000 or “#000000” formats. Returns a color-value number.
  • _tintPercent Sets or retrieves the tint percentage of a target that has had its color altered previously.
  • _tintString Like _tint, but returns a human-readable hex-string like “0xFF33FF” easily converted to a usable color value using Number().

Property-Tweening Shortcut Methods:

target.alphaTo (alpha:Object, seconds:Number, ease:Object, delay:Number, callback:Object):String

Tweens _alpha. Supports relative (string) end-value.

target.bezierTo (x:Object, y:Object, controlX:Object, controlY:Object, seconds:Number, ease:Object, delay:Number, callback:Object):String

Generates a simple curved path. Supports relative (string) values; use "0" for x or y to affect no change, use null for controlX or controlY to auto-center the control point. In this way a curve can be generated with only two values, like this arc that hops up-then-down while sliding right: my_mc.bezierTo("200","0",null,"-50");

target.fadeIn (seconds:Number, ease:Object, delay:Number, callback:Object):String

Automatically sets the target’s _visible property to true, then tweens _alpha to 100.

target.fadeOut (seconds:Number, ease:Object, delay:Number, callback:Object):String

Tweens _alpha to 0 then automatically sets the target’s _visible property to false.

target.frameTo (frame:Object, seconds:Number, ease:Object, delay:Number, callback:Object):String

MovieClip only: tweens the clip’s timeline to the desired frame.

target.rotateTo (rotation:Object, seconds:Number, ease:Object, delay:Number, callback:Object):String

Tweens _rotation. Supports relative (string) end-value, such as this counter-clockwise rotation: my_mc.rotateTo("-90");

target.scaleTo (scale:Object, seconds:Number, ease:Object, delay:Number, callback:Object):String

Tweens _xscale and _yscale to the same value. Supports relative (string) end-value.

target.sizeTo (size:Object, seconds:Number, ease:Object, delay:Number, callback:Object):String

Tweens _width and _height to the same value. Supports relative (string) end-value.

target.slideTo (x:Object, y:Object, seconds:Number, ease:Object, delay:Number, callback:Object):String

Tweens _x and _y. Supports relative (string) values; use "0" or null to affect no change for either coordinate. 

Color-Tweening Shortcut Methods:

target.brightnessTo (brightness:Object, seconds:Number, ease:Object, delay:Number, callback:Object):String

Tweens brightness between -100 (black), 0 (normal) and 100 (white)

target.brightOffsetTo (brightOffset:Object, seconds:Number, ease:Object, delay:Number, callback:Object):String

Tweens a burn effect between -100 (black), 0 (normal) and 100 (white)

target.colorTo (rgb:Object, seconds:Number, ease:Object, delay:Number, callback:Object):String

Tweens a clip’s color. Accepts 0x000000 or “#000000” formats.

target.colorResetTo (percent:Object, seconds:Number, ease:Object, delay:Number, callback:Object):String

Use 100 to fully restore a target’s colors to normal. (For most color effects a positive number less than 100 can be passed to affect a partial change.)

target.colorTransformTo (ra:Object, rb:Object, ga:Object, gb:Object, ba:Object, bb:Object, aa:Object, ab:Object, seconds:Number, ease:Object, delay:Number, callback:Object):String

Tweens specific properties of a color-transform. Supports relative (string) values or pass null to affect no change on that property. The “a” values are percentages while “b” values are -255 to 255 offsets.

target.contrastTo (level:Object, seconds:Number, ease:Object, delay:Number, callback:Object):String

Tweens photo contrast between 0 (gray), 100 (normal), or higher (200 for extreme contrast, higher to posterize image). Supports relative (string) end-value.

target.invertColorTo (percent:Object, seconds:Number, ease:Object, delay:Number, callback:Object):String

Photo-negative effect from 0-100. Supports relative (string) end-value.

target.tintTo (rgb:Object, percent:Object, seconds:Number, ease:Object, delay:Number, callback:Object):String

Similar to colorTo, with a tint-percentage value in the second parameter. Supports relative (string) end-value for percentage.

target.tintPercentTo (percent:Object, seconds:Number, ease:Object, delay:Number, callback:Object):String

Tweens the tint percentage of a target that has had its color altered previously. Supports relative (string) end-value. 

Tween Control Methods:

(see similar methods in ZigoEngine for additional info.)

target.tween (props:Object, endVals:Object, seconds:Number, ease:Object, delay:Number, callback:Object):String
target.removeTween (props:Object):Void
target.removeAllTweens ():Void
target.isTweening (prop:String):Boolean
target.getTweens():Number
target.lockTween():Void
target.unlockTween():Void
target.isTweenLocked():Boolean
target.isTweenPaused(prop:String):Boolean
target.pauseTween (props:Object):Void
target.resumeTween (props:Object):Void
target.pauseAllTweens ():Void
target.resumeAllTweens ():Void
target.ffTween (props:Object):Void
target.rewTween (props:Object,suppressStartEvents:Boolean):Void
target.rewAndPauseTween (props:Object,suppressStartEvents:Boolean):Void
target.skipTweenTo (second:Number,props:Object):Void

Legacy Methods:

(retained for compatibility with earlier versions)

target.stopTween (props:Object):Void
target.stopAllTweens ():Void
target.unpauseTween (props:Object):Void
target.unpauseAllTweens ():Void

FuseFMP tweening shortcuts

For use with FuseFMP and ZigoEngine.simpleSetup (prototype extension) only. The format follows the convention short-filtername+”_”+filter property+”To”.

// example:
import com.mosesSupposes.fuse.*;
ZigoEngine.simpleSetup(Shortcuts, PennerEasing, FuseFMP);
my_mc.DropShadow_angleTo("45", 2, "easeOutElastic");

Bevel_angleTo
Bevel_blurTo
Bevel_blurXTo
Bevel_blurYTo
Bevel_distanceTo
Bevel_highlightAlphaTo
Bevel_shadowAlphaTo
Bevel_strengthTo
Blur_blurTo
Blur_blurXTo
Blur_blurYTo
Convolution_alphaTo
Convolution_colorTo
DisplacementMap_alphaTo
DisplacementMap_colorTo
DropShadow_alphaTo
DropShadow_angleTo
DropShadow_blurTo
DropShadow_blurXTo
DropShadow_blurYTo
DropShadow_colorTo
DropShadow_distanceTo
DropShadow_strengthTo
Glow_alphaTo
Glow_blurTo
Glow_blurXTo
Glow_blurYTo
Glow_colorTo
Glow_strengthTo
GradientBevel_angleTo
GradientBevel_blurTo
GradientBevel_blurXTo
GradientBevel_blurYTo
GradientBevel_distanceTo
GradientBevel_strengthTo
GradientGlow_angleTo
GradientGlow_blurTo
GradientGlow_blurXTo
GradientGlow_blurYTo
GradientGlow_distanceTo
GradientGlow_strengthTo

FuseFMP Shortcut Methods

(see similar methods in FuseFMP for additional info.)

target.getFilterName(instance:BitmapFilter);
target.getFilterIndex(filter:Object);
target.getFilter(filter:Object, createNew:Boolean);
target.writeFilter(filter:Object, propsObj:Object);
target.removeFilter(filter:Object);
target.getFilterProp(propname:String, createNew:Boolean);
target.setFilterProp(propname:Object, value:Object);
target.setFilterProps(filterOrPropsObj:Object, propsObj:Object);
target.traceAllFilters();

FuseFMP Shortcut Properties: Blur_blurX, etc.

FuseFMP property formatting follows the convention: short-filtername+”_”+filter property. 
Example with ZigoEngine.register (see FuseFMP for more info):

import com.mosesSupposes.fuse.*;
import mx.transitions.easing.Elastic;
ZigoEngine.register(Shortcuts, FuseFMP);
ZigoEngine.doTween(my_mc, "DropShadow_angle", "45", 2, Elastic.easeOut);

If ZigoEngine.simpleSetup is used you may also get/set properties directly on a target:

my_mc.DropShadow_angle = 105;

(Note that this is an optional feature of FuseFMP that may be used without ZigoEngine.) 

Bevel_type
Bevel_blurY
Bevel_blurX
Bevel_blur
Bevel_knockout
Bevel_strength
Bevel_quality
Bevel_shadowAlpha
Bevel_shadowColor
Bevel_highlightAlpha
Bevel_highlightColor
Bevel_angle
Bevel_distance
Blur_quality
Blur_blurY
Blur_blurX
Blur_blur
ColorMatrix_matrix
Convolution_alpha
Convolution_color
Convolution_clamp
Convolution_preserveAlpha
Convolution_bias
Convolution_divisor
Convolution_matrix
Convolution_matrixY
Convolution_matrixX
DisplacementMap_alpha
DisplacementMap_color
DisplacementMap_mode
DisplacementMap_scaleY
DisplacementMap_scaleX
DisplacementMap_componentY
DisplacementMap_componentX
DisplacementMap_mapPoint
DisplacementMap_mapBitmap
DropShadow_hideObject
DropShadow_strength
DropShadow_blurY
DropShadow_blurX
DropShadow_blur
DropShadow_knockout
DropShadow_inner
DropShadow_quality
DropShadow_alpha
DropShadow_color
DropShadow_angle
DropShadow_distance
Glow_strength
Glow_blurY
Glow_blurX
Glow_blur
Glow_knockout
Glow_inner
Glow_quality
Glow_alpha
Glow_color
GradientBevel_type
GradientBevel_knockout
GradientBevel_strength
GradientBevel_quality
GradientBevel_blurY
GradientBevel_blurX
GradientBevel_blur
GradientBevel_ratios
GradientBevel_alphas
GradientBevel_colors
GradientBevel_angle
GradientBevel_distance
GradientGlow_type
GradientGlow_knockout
GradientGlow_strength
GradientGlow_quality
GradientGlow_blurY
GradientGlow_blurX
GradientGlow_blur
GradientGlow_ratios
GradientGlow_alphas
GradientGlow_colors
GradientGlow_angle
GradientGlow_distance

Methods and properties of this class are excluded here – see class file for further documentation.

 

 

Author:
Moses Gunesch / MosesSupposes.com (shortcut syntax created by Zeh Fernando, Ladislav Zigo, others)

 

Version:
2.1

Leave a Reply