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

com.mosesSupposes.fuse

Fuse クラス

Array
  |
  +--com.mosesSupposes.fuse.Fuse


class Fuse
extends Array

イベントやアニメーションを順々に(連続的に)実行するためのシーケンサーです。FuseクラスはArrayを拡張して作られています。

使用法:
アニメーションの連続再生をするためには、ZigoEngine.registerZigoEngine.simpleSetup で Fuse クラスを使う設定(パラメーターとして渡す)をしてください。

Events dispatched:
  • onStart
  • onStop
  • onPause
  • onResume
  • onAdvance
  • onComplete

AsBroadcaster を使っている ZigoEngine とは異なり、Fuse は mx EventDispatcher がベースに使われています。
var f:Fuse = new Fuse();
f.addEventListener("onComplete", myListenerObj);

Fuse クラスには、以下のものが含まれています:
  • クラスレベルおよびインスタンスレベルでのデフォルト設定
  • Arrayクラスのメソッド (push をご覧下さい)
  • 再生操作関連のメソッド( start をご覧下さい)
  • Simple Syntax static methods( open をご覧下さい)
  • A runtime Object Syntax interpreter( Fuse をご覧下さい)
  • インスタンス管理に役立つメソッド( getInstance をご覧下さい)

Fuse オブジェクトシンタックスの各パラメーター内容は、コンストラクタメソッド Fuse の項目に記載してあります。

Fuse シンプルシンタックスの各パラメーター内容は、Fuse.open の項に記載してあります。

Author:
Moses Gunesch / MosesSupposes.com
Version:
2.0.5

Field Summary

public
autoClear: Boolean
インスタンスレベルのデフォルト設定: 一度再生が終わった Fuse インスタンスを自動的に削除します。

public static
AUTOCLEAR: Boolean
クラスレベルのデフォルト設定: 一度再生が終わった Fuse インスタンスを自動的に削除するかどうかを選べます。 インスタンスレベルで個別に autoClear が設定されている場合は、そちらが優先されます。

public
autoStop: Boolean
インスタンスレベルのデフォルト設定:トゥイーンが中断された時点で、Fuse インスタンスを停止します。また、autoClear がオンの時は、その Fuse インスタンスを削除します。

public static
AUTOSTOP: Boolean
クラスレベルのデフォルト設定:トゥイーンが中断された時点で、Fuse インスタンスを停止させるかどうかを設定できます。また、インスタンスレベルの autoStop プロパティが設定されていない時で、autoClear がオンになっている時は、その Fuse インスタンスを削除します。

public
duration: Number
インスタンスレベルのデフォルト設定:(インスタンスメソッドレベルで)個別に設定されていない場合の、アクションの継続時間を、秒単位で設定しておけます。

public
easing: Object
インスタンスレベルのデフォルト設定: (インスタンスメソッドレベルで)個別に設定されていない場合の、イージング値を設定しておけます。

public
label: String
インスタンスレベルのデフォルト設定: Fuse インスタンスに名前をつける事ができる便利な設定です。

public static
OUTPUT_LEVEL: Number
クラスレベルのデフォルト設定: Fuseからの出力結果のフィードバックの度合いを調節できるので、デバッグの手助けとなるでしょう。

public
scope: Object
インスタンスレベルのデフォルト設定: Fuse から実行される全ての関数(関数内で別途スコープ定義されているものは除く)のスコープを設定できます。

public static
VERSION: String
クラスレベルのデフォルト設定:ランタイム時や swf をデコンパイルした際に、FuseKit のバージョンを確認する事ができます。

Property Summary

public
currentIndex: Number (read-only)
Retrieves the current play-index of a Fuse instance.

public
currentLabel: String (read-only)
Retrieves the currently playing action's label, if defined.

public
id: Number (read-only)
Instance default: an auto-assigned numerical reference

public
state: String (read-only)
Retrieves a Fuse instance's current play-state string.

public
target: Object (read, write)
Instance default: Sets one or more animation targets that will be used for any actions that don't specify their own.

Constructor


Fuse ( action: Object)
Fuse extends Array to enable sequence-building & mangaement using familiar methods like push().

Method Summary

public static
addCommand ( commandOrScope: Object, indexOrFunc: Object, argument: Object ): Void
Simple Syntax: Multi-purpose method to add an inline Fuse command, delay, or function-call to the open Fuse.

public
addEventListener ( event: String, handler: Object ): Void
Add a listener for a particular event

public
addTarget ( t: Object ): Void
Adds to current default target list.

public
clone ( ): Fuse
Returns a copy of Fuse as a new Fuse instance.

public static
close ( ): Void
Simple Syntax: Completes the Fuse generated by open.

public static
closeAndStart ( setStart: Object ): Void
Simple Syntax: Close the open Fuse instance and start it playing.

public static
closeGroup ( ): Void
Simple Syntax: Closes an action group started by openGroup.

