メインページ | パッケージ | クラス構成 | 索引 | ヘルプ

com.mosesSupposes.fuse

ZigoEngineクラス

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


class ZigoEngine
extends Object

A robust central processing engine for all scripted tweens in a swf published to AS2.

使用法:
プロジェクト内で ZigoEngine を使う場合、以下のように準備します:
  • このクラスをインポートするだけで、doTween といったクラスメソッドが利用可能になります。
    - register を使えば、エンジンをさらに便利に拡張させることもできます。
  • あるいは、simpleSetup を使うだけでも、ムービークリップやボタン、テキストフィールドに alphaTo のようなトゥイーンショートカットを追加することができます。

Extending prototypes is entirely optional in this version - all Shortcut functionality is excluded from the core engine class.

Events dispatched by ZigoEngine (see addListener for more info):
  • onTweenInterrupt
Events dispatched by individual target objects (see ZManager for more info):
  • onTweenStart
  • onTweenUpdate
  • onTweenEnd

制作者:
Moses Gunesch / MosesSupposes.com / ZigoEngine based on concepts by Ladislav Zigo, Zeh Fernando
バージョン:
2.0.5

Field Summary

public static
AUTOSTOP: Boolean
(Legacy) Option to stop all tweening props in target as a new tween is added.

public static
DURATION: Number
Default tween duration if unspecified.

public static
EASING: Object
Default easing if unspecified.

public static
OUTPUT_LEVEL: Number
Controls how much feedback the engine outputs, helpful for debugging.

public static
ROUND_RESULTS: Boolean
If set true the engine always rounds its math (helpful with pixelfonts).

public static
SKIP_LEVEL: Number
(Advanced) Sets default engine behavior for situations where tweens fail to affect a visible change or have no duration.

public static
TIME_MULTIPLIER: Number
Debug feature: Skips, speeds up, or slows all tweens globally. All time values in ZigoEngine and Fuse are multiplied by this number.

public static
VERSION: String
Enables kit version to be retrieved at runtime or when reviewing a decompiled swf.

Method Summary

public static
addListener ( handler: Object ): Void
(Advanced) Use this method to add a listener for "onTweenInterrupt" event, which is broadcast directly by the engine.

public static
deinitialize ( target: Object ): Void
(Advanced) Clears targets from being used with the engine.

public static
doShortcut ( targets: Object, methodName: String ): String
An alternative to doTween that accepts Shortcut syntax. Requires registration of the Shortcuts class.

public static
doTween ( targets: Object, props: Object, endvals: Object, seconds: Number, ease: Object, delay: Number, callback: Object ): String
Generates and immediately begins one or more property-tweens running on one or more targets.

public static
ffTween ( targs: Object, props: Object, suppressEndEvents: Boolean ): Void
Fast-forwarding a tween ends it and removes it from the engine.

public static
getColorKeysObj ( targOrTransObj: Object ): Object
(General) Provides readings by keyword for a target object or Flash7-style color-transform object.

public static
getColorTransObj ( type: String, amt: Number, rgb: Object ): Object
(General) Generates a generic Flash7-style color-transform object with props like ra, etc., by keyword.

public static
getControllerDepth ( ): Number
Depth of the ZigoEnginePulse clip.

public static
getTweens ( targ: Object ): Number
Returns the number of tweens active in a target object.

public static
getUpdateInterval ( ): Number


public static
initialize ( target: Object ): Void
(Advanced) Prepares targets for use with engine.

public static
isPlaying ( ): Boolean
Returns true if the engine contains tweens and is running updates on a pulse

public static
isTweening ( targ: Object, prop: String ): Boolean
Test if a target and optionally a specific property is being handled by the engine.

public static
isTweenLocked ( targ: Object ): Boolean
Locks tweens and prevents from running until tween is unlocked.

public static
isTweenPaused ( targ: Object, prop: String ): Boolean
Test whether any or a specific property is paused in a target object

public static
lockTween ( targ: Object, setLocked: Boolean ): Void
Locks a target to prevent tweens from running until target is unlocked.

public static
pauseTween ( targs: Object, props: Object ): Void
Pause one or more tweens

public static
register ( classReference: Function ): Void
An optional setup command that registers additional classes for use with the ZigoEngine.

public static
removeListener ( handler: Object ): Void
Remove a listener for onTweenInterrupt event

public static
removeTween ( targs: Object, props: Object ): Void
Remove specific or all tweening properties from specific or all tweening targets in engine.

public static
resumeTween ( targs: Object, props: Object ): Void
Unpause one or more tweens.

public static
rewTween ( targs: Object, props: Object, pauseFlag: Boolean, suppressStartEvents: Boolean ): Void
Rewinds and either pauses or restarts one or more tweens

public static
setColorByKey ( targetObj: Object, type: String, amt: Number, rgb: Object ): Void
(General) Color-transforms a target by keyword.

public static
setControllerDepth ( depth: Number ): Void
Creates a clip in the _root timeline called "ZigoEnginePulse" or sets its depth

