![]() | ![]() |
Distributed under MIT Open Source License, see Fuse-Kit-License.html (in fuse package directory) Easing Equations (c) 2003 Robert Penner used by permission, see PennerEasing Visit http://www.mosessupposes.com/Fuse
Pass this class to com.mosesSupposes.fuse.ZigoEngine#register or com.mosesSupposes.fuse.ZigoEngine#simpleSetup to enable tween-shortcut functionality and 'easyfunc' callback parsing. 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);
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);
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 });
target refers to whatever MovieClip or TextField you wish to tween.
target.alphaTo (alpha:Object, seconds:Number, ease:Object, delay:Number, callback:Object):StringTweens
_alpha. Supports relative (string) end-value. target.bezierTo (x:Object, y:Object, controlX:Object, controlY:Object, seconds:Number, ease:Object, delay:Number, callback:Object):StringGenerates 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):StringAutomatically sets the target's
_visible property to true, then tweens _alpha to 100. target.fadeOut (seconds:Number, ease:Object, delay:Number, callback:Object):StringTweens
_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):StringMovieClip only: tweens the clip's timeline to the desired frame.
target.rotateTo (rotation:Object, seconds:Number, ease:Object, delay:Number, callback:Object):StringTweens
_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):StringTweens
_xscale and _yscale to the same value. Supports relative (string) end-value. target.sizeTo (size:Object, seconds:Number, ease:Object, delay:Number, callback:Object):StringTweens
_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):StringTweens
_x and _y. Supports relative (string) values; use "0" or null to affect no change for either coordinate.
target.brightnessTo (brightness:Object, seconds:Number, ease:Object, delay:Number, callback:Object):StringTweens brightness between -100 (black), 0 (normal) and 100 (white)
target.brightOffsetTo (brightOffset:Object, seconds:Number, ease:Object, delay:Number, callback:Object):StringTweens a burn effect between -100 (black), 0 (normal) and 100 (white)
target.colorTo (rgb:Object, seconds:Number, ease:Object, delay:Number, callback:Object):StringTweens a clip's color. Accepts 0x000000 or "#000000" formats.
target.colorResetTo (percent:Object, seconds:Number, ease:Object, delay:Number, callback:Object):StringResets a color-transformed clip in a range between 0 (no change from current transform) and 100 (full reset)
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):StringTweens 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):StringTweens 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):StringPhoto-negative effect from 0-100. Supports relative (string) end-value.
target.tintTo (rgb:Object, percent:Object, seconds:Number, ease:Object, delay:Number, callback:Object):StringSimilar 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):StringTweens the tint percentage of a target that has had its color altered previously. Supports relative (string) end-value.
(see similar methods in com.mosesSupposes.fuse.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
(retained for compatibility with earlier versions)
target.stopTween (props:Object):Void
target.stopAllTweens ():Void
target.unpauseTween (props:Object):Void
target.unpauseAllTweens ():Void
For use with FuseFMP and com.mosesSupposes.fuse.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
If you've extended prototypes with com.mosesSupposes.fuse.ZigoEngine#simpleSetup, you may use these the same as normal properties like _x:
my_mc._brightness = 50;
_scale Sets _xscale and _yscale to the same value. _size Sets _width and _height to the same value. _frame Sets or retrieves the current frame of a MovieClip's timeline. _tint Accepts 0x000000 or "#000000" formats. Returns a human-readable hex-string like "0xFF33FF"Number(). _tintPercent Sets or retrieves the tint percentage of a target that has had its color altered previously. _brightness (See brightnessTo) _brightOffset (See brightOffsetTo) _invertColor (See invertColorTo) _colorReset (See colorResetTo) _contrast (See contrastTo) _colorTransform Accepts or returns a generic color-transform object with properties like ra, rb, etc. (See colorTransformTo)
com.mosesSupposes.fuse.FuseFMP property formatting follows the convention: short-filtername+"_"+filter property.
Example with com.mosesSupposes.fuse.ZigoEngine#register (see com.mosesSupposes.fuse.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 com.mosesSupposes.fuse.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 com.mosesSupposes.fuse.FuseFMP that may be used without ZigoEngine.)
Methods and properties of this class are excluded here - see class file for further documentation.
Definition at line 201 of file Shortcuts.as.
Static Public Member Functions | |
| static function | initialize () |
| static function | doShortcut (obj:Object, methodName:String) |
| static function | addShortcutsTo () |
| static function | removeShortcutsFrom () |
| static function | parseStringTypeCallback (callbackStr:String) |
Static Public Attributes | |
| static var | registryKey:String = 'shortcuts' |
| static var | shortcuts:Object = null |
| static var | mcshortcuts:Object = null |
Static Private Member Functions | |
| static function | initShortcuts () |
| static function com.mosesSupposes.fuse.Shortcuts.initialize | ( | ) | [static] |
A relay that ensures initShortcuts has been called, also called by ZigoEngine.register() to ensure class is imported and retained.
Definition at line 225 of file Shortcuts.as.
| static function com.mosesSupposes.fuse.Shortcuts.doShortcut | ( | obj:Object | , | |
| methodName:String | ||||
| ) | [static] |
Enables shortcut syntax with doTween. (This idea thanks to Yotam Laufer)
| obj | target of tween | |
| methodName | method type to tween |
Definition at line 236 of file Shortcuts.as.
| static function com.mosesSupposes.fuse.Shortcuts.addShortcutsTo | ( | ) | [static] |
ZigoEngine uses this method to graft shortcut methods and properties into one or more target objects. accepts any number of target objects
Definition at line 263 of file Shortcuts.as.
| static function com.mosesSupposes.fuse.Shortcuts.removeShortcutsFrom | ( | ) | [static] |
ZigoEngine uses this method to strip shortcut methods and properties from one or more target objects. accepts any number of target objects
Definition at line 294 of file Shortcuts.as.
| static function com.mosesSupposes.fuse.Shortcuts.parseStringTypeCallback | ( | callbackStr:String | ) | [static] |
The "easyfunc" syntax feature of the Kit, in which a string version of a complete callback like "_root.gotoAndStop('home');" is parsed, is stored in the Shortcuts class. If an easyfunc string is passed when Shortcuts has not been registered, a warning message is thrown.
| callbackStr | complete version of the callback |
Definition at line 323 of file Shortcuts.as.
| static function com.mosesSupposes.fuse.Shortcuts.initShortcuts | ( | ) | [static, private] |
Internal method that writes all shortcuts into a memory object, creating fast access for copying the set or locating a specific method for a ZigoEngine.doShortcuts call.
Definition at line 386 of file Shortcuts.as.
var com.mosesSupposes.fuse.Shortcuts.registryKey [static] |
Unique identifier used by ZigoEngine.register
Definition at line 207 of file Shortcuts.as.
var com.mosesSupposes.fuse.Shortcuts.shortcuts [static] |
An internal memory object that stores all shortcut methods & properties for quick access.
Definition at line 213 of file Shortcuts.as.
var com.mosesSupposes.fuse.Shortcuts.mcshortcuts [static] |
An internal memory object that stores all MovieClip-specific shortcut methods & properties for quick access.
Definition at line 219 of file Shortcuts.as.
1.5.2