public
destroy ( ): Void
Deletes all variables and properties in the Fuse instance.

public
fastForward ( resumeAtIndexOrLabel: Object ): Void
Fast-forwards animations in some or all remaining actions.

public
getActiveTargets ( includeDefaults: Boolean ): Array
Gets both the default target list and any targets in the action currently being played.

public static
getInstance ( idOrLabel: Object ): Fuse
Instance-management: Gets a Fuse instance by its id or label

public static
getInstances ( stateFilter: String, targets: Object ): Array
Instance-management: Get an array of some or all Fuse instances in active memory, with filtering options.

public static
open ( fuseOrID: Object ): Fuse
Simple Syntax:Generate a new Fuse and begin intercepting tween calls until close is called.

public static
openGroup ( fuseOrID: Object ): Fuse
Simple Syntax: Begins a new animation group of simultaneous actions.

public
pause ( ): Void
Play-control: Pauses a playing Fuse instance and its running tweens. Waits for resume call to proceed.

public
pop ( ): Object
Removes last object placed into the Fuse instance.

public
push ( ): Number
Pushes arguments into Fuse instance.

public
pushTween ( targets: Object, props: Object, endvals: Object, seconds: Number, ease: Object, delay: Number, callback: Object ): Number
Lets you add an item to the Fuse in ZigoEngine.doTween() syntax. Pushes tween arguments into Fuse instance and accepts the same arguments as ZigoEngine.doTween().

public
removeEventListener ( event: String, handler: Object ): Void
Remove a listener for a particular event

public
removeTarget ( t: Object ): Void
Removes targets from the current default target list.

public
resume ( ): Void
Resumes a paused Fuse instance and its animations. Attempts to correct for animations that have been disrupted during pause.

public
reverse ( ): Void
Reverse the sequence of the Fuse

public
setStartProps ( trueOrItemIDs: Object ): Void
General: Presets start-properties like start_x in all or specific items.

public
shift ( ): Object
Shifts position of object in Fuse order.

public static
simpleSetup ( ): Void
Deprecated. Use new setup options: ZigoEngine.register or ZigoEngine.simpleSetup.

public
skipTo ( indexOrLabel: Object ): Void
Play-control: Starts Fuse at a particular index/label.

public
slice ( indexA: Number, indexB: Number ): Array
Returns a new array instance consisting of a range of elements from the original array without modifying the original array. The array returned by this method includes the indexA element and all elements up to, but not including indexB element. If no parameters are passed, a duplicate of the original array is generated. For more information, see the Flash help explanation of Array.slice.

public
splice ( startIndex: Number, deleteCount: Number ): Void
Used to insert or remove items. Works almost exactly like Array.splice. Removed actions are destroyed permanently, with the exception of nested Fuses.

public
start ( setStart: Object ): Void
Play-control: Begins sequence play at index 0, with option to set start props prior to play.

public static
startRecent ( setStart: Object ): Void
Simple Syntax: Restarts the Fuse most recently created using Fuse.open().

public
stop ( ): Void
Play-control: Stops a playing or paused Fuse instance and resets the play-index to 0.

public
toString ( ): String


public
traceItems ( indexA: Number, indexB: Number ): Void
Traces specific or all objects contained within the fuse

public
unshift ( ): Number
Removes argument objects from Fuse instance.

Field Documentation

autoClear

public var autoClear: Boolean
インスタンスレベルのデフォルト設定: 一度再生が終わった Fuse インスタンスを自動的に削除します。
使用法:
var f:Fuse = new Fuse();
f.autoClear = true;
このサンプルでは、Fuse インスタンスであるfは、一度再生が完了した時点で delete され、そのタイミングで変数 f もメモリバッファを防ぐために、削除されます。

AUTOCLEAR

public static var AUTOCLEAR: Boolean
クラスレベルのデフォルト設定: 一度再生が終わった Fuse インスタンスを自動的に削除するかどうかを選べます。 インスタンスレベルで個別に autoClear が設定されている場合は、そちらが優先されます。
使用法:
// 1度設定しておけばOKです
Fuse.AUTOCLEAR = true;
 
// あとからインスタンスごとに設定を上書き設定できます
var f:Fuse = new Fuse();
f.autoClear = false;
When a Fuse is set to auto-remove itself it is best practice to not set a variable reference to that Fuse, which may cause memory buffering, or to delete the variable when the Fuse is complete.

このデフォルト設定を、Fuseインスタンスごとに個別に上書き設定し直したい時は、インスタンスプロパティ autoClear をお使い下さい。

autoStop

public var autoStop: Boolean
インスタンスレベルのデフォルト設定:トゥイーンが中断された時点で、Fuse インスタンスを停止します。また、autoClear がオンの時は、その Fuse インスタンスを削除します。
使用法:
このインスタンスレベルでの設定は、デフォルト設定である Fuse.AUTOSTOP を上書きします。このプロパティが false の時は、一度中断された Fuse アニメーションを、その状態から引き続き再生させることができます。
var f:Fuse = new Fuse();
f.autoStop = false; //この Fuse インスタンスに対し、デフォルトの(クラスレベルの)設定を上書きします