public static
setUpdateInterval ( time: Number ): Void
When set, the engine will run on a setInterval pulse instead of a frame pulse.

public static
simpleSetup ( shortcutsClass: Function ): Void
An alternative setup command that extends prototypes with shortcuts like alphaTo.

public static
skipTweenTo ( seconds: Number, targs: Object, props: Object ): Void
Jumps a tween to a specific point in its duration.

public static
unpauseTween ( targs: Object, props: Object ): Void
Legacy - see resumeTween



Field Documentation

AUTOSTOP

public static var AUTOSTOP: Boolean
(旧式)あるターゲットに対して、新規にトゥイーンが追加設定された時に、それまでの全トゥイーンプロパティをストップさせるためのオプションです。

DURATION

public static var DURATION: Number
(インスタンスレベルで)指定がない場合の、デフォルトのトゥイーン時間です。
使用法:
// 先頭で一度設定しておけば、以後はエンジンのデフォルトとして反映されます。
ZigoEngine.DURATION = .5;

EASING

public static var EASING: Object
(インスタンスレベルで)指定がない場合の、デフォルトのイージングです。
このデフォルト設定は、エンジン内部にハードコードされていますので、 PennerEasing クラスの登録は必要ありません。しかしながら、 "easeOutQuad" といったストリングで指定したい場合は、クラスを登録する必要があります。 また、 ( mx.transitions.easing のような)標準のイージング関数を設定することも可能です。
使用法:
// PennerEasing の使用例
ZigoEngine.register(PennerEasing);
ZigoEngine.EASING = 'easeInOutExpo';
 
// あるいは - MX 標準のトゥイーンの使用例
import mx.transitions.easing.Elastic;
ZigoEngine.EASING = Elastic.easeOut;

OUTPUT_LEVEL

public static var OUTPUT_LEVEL: Number
エンジンからの出力結果をコントロールできるので、デバッグ時の助けとなるでしょう。
使用法:
ZigoEngine.OUTPUT_LEVEL = 2;
  • 0 = 何も出力されません
  • 1 = 通常のエラー&警告を出力
  • 2 = 追加情報も出力

ROUND_RESULTS

public static var ROUND_RESULTS: Boolean
true に設定すれば、エンジンは、常に数値を整数に丸めてくれるようになります。(ピクセルフォントを使う際に役立ちます)
この機能を使うと、数値を丸める分だけ、アニメーションの質とパフォーマンスは下がりますが、プロジェクトによっては、数値を丸める必要があるケースも想定されます。そういう時には true にしてみましょう。
使用法:
// 先頭で一度設定しておけば、以後はエンジンのデフォルトとして反映されます。
ZigoEngine.ROUND_RESULTS = true;

SKIP_LEVEL

public static var SKIP_LEVEL: Number

(Advanced) トゥイーンによる見かけ上の変化がない場合や、トゥイーン時間が0秒の場合のエンジンの振る舞いのデフォルト設定です。

使用法:
// プログラム先頭部で設定し直せば、以降のエンジンのデフォルト値を上書き変更できます。
ZigoEngine.SKIP_LEVEL = 2;
1. 時間なしトゥイーン:
トゥイーン時間を0秒に指定し、即座にプロパティを設定する場合や、待機時間の後、即座にプロパティ設定する場合があります。
この手法にはメリット・デメリットがあります。 It is recommended that you purposefully use 0-second tweens to set properties that are handled by the engine at any time in your program, since this will effectively stop any potentially running tweens on that property. (Trying to set a property while it is being tweened usually has no effect.) However in some dynamic programs you may want tweens that end up having no duration to also skip their delay and/or callbacks and events - this can be controlled with SKIP_LEVEL.