AUTOSTOP

public static var AUTOSTOP: Boolean
クラスレベルのデフォルト設定:トゥイーンが中断された時点で、Fuse インスタンスを停止させるかどうかを設定できます。また、インスタンスレベルの autoStop プロパティが設定されていない時で、autoClear がオンになっている時は、その Fuse インスタンスを削除します。
使用法:
// 1度設定しておけばOKです
Fuse.AUTOSTOP = false;
このデフォルト設定が false の時は、If this default is set false, Fuses will skip past any externally interrupted tweens and continue to play through. ボタンのロールオーバー効果などの、インタラクティブなパーツに Fuse を使っているような場合、この設定を true にして Fuse インスタンスが、同じアクションを繰り返してしまう不具合が起こらないようにしておくと良いでしょう。

Note that an interruption will not occur if new non-overlapping tweens are started on a clip that a Fuse is tweening. To enforce interruptions in such cases you can set ZigoEngine.com.mosesSupposes.ZigoEngine.AUTOSTOP to true, which causes all tweening properties in a clip to stop when a new tween is removed, or use ZigoEngine.com.mosesSupposes.ZigoEngine.removeTween prior to the call that may interrupt a Fuse.

このデフォルト設定を、Fuseインスタンスごとに個別に上書き設定し直したい時は、インスタンスプロパティautoStop をお使い下さい。

duration

public var duration: Number
インスタンスレベルのデフォルト設定:(インスタンスメソッドレベルで)個別に設定されていない場合の、アクションの継続時間を、秒単位で設定しておけます。
使用法:
この設定は、(クラスレベルの)デフォルト設定である ZigoEngine.DURATION での設定を上書きします。逆に、各 Fuse インスタンスの動作内容設定時の引数( secondsdurationtime )が設定された場合は、そちらが優先されます。
var f:Fuse = new Fuse();
f.duration = 2; // 新規デフォルト値として設定
f.push({ x:'100' }); // デフォルト値「トゥイーン時間2秒」で実行
f.push({ y:'100', time:.5 }); // デフォルト値が上書きされ「トゥイーン時間0.5秒」で実行

easing

public var easing: Object
インスタンスレベルのデフォルト設定: (インスタンスメソッドレベルで)個別に設定されていない場合の、イージング値を設定しておけます。
使用法:
この設定は、(クラスレベルの)デフォルト設定である ZigoEngine.EASING での設定を上書きします。逆に、各 Fuse インスタンスのアクション設定時の引数( easeeasing)が設定された場合は、そちらが優先されます。
var f:Fuse = new Fuse();
f.easing = "easeInOutCubic"; // 新規デフォルト値として設定
f.push({ x:'100' }); // デフォルト値 "easeInOutCubic" で実行
f.push({ y:'100', ease:'easeInExpo' }); // デフォルト値が上書きされ 'easeInExpo' で実行

label

public var label: String
インスタンスレベルのデフォルト設定: Fuse インスタンスに名前をつける事ができる便利な設定です。
Fuse のラベル名は、出力メッセージでの認識名として役に立つだけでなく、getInstance, fastForward で Fuse インスタンスを指定する時のリファレンスとして、また、openopenGroup といったシンプルシンタックスメソッドでも利用されます。
使用法:
var drawContentPage:Fuse = new Fuse();
drawContentPage.label = "drawContentPage";

OUTPUT_LEVEL

public static var OUTPUT_LEVEL: Number
クラスレベルのデフォルト設定: Fuseからの出力結果のフィードバックの度合いを調節できるので、デバッグの手助けとなるでしょう。
使用法:
// once only
Fuse.OUTPUT_LEVEL = 3;
  • 0 = traceしません
  • 1 = 通常のエラー&警告を表示
  • 2 = Fuse の情報を表示
  • 3 = さらに FuseItem の情報も表示

scope

public var scope: Object
インスタンスレベルのデフォルト設定: Fuse から実行される全ての関数(関数内で別途スコープ定義されているものは除く)のスコープを設定できます。
使用法:
var f:Fuse = new Fuse();
f.scope = this;
f.push({target:menu, 
	start_alpha:0,
	x:getMenuX,
	y:getMenuY, 
	startfunc:"setupMenu", 
	updfunc:"onMenuFadeUpdate", 
	func:"onMenuShown"
});
f.push({ scope:contentArea,
	func:"drawContent"
});
このサンプルでは、はじめのアクション設定内の関数(getMenuX と getMenuY メソッドのようなランタイムで実行される関数も含む) は、Fuse のデフォルトのスコープである this に設定されます。第2のアクション設定(11行目〜)では、デフォルトのスコープ設定は上書きされ、drawContent のスコープは contentArea オブジェクト であると指定し直されました。
こうやってデフォルトのスコープを設定しておけば、シーケンス中でいろんな関数が呼び出されるような状況があった場合、各アクションのスコープを設定する手間が省けるので、役立つでしょう。

VERSION

public static var VERSION: String
クラスレベルのデフォルト設定:ランタイム時や swf をデコンパイルした際に、FuseKit のバージョンを確認する事ができます。
使用法:
trace(Fuse.VERSION); // バージョンが正しくない場合は、ASO ファイルのキャッシュをクリアしてみてください。

Property Documentation

currentIndex

public currentIndex : Number (read-only)
Retrieves the current play-index of a Fuse instance.
Value:
A number starting at 0 for the first action
関連:

currentLabel

public currentLabel : String (read-only)
Retrieves the currently playing action's label, if defined.

 

{ label:"introFade", start_alpha:0, start_brightOffset:100, time:1.5, ease:"easeInExpo" }
Value:
A string set in the action object using the label property.
関連:

id

public id : Number (read-only)
インスタンスのデフォルト設定:自動的に割り当てられるリファレンス番号
Value:
Internal id based on instance count.
関連:

state

public state : String (read-only)
Retrieves a Fuse instance's current play-state string.
Value:
"stopped", "playing", or "paused"
関連:

target

public target : Object (read, write)
Instance default: Sets one or more animation targets that will be used for any actions that don't specify their own.

 

Overwrites prior existing targets.
var f:Fuse = new Fuse();
f.target = [clip1, clip2];
Value:
a single animation target if one is set or an Array of targets if more than one is set.
関連:

Constructor Documentation

Fuse

function Fuse (action: Object)
Fuse は Array クラスを拡張させたもので、 push()メソッドなどを使って、(アニメーション・イベント)シーケンスを設計&管理することができます。
使用法:
var f:Fuse = new Fuse(
 {start_x:'-50', start_xscale:150, start_alpha:0, seconds:.5 },
 [ 
  { width:500, ease:'easeInExpo', seconds:1 },
  { height:300, ease:'easeInOutExpo', delay:.5 }
 ]);
f.target = box1_mc;
f.start();
 
f.traceItems();
出力パネル:
-Fuse#0 traceItems:
----------
Fuse#0>Item#0: StartProps:[_alpha, _xscale, _x] Props:[_x, _xscale, _alpha]
Fuse#0>Item#1: Props:[_height, _width]
----------

Fuse action objects may be:
  • Generic objects containing parseable properties
    { target:clip1, x:10, seconds:2, ease:Strong.easeInOut }
  • An array of such action objects which creates a simultaneous tween Group
    [ { x:10, seconds:2, ease:Strong.easeInOut }, { start_alpha:0, seconds:.5 } ]
  • A nested Fuse which will play as an action
    myFuse2

    Fuse supports an unlimited level of nesting - for instance myFuse2 can contain & run myFuse3 which contains and runs myFuse4 and so on.

    Nested Fuses many not appear within groups (the Array syntax in the previous point). However it is quite possible to start secondary Fuses from any action or action group with commands like { scope:myFuse2, func:"start" }. See a more complex example of this below under the command parameter.
  • "Applied actions": a special format for reusing actions by including an action property.

    For example if an action var intro:Object = { ... } has been defined, you can then include it in later Fuse actions like this:
    { target:clip1, action:intro }

    This lets you build multi-purpose behaviors that can be used with different targets, perhaps a custom fade or movement effect.
    Applied actions may contain the following properties that modify the base action: delay, target, addTarget, label, trigger.
    While target overrides, addTarget concatenates targets with any that are defined in the action. See below for info on others.

Fuse action-object properties may be:
  • Parseable properties, listed below
  • Any custom property you wish to tween (should be pre-declared and set to a number)
  • Start values: Prepend start_ to any property and it will be set prior to tweening.
  • Omitted: Fuse's smart parsing allows you to avoid needing a start and end value for every property. When a start value is omitted, the property's current value is used as in ZigoEngine. When a start-value is included but the end value is omitted, Fuse inserts an end value in one of two ways:
    • Natural reset: Known properties with a natural reset value like _rotation:0, _alpha:100, _brightOffset:0, etc., auto-fill the end value as such. For example a fade-in effect can be generated with the simple action {start_alpha:0} which will tween to 100 automatically.
    • Open properties: Props like _x or _width that do not have a natural reset are auto-filled to their value prior to the tween. In this action a clip will be moved offscreen then slide back to its current location: { start_x:-100, start_y:-100 }.