2. 変化なしトゥイーン:
開始時と終了時で、見かけ上の変化がないようなトゥイーンになる場合もあります。通常、エンジンは、以前のバージョンと同様に、見かけ上の変化のないトゥイーンでも、とにかくトゥイーンを実行するようになっています。これには良い点(プログラムのシーケンスが時間通り継続される)と、悪い点(トゥイーンによる変化は見えないのに、コールバックや、イベントの開始・終了は実行されるので、混乱を招くがあります。また、見かけ上の変化がないようなトゥイーンは処理をスキップしたいという場合もあるかと思います。

デフォルト値となる SKIP_LEVEL 設定(トゥイーンごとに設定できる skipLevel パラメーター( doTween をご覧下さい)もあります)を使えば、そのような状況でのエンジンの振る舞いを、より詳細に設定できます。
  • 0= 「デフォルト」
    変化なしトゥイーンでも、設定された通りのトゥイーン時間、待機時間、コールバック/イベントの全てを実行します。
  • 1=「変化なしトゥイーンはスキップ」
    変化のないようなトゥイーンは(待機時間もトゥイーン時間も含め、)全て無視されます。コールバック/イベントは即座に実行されます。時間なしトゥイーンの時は、待機時間を無視し、即座にプロバティが設定されます。
  • 2=「変化なしトゥイーンや時間なしトゥイーンは、コールバック/イベントも実行しない」
    変化なしトゥイーンの全てを無視します。時間なしトゥイーンの時は、待機時間を無視し、即座にプロパティが設定されます。

To review what property tweens were successfully added, doTween returns a formatted list.

TIME_MULTIPLIER

public static var TIME_MULTIPLIER: Number
デバッグ機能として利用:全トゥイーンをスキップ・スピードアップ・スピードダウンさせることができます。ZigoEngine と Fuse の時間に関する値全てに対して、この数が乗算されます。

トゥイーン時間や待機時間をはじめ、全ての時間関連の値に影響します。

この設定を変更した時は、(ZigoEngine.OUTPUT_LEVEL が0になっていなければ、)次のトゥイーンを開始する前に、 出力ウィンドウ上に [ ZigoEngine.TIME_MULTIPLIER: 20% ] という風に、状況を出力してくれます。

0に設定すると、全てのアニメーションをスキップします。Fuse.fastForward とは違って、トゥイーン時間が0秒に設定されるだけなので、コールバックやトゥイーン関連のイベントは全て実行されます。SKIP_LEVEL 設定によっては、プログラム中での振る舞いが変わってきますのでご注意下さい。

0 から 1 までの値にすると、設定したトゥイーン時間よりも速くなります。パーセンテージで考えると理解しやすいでしょう。例えば .25 にすると、もとのトゥイーン時間の 25% に減ることになるので、トゥイーンの速度は速くなります。

1 以上の値にすると、トゥイーンはゆっくりになります。例えば、2にすると、トゥイーンの速度は半分になります。

使用法:
// プログラム先頭で設定すれば、以降のエンジンのデフォルト設定に反映されます。
ZigoEngine.TIME_MULTIPLIER = .5; // 全てのトゥイーンを倍速で再生します

(advanced) Note that for more complex debugging of Fuse sequences you may want to set this property inline during the sequence. Example:
var testMode:Boolean = true;
function setTimeMultiplier(mult:Number):Void {
	if (testMode==true) ZigoEngine.TIME_MULTIPLIER = mult;
}
var f:Fuse = new Fuse();
f.scope = this;
// start sequence skipping through all tweens..
f.push({ func:setTimeMultiplier, args:0 });
// later in sequence return to normal speed..
f.push({ func:setTimeMultiplier, args:1 });
// etc.

VERSION

public static var VERSION: String
ランタイム時や swf をデコンパイルした際に、FuseKit のバージョンを確認する事ができます。
使用法:
trace(ZigoEngine.VERSION); // if the version is incorrect, clear your ASO cache.

Method Documentation

addListener

public static function addListener(handler: Object): Void
(Advanced) Use this method to add a listener for "onTweenInterrupt" event, which is broadcast directly by the engine.
使用法:
The "onTweenInterrupt" event is fired in the following situations:
  • A target goes missing, for instance if a MovieClip was removed during a tween.
  • Another tween call overwrote one or more property tweens in progress
  • A removeTween call stopped one or more tweens in progress.
  • A target is deinitialized from the engine during tweens
This event is special in that it is dispatched directly by the ZigoEngine class, unlike target-events such as onTweenEnd (see: ZManager for more info). This ensures the event is fired even when targets go missing and are thus unable to dispatch the event. To aid in tracking targets in that situation, the internal __zigoID__ property for each target is also passed in the event object. Any initialized/tweening target contains this read-only property, making it possible to advance-query then later identify targets after they're removed.
var myListener:Object = {
	onTweenInterrupt:function(o:Object):Void {
		trace("Interruption detected:");
		trace(" -target (may not exist if removed):"+o.target);
		trace(" -target id:"+o.__zigoID__);
		trace(" -properties interrupted:"+(o.props).toString());
	}
};
ZigoEngine.addListener(myListener);
ZigoEngine.doTween(my_mc,"_alpha",0,2);
// click the mouse during the tween to receive the event.
function onMouseDown():Void {
	my_mc.removeMovieClip();
}
引数:
handler
the function or object that should be called

deinitialize

public static function deinitialize(target: Object): Void
(Advanced) ターゲットのエンジンへの関連付けをクリアします。
Removes AsBroadcaster functionality (and tweening shortcuts if the Shortcuts class was registered) from any object previously initialized using initialize.

引数:
target
One or more targets to initialize, or nothing/null to deinitialize base prototypes (for example to undo simpleSetup)
See also:

doShortcut

public static function doShortcut(targets: Object,
 methodName: String): String
doTween の代わりに使用でき、ショートカットシンタックスを指定できます。Requires registration of the Shortcuts class.
Yotam Laufer 氏の助言に感謝します。使用例:
ZigoEngine.doShortcut(my_mc, 'scaleTo', 200, 1, 'easeOutQuad');
See ZigoEngine introduction for instructions on registering Shortcuts to enable this feature.
引数:
targets
トゥイーン対象のオブジェクト、またはターゲットオブジェクトを格納した配列
methodName
ショートカットは "alphaTo" のような文字列で指定します。followed by parameters that follow that shortcut's format.
返り値:
A comma-delimited string of props successfully added. When multipe targets were passed, a pipe-delimited series is returned to enable verification of individual properties per target.

doTween

public static function doTween(targets: Object,
 props: Object,
 endvals: Object,
 seconds: Number,
 ease: Object,
 delay: Number,
 callback: Object): String
Generates and immediately begins one or more property-tweens running on one or more targets.
ZigoEngine.doTween(my_mc, '_x,_y', [100,150], 1, Strong.easeInOut);
Fuse-style Object Syntax may also be used if the FuseItem class is registered:
ZigoEngine.doTween({ target:my_mc, start_alpha:0, y:150, ease:Strong.easeInOut });
引数:
targets
Tween target object or array of target objects
props
String like "_x", comma-delimited list of properties like "_x,_y", or Array of properties like ["_x","_y"].
The engine accepts any existing property in the target including custom variables, and the following special properties:
  • _scale Sets _xscale and _yscale to the same value.
  • _size Sets _width and _height to the same value.
  • _frame Tweens a MovieClip's timeline to a frame using easing specified.
  • _tint Accepts 0x000000 and "#000000" formats, null (full reset), or object {tint:Number/null/hexString, percent:Number/String}.
  • _tintPercent Value range 0-100
  • _brightness Value range 0-100
  • _brightOffset Burn effect. -100=black, 0=normal, 100=white
  • _invertColor Value range 0-100
  • _colorReset Value range is current tint - 100. Acts like the opposite of tintPercent where 100 is a full reset.
  • _contrast 0=gray, 100=normal, 200=high-contrast, higher=posterized
  • _colorTransform Generic object in Flash7 transform format {ra:,rb:,etc.}
  • _bezier_ Generic object with some or all of the properties {x:,y:,controlX:,controlY:}. Relative (string) values are okay. Note that only one control param is necessary to generate a curved motion path, simply omit other values.
    Example - swoop up then down while sliding right:
    ZigoEngine.doTween(clip1, "_bezier_", {x:"100",controlY:"-25"});
When FuseFMP is registered, a large number of BitmapFilter properties are tweenable:
  • Blur_blurX, etc. Format follows the convention short-filtername+"_"+filter property.
endvals
tween end-value or Array of corresponding end-values. A single end-value can be used with multiple properties.
Accepts various formats:
  • Number A normal absolute end-value. Tweening _x to 10 in the main timeline moves it to 10px from the left edge of the stage.
  • String - Relative values: Passing a string version of a number like "10" or "-10" calculates end-value as relative to the start position of the tween.
    Examples: Tweening _x to "10" moves the clip 10px to the right of its current position.
    Tweening _rotation to a negative string value like "-90" affects a counter-clockwise spin.
  • Bezier, tint, or color-transform object See _bezier_, _colorTransform, _tint properties above.
  • *
  • Multi-value Object or Array - (Advanced) A new feature is the ability to directly tween multiple values in an Object or Array. Note that like any custom variables these objects must exist prior to tweening and have their properties set to numerical values in advance.
    var myObj:Object = {x:0,y:0,z:0}; ZigoEngine.doTween(this, "myObj", { x:1, y:2, z:3 });

    Note also that because this parameter already accepts an Array for multiple end-values, you must wrap it in a second Array:
    var myArray:Array = [ 0, 0 ]; ZigoEngine.doTween(this, "myArray", [[10,20]]);
  • Colors Array - (Advanced) Tweening a generic array of color values can help with situations like tweening the properties of a gradient fill that's redrawn on tween update. Any array whose name contains 'colors' (case is ignored) will be handled by the engine as an array of color values. Note that the internal colortransforms are not applied to any target, simply updated within the array.
    Example: ZigoEngine.doTween(this, "myColors", [[ 0x000000, 0xFFFFFF ]], 1, null, 0, { scope:this, updfunc:'redrawGradient' });

(advanced) Example of tweening a Matrix object to move and skew a clip (Flash 8 required):
import com.mosesSupposes.fuse.*;
import flash.geom.Matrix;
import flash.geom.Transform;
ZigoEngine.register(PennerEasing);
var myMatrix:Matrix = new Matrix();
var boxTrans:Transform = new Transform(box);
function applyMatrixTrans():Void { boxTrans.matrix = myMatrix; }
ZigoEngine.doTween(	this, "myMatrix", {a:.5, c:.5, tx:200 },
1, 'easeOutBounce', 0, {updfunc:applyMatrixTrans});
seconds
tween duration. If nothing is passed, defaults to ZigoEngine.DURATION.
ease
Accepts a number of formats based on which features are registered:
  • function - like mx.transitions.easing.Strong.easeInOut
  • shortcut-string - "easeInOutQuint" or any other function name from PennerEasing
  • Array generated by the Custom Easing Tool. (This special panel is installed into Flash when you install the Fuse Kit v2.0.5 or later MXP extension). Note that the CustomEasing class must be registered to use this feature.
  • null or nothing - defaults to ZigoEngine.EASING if set, or PennerEasing.easeOutQuint, which is hardcoded in the engine as a default fallback.
delay
seconds to wait before performing the tween. Start callback and onTweenStart event are fired at end of delay.
callback
function, string, or object

The kit tries to parse callbacks in many formats. Note that for callbacks to execute successfully in many cases it is crucial that a "this" scope is defined in which to locate and fire the function. Although the engine often successfully locates your callbacks, the recommended option is Callback Object, which is the most stable and flexible, demands the least parsing, and allows you to most clearly define scope, as well as providing additional tween options.
  1. Function
    ZigoEngine.doTween(mc,"_x",100,1,"linear",0, myCallback);
    • Reference: myCallback
    • String: "myCallback"
    • Inline: function(){ ... }
    • Delegate: mx.utils.Delegate.create(....) - adds scope
  2. Easyfunc String (Shortcuts must be registered to use this feature)
    ZigoEngine.doTween(mc,"_x",100,1,"linear",0, "this.myCallback(true);");
    • example: "trace('The tween is finished');"
    • Supports complex scope and many datatypes for argument params:
      "myscope.myscope.myfunc(true,1,'hello',{paramA:1,paramB:false,[0,1],null);"
    • You may also use easyfunc strings in callback objects (below) for start, update and end callbacks.
    • Limitations: Easyfunc strings are not a good option for class authoring. They work well when coding in frames of the _root timeline and enhance the Shortcuts paradigm. When a callback resides in a frame of a subclip's timeline, the easyfunc string should contain an absolute path to the function. For instance if clip1 exists in the _root timeline and houses the function myCallback, use "clip1.myCallback();".

      A somewhat impractical workaround for class authors is to set a local reference like var t:MyClass=this; preceding an easyfunc like "t.myMethod();", which exploits scope-chain during eval. Again, Callback Objects are recommended for OO coders.
  3. Callback Object ZigoEngine.doTween(clip1,"_x","100",1,"easeOutQuad",0, {scope:this, func:"myCallback", args:true});
    ZigoEngine.doTween(clip2,"_x","100",1,"easeOutQuad",0, { cycles:2 }); // yoyo back once
    • func Function, string name of function, or Easyfunc string like "myClip.doSomething(true);" (Shortcuts must be registered to use the Easyfunc feature.)
    • scope The "this" object in which to locate and fire the callback. Not always required but recommended if the engine cannot locate the callback or fires the wrong function.
    • args One argument or an array of arguments to pass to the func callback.
    • startfunc Callback fired after any delay and as tween is starting. Supports various formats - see func above.
    • startscope Specific scope for the startfunc callback. If not defined, the scope property will be used.
    • startargs One argument or an array of arguments to pass to the startfunc callback.
    • updfunc Callback fired on engine pulse as the tweens in the action are updated. Accepts various formats - see func above.
    • updscope Specific scope for the updfunc callback. If not defined, the scope property will be used.
    • updargs One argument or an array of arguments to pass to the updfunc callback.

    Additional callback object parameters
    • cycles Tweens back and forth between start and end.
      0 or "LOOP" = infinite cycles, default = 1, 2 or more to specify cycles.
    • skipLevel 0,1, or 2. An advanced behavior setting for cases where tweens fail. See SKIP_LEVEL for details.
      Including this paramter in a callback object overrides the engine default on a per-tween basis.
    • extra1 Optional fifth parameter sent to easing method. Elastic easing amplitude or Back easing overshoot.
    • extra2 Optional sixth parameter sent to easing method. Elastic easing period.
    • easyfunc Removed from kit. func, startfunc, updfunc parameters now accept easyfunc strings (see func above).
返り値:
A formatted string:
The engine reports which properties have been added to its active tween list by returning a comma-delimited string of just the properties that were successfully added, such as "_x" or "_x,_y". These may occasionally differ from what was tweened, such as "_width,_height" when "_size" was tweened.

If multiple targets are passed to the engine, a pipe-delimited series of properties is returned in target order, which enables granular review of whether specific properties for each target.
var results:String = ZigoEngine.doTween([clip1,clip2,clip3],"_scale",100,null,0,{skipLevel:1});
// results: "_xscale,_yscale||_xscale,_yscale"
// because clip2's scale was already set to 100 and the skipLevel is set to skip no-change tweens.

ffTween

public static function ffTween(targs: Object,
 props: Object,
 suppressEndEvents: Boolean): Void
Fast-forwarding a tween ends it and removes it from the engine.
使用法:
ZigoEngine.doTween(clip1, "_x, _xscale, _alpha", ["100", 200, 0], 1, "easeInOutExpo");
// during tween, fast-forward just the slide and scale but allow the fade-out to run:
ZigoEngine.ffTween(clip1, "_x, _scale");
 
// fast-forward all tweens in multiple targets
ZigoEngine.ffTween([clip2,clip3,clip4]);
引数:
targs
a single target object, array of targets, or FuseKitCommon.ALL for every active target
props
a property string, array of property strings, null or nothing for all props, FuseKitCommon.ALLCOLOR for any active color transform
suppressEndEvents
if true is not passed, engine will fire 'onTweenEnd' event and any end-callbacks associated with the tween

getColorKeysObj

public static function getColorKeysObj(targOrTransObj: Object): Object
(General) Provides readings by keyword for a target object or Flash7-style color-transform object.
Inherent rounding errors are common! Especially when percentages are below 50. Even .tintString hex values may differ slightly.
引数:
targOrTransObj
target object or Flash7-style color-transform object with props like ra, etc.
返り値:
object may contain props brightness, brightOffset, contrast, invertColor, tint, tintPercent, and tintString

getColorTransObj

public static function getColorTransObj(type: String,
 amt: Number,
 rgb: Object): Object
(General) Generates a generic Flash7-style color-transform object with props like ra, etc., by keyword.
引数:
type
String "brightness", "brightOffset", "contrast", "invertColor", or "tint"
amt
Percentage, can be negative in some cases
rgb
For "tint", a color value in 0x000000 or "#000000" format

getControllerDepth

public static function getControllerDepth(): Number
Depth of the ZigoEnginePulse clip.
返り値:
numeric depth in _root

getTweens

public static function getTweens(targ: Object): Number
Returns the number of tweens active in a target object.
引数:
targ
target tween passed to determine if active, or FuseKitCommon.ALL for every active target
返り値:
number of active tweens, which may be paused or playing

getUpdateInterval

public static function getUpdateInterval(): Number
返り値:
Number set using setUpdateInterval, or undefined if unset.
See also:

initialize

public static function initialize(target: Object): Void
(Advanced) Prepares targets for use with engine.
This method is never needed when extending prototypes with simpleSetup. It can be used to initialize specific targets to accept listeners prior to tweening - see ZManager for an example. If the Shortcuts class was passed to register, this method also copies all tweening shortcuts to targets.
引数:
target
One or more targets to initialize.
See also:

isPlaying

public static function isPlaying(): Boolean
Returns true if the engine contains tweens and is running updates on a pulse

isTweening

public static function isTweening(targ: Object,
 prop: String): Boolean
Test if a target and optionally a specific property is being handled by the engine.
引数:
targ
a single target object to test
prop
props a property string, null or nothing for any property, FuseKitCommon.ALLCOLOR for any active color transform
返り値:
true if a matching active tween is found, which may be paused or playing

isTweenLocked

public static function isTweenLocked(targ: Object): Boolean
Locks tweens and prevents from running until tween is unlocked.
引数:
targ
Object to lock
返り値:
locked value

isTweenPaused

public static function isTweenPaused(targ: Object,
 prop: String): Boolean
ターゲットオブジェクトの指定したプロパティが変化しているかどうかを判定できます
使用法:
if (ZigoEngine.isTweenPaused(clip1,"_alpha")==true) { ... }
引数:
targ
テストしたい単数のターゲットオブジェクト
prop
props a property string, null or nothing for any property, FuseKitCommon.ALLCOLOR と指定すると、全ての色変化を対象にできます
返り値:
停止しているプロパティの値

lockTween

public static function lockTween(targ: Object,
 setLocked: Boolean): Void
Locks a target to prevent tweens from running until target is unlocked.
A warning message is thrown if your program attempts to call a tween on a locked target.
使用法:
Accepts only one target at a time.

FuseKitCommon.ALL is not accepted by lockTween, because that would only affect targets currently being tweened in the engine. (In a case where you want to stop or pause all running tweens use pauseTween(FuseKitCommon.ALL) or removeTween(FuseKitCommon.ALL). The lockTween method is used to preset targets that usually are not currently being tweened in the engine. For more complex scenarios you should build an array of targets you need to affect, then use a for-loop to call the method on each one individually.
// example of how you could manage a block of targets in your program with lock/unlock
var lockableTargs:Array = [clip1,clip2,clip5];
function toggleTweenLock(setLocked:Boolean):Void {
	for (var i:String in lockableTargs) ZigoEngine.lockTween(lockableTargs[i], setLocked);
}
引数:
targ
Object to lock
setLocked
locked value
See also:

pauseTween

public static function pauseTween(targs: Object,
 props: Object): Void
1つ以上のトゥイーンを一時停止する
使用法:
ZigoEngine.doTween(clip1, "_x, _xscale, _alpha", ["100", 200, 0], 1, "easeInOutExpo");
// トゥイーンの途中で、移動と拡大縮小だけを一時停止させ、フェードアウトはそのまま実行され続けるようにする:
ZigoEngine.pauseTween(clip1, "_x, _scale");
 
// swf ファイル内の全てのエンジンによるトゥイーンを一時停止する
ZigoEngine.pauseTween(FuseKitCommon.ALL);
引数:
targs
1つのターゲットオブジェクト、または複数ターゲットを格納した配列。FuseKitCommon.ALL とすると、全てのアクティブなターゲットを対象にできます
props
プロパティ名の文字列、または複数のプロパティ文字列を格納した配列。null や nothing にすると全プロパティを対象にできます。FuseKitCommon.ALLCOLORと指定すると、全ての色変化を対象にできます

register

public static function register(classReference: Function): Void
An optional setup command that registers additional classes for use with the ZigoEngine.
This setup command should only be called once at the beginning of your program. Use either this or simpleSetup, not both. The difference is that register links additional classes to the engine without altering base prototypes.
import com.mosesSupposes.fuse.*;
ZigoEngine.register(PennerEasing, Fuse, FuseFMP);
ファイルサイズを最小限にしておくために、必要な機能だけを登録するようにしてください。また、パブリッシュ設定の「Traceアクションを省略」で、さらにファイルサイズを軽くできます。
引数:
classReference
次のクラスを設定できます(すべて任意設定可):
  • Shortcuts Enables doShortcut, 'easyfunc' callback parsing, and the option to copy / remove shortcuts on any target or prototype manually using initialize. See Shortcuts
  • PennerEasing Enables shortcut strings like "easeOutQuad" to be used with the engine. See PennerEasing
  • Fuse Enables Fuse for animation sequencing. Note that if animation won't be sequenced you do may simply import and use Fuse without ZigoEngine. See Fuse
  • FuseFMP Enables shortcut strings like DropShadow_distance to be tweened in the engine. See FuseFMP
  • FuseItem Enables Fuse-style Object Syntax to be used with the ZigoEngine.doTween. Note that Fuse does not need to be registered to use this feature. See FuseItem

removeListener

public static function removeListener(handler: Object): Void
Remove a listener for onTweenInterrupt event
引数:
handler
the function or object that should be called

removeTween

public static function removeTween(targs: Object,
 props: Object): Void
エンジン中の特定/全てのトゥイーンターゲットの、特定/全てのトゥイーンプロパティを削除できます。
使用法:
// clip0 の全てのトゥイーンを停止します
ZigoEngine.removeTween(clip0);
 
ZigoEngine.doTween(clip1, "_x, _xscale, _alpha", ["100", 200, 0], 1, "easeInOutExpo");
// トゥイーン中の移動と拡大縮小だけを停止、フェードアウトは実行させ続けます:
ZigoEngine.removeTween(clip1, "_x, _scale");
 
// 複数ターゲット中の全トゥイーンを停止します
ZigoEngine.removeTween([clip2,clip3,clip4]);
The onTweenInterrupt event is fired by the engine when this method is used (see addListener for more info).
引数:
targs
1つのターゲットオブジェクト、または複数ターゲットを格納した配列。FuseKitCommon.ALL とすると、全てのアクティブなターゲットを対象にできます
props
プロパティ名の文字列、または複数のプロパティ文字列を格納した配列。null や nothing にすると全プロパティを対象にできます。FuseKitCommon.ALLCOLORと指定すると、全ての色変化を対象にできます

resumeTween

public static function resumeTween(targs: Object,
 props: Object): Void
1つ、または複数のトゥイーンを(一時停止状態から)再開します
使用法:
ZigoEngine.resumeTween(clip1);
 
// swf 中の全てのエンジントゥイーンを再開する
ZigoEngine.resumeTween(FuseKitCommon.ALL);
引数:
targs
1つのターゲットオブジェクト、または複数ターゲットを格納した配列。FuseKitCommon.ALL とすると、全てのアクティブなターゲットを対象にできます
props
プロパティ名の文字列、または複数のプロパティ文字列を格納した配列。null や nothing にすると全プロパティを対象にできます。FuseKitCommon.ALLCOLORと指定すると、全ての色変化を対象にできます

rewTween

public static function rewTween(targs: Object,
 props: Object,
 pauseFlag: Boolean,
 suppressStartEvents: Boolean): Void
1つ、または複数のトゥイーンを巻き戻し、そこから一時停止するか再生を再開させるかを設定できます
使用法:
ZigoEngine.doTween(clip1, "_x, _xscale, _alpha", ["100", 200, 0], 1, "easeInOutExpo");
// トゥイーンの途中で、移動と拡大縮小だけを巻き戻し、フェードアウトは実行させ続けます:
ZigoEngine.rewTween(clip1, "_x, _scale");
 
// 複数ターゲットの全トゥイーンを巻き戻し、そこで一時停止します
ZigoEngine.rewTween([clip2,clip3,clip4], null, true);
 
// 巻き戻された時に、再度コールバックが開始されたり、イベントが再実行されると困るような場合は、
// このサンプルのように、第4引数で制限することができます。
var listenerObj:Object = new Object();
listenerObj.onTweenStart = function(o:Object):Void {
	trace(o.target+" start Event, props started: "+o.props);
};
ZigoEngine.initialize(clip5); // prepares clip to add a listener
clip5.addListener(listenerObj);
ZigoEngine.doTween(clip5, "_x", "100", 3, "easeInOutBack", 0,
						{startfunc:function(){trace("Start Callback!");}});
function onMouseDown() {
	// アニメーションが終わる前にステージ上をクリックされたら、アニメーションを巻き戻します。
	// その際、イベントは再実行されません。
	ZigoEngine.rewTween(clip5, null, false, true);
}
引数:
targs
1つのターゲットオブジェクト、または複数ターゲットを格納した配列。FuseKitCommon.ALL とすると、全てのアクティブなターゲットを対象にできます
props
プロパティ名の文字列、または複数のプロパティ文字列を格納した配列。null や nothing にすると全プロパティを対象にできます。FuseKitCommon.ALLCOLORと指定すると、全ての色変化を対象にできます
pauseFlag
true to rewind-and-pause
suppressStartEvents
if true is not passed, engine will refire 'onTweenStart' event and any start callbacks associated with the tween

setColorByKey

public static function setColorByKey(targetObj: Object,
 type: String,
 amt: Number,
 rgb: Object): Void
(General) Color-transforms a target by keyword.
Example: ZigoEngine.setColorByKey(my_mc, 'tint', 50, 0x33FF00);
引数:
targetObj
MovieClip or target to alter
type
String "brightness", "brightOffset", "contrast", "invertColor", or "tint"
amt
Percentage, can be negative in some cases
rgb
For "tint", a color value in 0x000000 or "#000000" format

setControllerDepth

public static function setControllerDepth(depth: Number): Void
Creates a clip in the _root timeline called "ZigoEnginePulse" or sets its depth
引数:
depth
If null or nothing passed the beacon clip is placed at depth 6789, but a depth of 0 will be more convenient if you'll be using depth management in _root.

setUpdateInterval

public static function setUpdateInterval(time: Number): Void
When set, the engine will run on a setInterval pulse instead of a frame pulse.
In most cases it is best to leave the engine in its default state since a frame-based pulse usually renders more smoothly. The engine always uses seconds for tween duration so using a longer interval will only reduce animation quality, not slow tweens down. This may be desirable in some cases, for instance to reduce CPU usage in banners.
引数:
time
Pulse duration in milliseconds, or null/undefined to return to an frame-based pulse.

simpleSetup

public static function simpleSetup(shortcutsClass: Function): Void
An alternative setup command that extends prototypes with shortcuts like alphaTo.
This setup command should only be called once at the beginning of your program. Use either this or register, not both. The difference is that simpleSetup alters base prototypes so that you may call tween methods directly on targets, such as my_mc.alphaTo(0);.

Example:
import com.mosesSupposes.fuse.*;
ZigoEngine.simpleSetup(Shortcuts,PennerEasing);
ファイルサイズを最小限にしておくために、必要な機能だけを登録するようにしてください。また、パブリッシュ設定の「Traceアクションを省略」で、さらにファイルサイズを軽くできます。
引数:
shortcutsClass
It is madadory to pass the Shortcuts class during this call! You may additionally pass any of the following classes (all are optional), as in the way PennerEasing is added above.
  • PennerEasing ZigoEngine上で、"easeOutQuad"といったショートカットストリング指定が使えるようになります。PennerEasingをご覧下さい。
  • Fuse アニメーションシーケンサー「Fuse」が使えるようになります。もし、連続的なアニメーションをしない場合は、ZigoEngineを使わず、Fuseだけをインポート・使用してください。Fuseをご覧下さい。
  • FuseFMP DropShadow_distanceといったショートカットストリングが使えるようになり、ZigiEngineでのトゥイーンもできるようになります。FuseFMP
  • FuseItem ZigoEngine.doTween上で、Fuseスタイルのオブジェクトシンタックスを使えるようにします。つまり、この機能だけを使いたい場合には、Fuseを登録する必要はないという事です。FuseItemをご覧下さい。
  • skipTweenTo

    public static function skipTweenTo(seconds: Number,
     targs: Object,
     props: Object): Void
    設定された時間の状態にトゥイーンをスキップできます。
    使用しているイージングのスタイルによって、結果は大きく変わります。
    使用法:
    // 2秒に設定されたトゥイーンの中間地点にスキップさせます
    ZigoEngine.skipTweenTo(1, clip1);
    引数:
    seconds
    スキップ目標となる時間を、対象トゥイーンの時間内で指定します(1.5秒のトゥイーンに対して、.75と指定すれば、中間地点にスキップすることになります)。
    targs
    1つのターゲットオブジェクト、または複数ターゲットを格納した配列。FuseKitCommon.ALL とすると、全てのアクティブなターゲットを対象にできます
    props
    プロパティ名の文字列、または複数のプロパティ文字列を格納した配列。null や nothing にすると全プロパティを対象にできます。FuseKitCommon.ALLCOLORと指定すると、全ての色変化を対象にできます

    unpauseTween

    public static function unpauseTween(targs: Object,
     props: Object): Void
    旧式 - resumeTween をご覧下さい

    The documentation was generated from the following file:

    Generated on 11/12/2006 3:29:13 PM