Fuse action-object values may be types:
  • Number - トゥイーンの目的値。 x:100
  • String - calculate tween using relative positioning.
    Example: rotation:"-90" yields a counter-clockwise rotation.
  • Boolean values, set at start or end of tween.
    Example: start_visible:true
  • Tint values can be Number (0x000000), String ("#000000"), or null (reset)
    Example: tint:"#FF3300"
  • Time is specified in seconds, and may be Number or timecode-String format.
    Examples: seconds:2, startAt:"01:75" - timecode for a 1.75-second delay
  • Function - (Advanced) "Runtime evaluation" - function is queried as the action is played in the sequence. Functions should return values appropriate to the property.
    Example: { x:function(){ return _root._xmouse; } }

    This is a powerful feature that helps eliminate the need to hardcode values in advance. Fuses can be written to be "live", querying for targets and values themselves by retrieving state variables from within your program.

    Such functions will be scoped first to the action then the Fuse instance's scope property. If scope is already being used for callbacks, you can use a Delegate to individually scope runtime-evaluation functions.
  • Object or Array - (Advanced) A new feature introduced in Fuse Kit 2.0.5, 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.
    Examples: { myArray:[10,20], myMatrix:{a:0, b:1, tx:100}, GradientBevel_colors:[0xFF0000, 0x333333, 0x00FFFF] }
  • 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: { myColors: [ 0x000000, 0xFFFFFF ], scope:this, updfunc:'redrawGradient' }

(advanced) Example of using a Fuse with 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(Fuse);
var myMatrix:Matrix = new Matrix();
var boxTrans:Transform = new Transform(box);
function applyMatrixTrans():Void { 
	boxTrans.matrix = myMatrix;
}
var f:Fuse = new Fuse();
f.push({ target:this,
	     myMatrix:{a:.5, c:.5, tx:200 },
	     updfunc:applyMatrixTrans });
f.start();

Parseable action properties

  • label String naming the action, that may be used during skipTo and viewed in output messages. (This property cannot be set to a function value)
  • target Animation target or Array of targets. Overrides the instance's default target list.
  • addTarget Concatenates one or an Array of targets with the default target list.
  • ease or easing Accepts same formats as ZigoEngine.doTween's easing parameter.
  • seconds, time or duration See time formatting above.
  • delay or startAt See time formatting above.
  • event String declaring a custom event that should be dispatched by the engine.
    Subscribe to this custom event on the Fuse instance the same as you would for built-in events (see header).
  • eventparams An object whose properties will be copied to the event object dispatched with the custom event. (Requires that the event property is defined)
  • func Function, string name of function, or Easyfunc string like "myClip.doSomething(true);" (Shortcuts must be registered to use the easyfunc feature.)
  • scope Object - overrides instance default scope. Note that in Fuse actions this property is special in that it will be applied to all callbacks or runtime-evaluation functions if not otherwise defined.
  • 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 If not defined, the scope property or instance default scope 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 If not defined, the scope property or instance default scope will be used.
  • updargs One argument or an array of arguments to pass to the updfunc callback.
  • 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.
  • _bezier_ (Not necessary, see controlX, controlY below.) 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.
  • controlX, controlY Including one or both of these parameters in a Fuse action along with x and/or y generates a bezier curve similar to using the _bezier_ property but without the need for a nested object.
  • cycles An integer 2 or higher, tweens back and forth between start and end positions. Infinite cycles (0 or "LOOP" in ZigoEngine.doTween) are not allowed in Fuses.
  • skipLevel 0,1, or 2. An advanced behavior setting for cases where tweens fail. See ZigoEngine.SKIP_LEVEL for details. In Fuse, this parameter also applies to the custom event parameter, although standard Fuse events like onComplete are not skipped.
  • trigger May be set as seconds (see time formatting above) or set to true if in a group to indicate advance after the item trigger is grouped with.
    Advances the sequence prior to action completion. This is a powerful feature that makes sequencing far less rigid and more timeline-like.
    Example 1: In this group the sequence advances after the fade action. [ { start_alpha:0, seconds:.5, trigger:true}, { x:'100', seconds:3 } ]
    Example 2: Here the sequence advances after 1.5 seconds, while the action takes 3 seconds. { width:500, delay:1, seconds:2, trigger:1.5 }

    Note that the onComplete Fuse event is not fired until any trailing tweens from triggered actions finish.
  • command String "start","stop","pause","resume","skipTo", or "setStartProps".
    Allows actions to control Fuse play.
    Example: a final action of {command:"start"} causes the Fuse to loop.
    Commands should be separate actions. They may not appear within action groups or be blocked with tweens or callbacks.
    Actions containing a command property may ONLY contain the additional properties: scope, args, label, delay.
    Note that any arguments in args are sent to the Fuse command, and scope is only used for runtime-evaluation of other params set to function (see "Runtime-evaluation" above).

    Examples of a command with an argument: { command:"skipTo", args:3 }, { command:"start", args:true }
  • easyfunc Removed from kit. func, startfunc, updfunc parameters now accept easyfunc strings (see func above).
(Advanced) The following example illustrates how command actions can be used in more complex arrangements. Here a complex group of Fuses is associated by controlling each other, without the use of nested Fuses.
var fuseA:Fuse = new Fuse();
var fuseB:Fuse = new Fuse();
var fuseC:Fuse = new Fuse();
// .. build Fuses here then..
// final action in fuseC will resume the master Fuse,
fuseC.push({ scope:fuseA, func:"resume" });
// .. somewhere in fuseA, begin the others & pause:
fuseA.push([{scope:fuseB, func:"start"},
				 {scope:fuseC, func:"start"} ]);
fuseA.push({ command:"pause" }); // keep command in a separate action
// .. continue pushing actions into fuseA here.
// .. fuseA will resume when fuseC hits its final "resume" action.

Unless you have set FuseItem.ADD_UNDERSCORES to false, the following known properties are underscore-optional:
  • _alpha or alpha
  • _rotation or rotation
  • _x or x
  • _y or y
  • _xscale or xscale
  • _yscale or yscale
  • _scale or scale _xscale と _yscale を同じ値に設定
  • _width or width
  • _height or height
  • _size or size _width と _height を同じ値に設定
  • _frame or frame 任意のイージングタイプでムービークリップのタイムラインのフレームをトゥイーンさせることができます。
  • _tint or tint Tint formats above or object {tint:Number/null/hexString, percent:Number/String}.
  • _tintPercent or tintPercent 0-100 の範囲で設定
  • _brightness or brightness0-100 の範囲で設定
  • _brightOffset or brightOffset ブラーの効果。-100=black, 0=normal, 100=white
  • _invertColor or invertColor0-100 の範囲で設定
  • _colorReset or colorReset 0 (current tint) から 100 (full reset) の範囲で指定
  • _contrast or contrast 0=gray, 100=normal, 200=high-contrast, higher=posterized
  • _colorTransform or colorTransform Flash7 transform object {ra:,rb:,etc.}
  • _visible or visible
引数:
action
One or more generic "action" objects or arrays in Fuse Object Syntax constituting a sequence.
関連:

Method Documentation

addCommand

public static function addCommand (commandOrScope: Object,
 indexOrFunc: Object,
 argument: Object): Void
Simple Syntax: Multi-purpose method to add an inline Fuse command, delay, or function-call to the open Fuse.

 

var f:Fuse = new Fuse();
 
// callback: scope, func, args
Fuse.addCommand(this, "setItemData", 0, "Submit", true);
 
// delay
Fuse.addCommand("delay", .5);
 
// inline Fuse play-command: forces Fuse to loop by restarting
Fuse.addCommand("start");
 
Fuse.closeAndStart();
引数:
commandOrScope
may be: 'delay','start','stop','pause','resume','skipTo','setStartProps' or in the case of a function-call a scope such as this.
indexOrFunc
'delay':number of seconds. 'skipTo':destination index/label. For function-call, a string of the function name such as 'trace'
argument
for function-call, any number of arguments can follow and will be passed to the function when it's called.
関連:

addEventListener

public function addEventListener (event: String,
 handler: Object): Void
Add a listener for a particular event
引数:
event
the name of the event ("onComplete", etc)
handler
the function or object that should be called
関連:

addTarget

public function addTarget (t: Object): Void
Adds to current default target list.

 

myFuse.addTarget(clip5);
引数:
t
accepts one or more targets, or an array of targets
関連:

clone

public function clone (): Fuse
Fuse インスタンスのコピーを、新規 Fuse インスタンスとして返します
Returns:
new Fuse instance with default settings and actions.
関連:

close

public static function close (): Void
Simple Syntax: Completes the Fuse generated by open.

 

It is important that you complete each Fuse created using Fuse.open() using either Fuse.close() or Fuse.closeAndStart(). You cannot call start on a Fuse instance while Fuse is open.
var runSetup:Fuse = Fuse.open();
Fuse.addCommand(this, "callbackOne");
Fuse.addCommand("delay", .25);
Fuse.addCommand(this, "callbackTwo");
Fuse.addCommand("delay", .25);
Fuse.addCommand(this, "callbackThree");
Fuse.close();
 
// later in program...
runSetup.start(); // reference the Fuse created
関連:

closeAndStart

public static function closeAndStart (setStart: Object): Void
Simple Syntax: Close the open Fuse instance and start it playing.

 

var runSetup:Fuse = Fuse.open();
clip1.fadeOut();
clip2.fadeOut();
clip3.fadeOut();
Fuse.closeAndStart();
引数:
setStart
A setStartProps call is generated from all arguments before the Fuse begins playing.
関連:

closeGroup

public static function closeGroup (): Void
Simple Syntax: Closes an action group started by openGroup.

 

May be omitted if followed by Fuse.close or Fuse.closeAndStart.

If Fuse.openGroup() is called while a previous group was open, the preceding group is closed automatically and the closeGroup command can be skipped.
Fuse.open();
clip1.tween("_x","100");
Fuse.openGroup();
 clip1.tween("_x","-100");
 clip2.tween("_scale",200);
Fuse.closeGroup();
clip1.scaleTo(0);
clip2.scaleTo(0);
Fuse.closeAndStart();
関連:

destroy

public function destroy (): Void
Deletes all variables and properties in the Fuse instance.
使用法:
You should remove all listeners before calling destroy(), then after the call delete any variable references to the instance cleared.
myFuse.removeEventListener('onComplete',this);
myFuse.destroy();
delete myFuse;
関連:

fastForward

public function fastForward (resumeAtIndexOrLabel: Object): Void
Fast-forwards animations in some or all remaining actions.
Behavior:
  • Calling with no arguments: Fast-forwards all remaining animation in the Fuse. The onComplete event is fired.
  • Passing a positive or negative integer or string: Fast-forwards up to, then resumes play at the index specified. Negative integer counts back from last item, string locates an action or nested Fuse by its label property.
  • Callbacks and events are disregarded during fast-forwarding.
  • If you pass 0 or an index that has already played, a warning is thrown and skipTo is called instead.
  • Note that when passing a label string, nested Fuse instance labels are scanned but not action labels within nested Fuses. To fast-forward to a specific point in a nested Fuse, first call fastForward to advance to the primary Fuse, then a second time on the secondary Fuse.
  • Fuse does not include any similar animation-rewinding method, which would not be practical for a number of reasons within its current architecture.
使用法:
// fast-forward all animations and end fuse:
myFuse.fastForward();
 
// fast-forward from current index and resume play at index 8
myFuse.fastForward(8);
 
// fast-forward then resume at a labeled action like { x:"100", label:"slider" }
myFuse.fastForward("slider");
 
// fast-forward but play final action
myFuse.fastForward(-1);
The following example demonstrates fast-forwarding to an index within a nested Fuse instance, and also shows how a nested Fuse's label property can be used to fast-forward to. Note that the fast-forward commands could alternatively be written using positive or negative integers as in the examplese above.
var nestedFuse1:Fuse = new Fuse(
	{ rotation:180, label:"spin" },
	{ tint:0x33FF00, tintPercent:50, label:"tint" }
);
nestedFuse1.label = "NF1";
nestedFuse1.target = clip1_mc;
 
var mainFuse:Fuse = new Fuse(
	{ x:"100", label:"slideRight" },
	nestedFuse1,
	{ x:"-100", label:"slideLeft" }
);
mainFuse.target = clip1_mc;
mainFuse.start();
 
// fast-forward to the "tint" action by using two fastForward calls.
mainFuse.fastForward("NF1"); // first jump to the nested Fuse using its label
nestedFuse1.fastForward("tint"); // then jump to the tint action using its label
引数:
resumeAtIndexOrLabel
Numerical item index or label string to fast-forward up to and resume playing at.
関連:

getActiveTargets

public function getActiveTargets (includeDefaults: Boolean): Array
Gets both the default target list and any targets in the action currently being played.
引数:
includeDefaults
If true is passed, list includes the Fuse instance's default target list plus active action targets.
Returns:
Array of targets currently being handled by the playing or paused action, plus the Fuse instance's default target list if true was passed.

If the Fuse instance queried is stopped, an empty array is returned.
関連:

getInstance

public static function getInstance (idOrLabel: Object): Fuse
Instance-management: Gets a Fuse instance by its id or label
This simple method returns one known Fuse instance. For more complex options use getInstances.
引数:
idOrLabel
Fuse's numerical id or label identifying a unique Fuse instance.
Returns:
a Fuse instance if found or null if not
関連:

getInstances

public static function getInstances (stateFilter: String,
 targets: Object): Array
Instance-management: Get an array of some or all Fuse instances in active memory, with filtering options.

 

// get currently playing Fuses that handle the target my_mc
var myMcFuses:Array = Fuse.getInstances("playing",my_mc);
 
// get all the Fuses in active memory
var fuses:Array = Fuse.getInstances();
引数:
stateFilter
nothing/null/FuseKitCommon.ALL for all Fuse instances in active memory, or a play state "playing", "stopped" or "paused"
targets
optional - a single target, an Array of targets, or a list of targets starting with the second param.
Returns:
an array containing one or more Fuse instances matching search criteria
関連:

open

public static function open (fuseOrID: Object): Fuse
Simple Syntax:Generate a new Fuse and begin intercepting tween calls until close is called.
Simple Syntax is an alternative way to construct Fuse sequences. Its primary uses are 1. Clear method-call sequencing and 2. An easy way for non-advanced coders to set up sequences.
使用法:
// Example 1: Can be used to enforce a clear, strict order of timed events
Fuse.open();
 Fuse.addCommand (mainMenu, "draw", menuXML);
 Fuse.addCommand ("delay", .5);
 Fuse.addCommand (contentPage, "loadContent", firstItem);
 Fuse.addCommand (screenDisplay, "exposeLayout");
 Fuse.addCommand ("delay", 2);
 Fuse.addCommand (this, "onResize");
 Fuse.addCommand (Logger, "output", "Setup sequence complete.", 0);
Fuse.close();
 
// Example 2: Simple Syntax with shortcut tweens
Fuse.open();
 box_mc.slideTo(150,150, 1);
 Fuse.openGroup();
  box_mc.scaleTo(250, 1);
  box_mc.brightnessTo(-50, 2);
 Fuse.closeGroup();
 box_mc.colorTo(0x6633FF, 1);
Fuse.closeAndStart();

You may retrieve the Fuse instance created, or reopen an existing Fuse:
var f:Fuse = Fuse.open(); // store a reference to the Fuse
// later...
Fuse.open(f); // reopen existing
// or...
Fuse.open(0); // open Fuse with id 0
// or...
Fuse.open("introSequence"); // open Fuse with the label "introSequence"

If you mostly use simple syntax and don't reuse your Fuses, it's recommended that you set AUTOCLEAR to true to avoid memory buffering.
引数:
fuseOrID
(Optional) Pass an existing Fuse, or its id or label to reopen it.
Returns:
The opened Fuse instance that tween calls will be routed to until close() is called.
関連:

openGroup

public static function openGroup (fuseOrID: Object): Fuse
Simple Syntax: Begins a new animation group of simultaneous actions.

 

Fuse.openGroup(); can be called in place of Fuse.open();.

If Fuse.openGroup(); is called while a previous group was open, the preceding group is closed automatically.
// use in place of Fuse.open() to begin a new Fuse.
Fuse.openGroup();
 clip1.tween("_x","100");
 clip2.tween("_scale",200);
Fuse.openGroup(); // you can skip closeGroup if opening another group.
 clip1.tween("_x","-100");
 clip2.tween("_scale",100);
Fuse.closeAndStart(); // you can skip closeGroup here too.
引数:
fuseOrID
fuseOrID:Fuse (Optional) an existing Fuse or Fuse's id or label in which to open the new group.
Returns:
The currently open fuse instance or a new Fuse if openGroup was called prior to open().
関連:

pause

public function pause (): Void
Play-control: Pauses a playing Fuse instance and its running tweens. Waits for resume call to proceed.
関連:

pop

public function pop (): Object
Removes last object placed into the Fuse instance.
Returns:
original object passed by user
関連:

push

public function push (): Number
Pushes arguments into Fuse instance.
Returns:
new length of Fuse instance
関連:

pushTween

public function pushTween (targets: Object,
 props: Object,
 endvals: Object,
 seconds: Number,
 ease: Object,
 delay: Number,
 callback: Object): Number
Lets you add an item to the Fuse in ZigoEngine.doTween() syntax. Pushes tween arguments into Fuse instance and accepts the same arguments as ZigoEngine.doTween().
引数:
targets
tween target object or array of target objects
props
tween property or Array of properties
endvals
tween end-value or Array of corresponding end-values
seconds
tween duration
ease
function, shortcut-string, or custom-easing-panel object
delay
seconds to wait before performing the tween
callback
function, string, or object
Returns:
new length of Fuse instance
関連:

removeEventListener

public function removeEventListener (event: String,
 handler: Object): Void
Remove a listener for a particular event
引数:
event
the name of the event ("onComplete", etc)
handler
the function or object that should be called
関連:

removeTarget

public function removeTarget (t: Object): Void
Removes targets from the current default target list.

 

myFuse.removeTarget(clip5);
引数:
t
accepts one or more targets, or an array of targets
関連:

resume

public function resume (): Void
Resumes a paused Fuse instance and its animations. Attempts to correct for animations that have been disrupted during pause.
関連:

reverse

public function reverse (): Void
Reverse the sequence of the Fuse
関連:

setStartProps

public function setStartProps (trueOrItemIDs: Object): Void
General: Presets start-properties like start_x in all or specific items.
In this example a sequence is set up and all start props are set, although the Fuse may not be used until later.
var f:Fuse = new Fuse();
f.target = clip1;
f.push({ start_alpha:0 }); // fade up
f.push({ x:'100', start_scale:150}); // scale down and slide
f.setStartProps();
If you want to set start props as the Fuse is started, you can pass setStartProps parameters to start.
引数:
trueOrItemIDs
nothing/null/FuseKitCommon.ALL to set all start props in the Fuse. To specify some actions while excluding others, pass an array of item indices/labels or a series of indices/labels as separate parameters.
関連:

shift

public function shift (): Object
Shifts position of object in Fuse order.
Returns:
original object passed by user
関連:

simpleSetup

public static function simpleSetup (): Void
Deprecated. Use new setup options: ZigoEngine.register or ZigoEngine.simpleSetup. Deprecated. Throws an error.

skipTo

public function skipTo (indexOrLabel: Object): Void
Play-control: Starts Fuse at a particula