Packagejp.progression.core.commands
Classpublic class Command
InheritanceCommand Inheritance EventIntegrator Inheritance flash.events.EventDispatcher
Subclasses AddChild, AddChildAt, AddChildAtAbove, Break, CommandList, DoSound, DoTransition, DoTween, DoTweener, DoTweenFrame, Func, Goto, Listen, LoadChild, LoadChildAt, LoadChildAtAbove, LoadObject, LoadURL, Prop, RemoveAllChildren, RemoveChild, Trace, UnloadChild, UnloadObject, Wait

Command クラスは、全てのコマンドの基本となるクラスです。

View the examples



Public Properties
 PropertyDefined By
  className : String
[read-only] インスタンスのクラス名を取得します。 Indicates the instance className of the Command.
Command
  defaultTimeOut : int
[static]
Command
  delay : int
コマンド実行までの遅延時間(ミリ秒)を取得または設定します。
Command
  enabled : Boolean
コマンドが実行可能かどうかを取得または設定します。 この値を false に設定した状態で execute() メソッドを実行すると、何も処理を行わずに CommandEvent.COMMAND_COMPLETE イベントを送出します。
Command
  enforcedInterrupting : Boolean
[read-only] コマンドが強制中断処理中かどうかを取得します。
Command
  extra : Object
[read-only] execute() メソッド実行時に引数として指定されたオブジェクトを取得します。 このコマンドが親の CommandList インスタンスによって実行されている場合には、親の extra オブジェクトの内容をコマンド実行順にリレーする形で引き継ぎます。
Command
  group : String
インスタンスのグループ名を取得または設定します。 Indicates the instance group of the Command.
Command
  id : String
インスタンスの識別子を取得または設定します。 Indicates the instance id of the Command.
Command
  interrupting : Boolean
[read-only] コマンドが中断処理中かどうかを取得します。
Command
  latestData : *
CommandList 上で、自身より前に実行された外部データ読み込み系のコマンドが持っている外部データを取得します。
Command
  length : int
[read-only] コマンドの深度を取得します。
Command
  name : String
インスタンスの名前を取得または設定します。 Indicates the instance name of the Command.
Command
  next : Command
[read-only] このコマンドが CommandList インスタンスに関連付けられている場合に、次に位置するコマンドを取得します。
Command
  parent : CommandList
[read-only] このコマンドを子に含んでいる親の CommandList インスタンスを取得します。
Command
  previous : Command
[read-only] このコマンドが CommandList インスタンスに関連付けられている場合に、前に位置するコマンドを取得します。
Command
  root : Command
[read-only] コマンドツリー構造の一番上に位置するコマンドを取得します。
Command
  running : Boolean
[read-only] コマンドが実行中かどうかを取得します。
Command
  scope : Object
コマンド実行処理、および中断処理のタイムアウト時間(ミリ秒)を取得または設定します。 指定された時間中に executeComplete() メソッド、もしくは interruptComplete() が実行されなかった場合にエラーが送出されます。 この値が 0 に設定されている場合、タイムアウトは発生しません。
Command
  thresholdLength : int
[static]
Command
  timeOut : int
コマンド実行処理、および中断処理のタイムアウト時間(ミリ秒)を取得または設定します。 指定された時間中に executeComplete() メソッド、もしくは interruptComplete() が実行されなかった場合にエラーが送出されます。 この値が 0 に設定されている場合、タイムアウトは発生しません。
Command
Public Methods
 MethodDefined By
  
Command(executeFunction:Function = null, interruptFunction:Function = null, initObject:Object = null)
新しい Command インスタンスを作成します。 Creates a new Command object.
Command
 Inherited
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
[override] イベントリスナーオブジェクトを EventIntegrator インスタンスに登録し、リスナーがイベントの通知を受け取るようにします。 このメソッドを使用して登録されたリスナーを removeEventListener() メソッドで削除した場合には、restoreRemovedListeners() メソッドで再登録させることができます。 Register the event listener object into the EventIntegrator instance to get the event notification.
EventIntegrator
 Inherited
addExclusivelyEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
イベントリスナーオブジェクトを EventIntegrator インスタンスに登録し、リスナーがイベントの通知を受け取るようにします。 このメソッドを使用して登録されたリスナーは、IEventIntegrator インスタンスの管理外となるため、removeEventListener() メソッドで削除した場合にも、restoreRemovedListeners() メソッドで再登録させることができません。 Register the event listener object into the EventIntegrator instance to get the event notification.
EventIntegrator
  
after(afterFunction:Function, ... afterArgs):Command
コマンドの実行完了直後に処理させたい関数を設定します。 関数実行時の this 参照は実行しているコマンドインスタンスになります。
Command
  
apply(applyFunction:Function, ... applyArgs):Command
コマンドに対してすぐに関数を実行します。 関数実行時の this 参照は実行しているコマンドインスタンスになります。
Command
  
before(beforeFunction:Function, ... beforeArgs):Command
コマンドの実行直前に処理させたい関数を設定します。 関数実行時の this 参照は実行しているコマンドインスタンスになります。
Command
  
Command インスタンスのコピーを作成して、各プロパティの値を元のプロパティの値と一致するように設定します。 Duplicates an instance of an Command subclass.
Command
 Inherited
completelyRemoveEventListener(type:String, listener:Function, useCapture:Boolean = false):void
EventIntegrator インスタンスからリスナーを削除します。 このメソッドを使用して削除されたリスナーは、restoreRemovedListeners() メソッドで再登録させることができません。 Remove the listener from EventIntegrator instance.
EventIntegrator
 Inherited
dispatchEvent(event:Event):Boolean
[override] イベントをイベントフローに送出します。 Dispatches an event into the event flow.
EventIntegrator
  
error(errorFunction:Function):Command
コマンド実行中に例外エラーが発生した場合に呼び出される関数を設定します。 関数実行時の this 参照はエラーが発生したコマンドインスタンスになります。
Command
  
execute(extra:Object = null):void
コマンドを実行します。
Command
  
実行中のコマンド処理が完了したことを通知します。 このメソッドを実行するためには、事前に execute() メソッドが実行されている必要があります。
Command
  
指定された id と同じ値が設定されている Command インスタンスを返します。
Command
  
getCommandsByGroup(group:String, sort:Boolean = false):Array
指定された group と同じ値を持つ Command インスタンスを含む配列を返します。
Command
  
getCommandsByRegExp(fieldName:String, pattern:RegExp, sort:Boolean = false):Array
指定された fieldName が条件と一致する Command インスタンスを含む配列を返します。
Command
 Inherited
hasEventListener(type:String):Boolean
[override] EventIntegrator インスタンスに、特定のイベントタイプに対して登録されたリスナーがあるかどうかを確認します。 Checks whether the EventDispatcher object has any listeners registered for a specific type of event.
EventIntegrator
  
interrupt(enforced:Boolean = false, extra:Object = null):void
コマンド処理を中断します。 このメソッドを実行するためには、事前に execute() メソッドが実行されている必要があります。
Command
  
実行中のコマンド中断処理が完了したことを通知します。 このメソッドを実行するためには、事前に interrupt() メソッドが実行されている必要があります。
Command
  
listen(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0):Command
コマンド実行中にイベントが発生した場合に呼び出されるリスナー関数を設定します。
Command
 Inherited
removeAllListeners(completely:Boolean = false):void
addEventListener() メソッド経由で登録された全てのイベントリスナー登録を削除します。 完全に登録を削除しなかった場合には、削除されたイベントリスナーを restoreRemovedListeners() メソッドで復帰させることができます。 Remove the whole event listener registered via addEventListener() method.
EventIntegrator
 Inherited
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
[override] EventIntegrator インスタンスからリスナーを削除します。 このメソッドを使用して削除されたリスナーは、restoreRemovedListeners() メソッドで再登録させることができます。 Remove the listener from EventIntegrator instance.
EventIntegrator
 Inherited
removeEventListener() メソッド、または removeAllListeners() メソッド経由で削除された全てイベントリスナーを再登録します。 Re-register the whole event listener removed via removeEventListener() or removeAllListeners() method.
EventIntegrator
  
setProperties(props:Object):Command
コマンドに対して、複数のプロパティを一括設定します。
Command
  
toString():String
[override] 指定されたオブジェクトのストリング表現を返します。 Returns the string representation of the specified object.
Command
 Inherited
willTrigger(type:String):Boolean
[override] 指定されたイベントタイプについて、この EventIntegrator インスタンスまたはその祖先にイベントリスナーが登録されているかどうかを確認します。 Checks whether an event listener is registered with this EventDispatcher object or any of its ancestors for the specified event type.
EventIntegrator
Protected Methods
 MethodDefined By
  
_catchError(target:Command, error:Error):void
コマンド処理でエラーが発生した場合の処理を行います。 エラー処理が発生すると、コマンド処理が停止します。 問題を解決し、通常フローに戻す場合には executeComplete() メソッドを、問題が解決されない為に中断処理を行いたい場合には interrupt() メソッドを実行してください。 関数内で問題が解決、または中断処理に移行しなかった場合には CommandEvent.COMMAND_ERROR イベントが送出されます。 関数実行時の this 参照は実行しているコマンドインスタンスになります。
Command
Events
 Event Summary Defined By
  コマンドがコマンドリストに追加された場合に送出されます。Command
  コマンドの処理が完了した場合に送出されます。Command
  コマンド処理中にエラーが発生した場合に送出されます。Command
  コマンドの処理を停止した場合に送出されます。Command
  コマンドがコマンドリストから削除された場合に送出されます。Command
  コマンドの処理が開始された場合に送出されます。Command
Property Detail
__lengthproperty
__length:int


Implementation
    progression_internal function get __length():int
    progression_internal function set __length(value:int):void
__nextproperty 
__next:Command


Implementation
    progression_internal function get __next():Command
    progression_internal function set __next(value:Command):void
__parentproperty 
__parent:CommandList


Implementation
    progression_internal function get __parent():CommandList
    progression_internal function set __parent(value:CommandList):void
__previousproperty 
__previous:Command


Implementation
    progression_internal function get __previous():Command
    progression_internal function set __previous(value:Command):void
__rootproperty 
__root:Command


Implementation
    progression_internal function get __root():Command
    progression_internal function set __root(value:Command):void
classNameproperty 
className:String  [read-only]

インスタンスのクラス名を取得します。 Indicates the instance className of the Command.


Implementation
    public function get className():String
defaultTimeOutproperty 
defaultTimeOut:int


Implementation
    public static function get defaultTimeOut():int
    public static function set defaultTimeOut(value:int):void
delayproperty 
delay:int

コマンド実行までの遅延時間(ミリ秒)を取得または設定します。


Implementation
    public function get delay():int
    public function set delay(value:int):void
enabledproperty 
enabled:Boolean

コマンドが実行可能かどうかを取得または設定します。 この値を false に設定した状態で execute() メソッドを実行すると、何も処理を行わずに CommandEvent.COMMAND_COMPLETE イベントを送出します。


Implementation
    public function get enabled():Boolean
    public function set enabled(value:Boolean):void
enforcedInterruptingproperty 
enforcedInterrupting:Boolean  [read-only]

コマンドが強制中断処理中かどうかを取得します。


Implementation
    public function get enforcedInterrupting():Boolean
extraproperty 
extra:Object  [read-only]

execute() メソッド実行時に引数として指定されたオブジェクトを取得します。 このコマンドが親の CommandList インスタンスによって実行されている場合には、親の extra オブジェクトの内容をコマンド実行順にリレーする形で引き継ぎます。


Implementation
    public function get extra():Object
groupproperty 
group:String

インスタンスのグループ名を取得または設定します。 Indicates the instance group of the Command.


Implementation
    public function get group():String
    public function set group(value:String):void
idproperty 
id:String

インスタンスの識別子を取得または設定します。 Indicates the instance id of the Command.


Implementation
    public function get id():String
    public function set id(value:String):void
interruptingproperty 
interrupting:Boolean  [read-only]

コマンドが中断処理中かどうかを取得します。


Implementation
    public function get interrupting():Boolean
latestDataproperty 
latestData:*

CommandList 上で、自身より前に実行された外部データ読み込み系のコマンドが持っている外部データを取得します。


Implementation
    public function get latestData():*
    public function set latestData(value:any):void
lengthproperty 
length:int  [read-only]

コマンドの深度を取得します。


Implementation
    public function get length():int
nameproperty 
name:String

インスタンスの名前を取得または設定します。 Indicates the instance name of the Command.


Implementation
    public function get name():String
    public function set name(value:String):void
nextproperty 
next:Command  [read-only]

このコマンドが CommandList インスタンスに関連付けられている場合に、次に位置するコマンドを取得します。


Implementation
    public function get next():Command
parentproperty 
parent:CommandList  [read-only]

このコマンドを子に含んでいる親の CommandList インスタンスを取得します。


Implementation
    public function get parent():CommandList
previousproperty 
previous:Command  [read-only]

このコマンドが CommandList インスタンスに関連付けられている場合に、前に位置するコマンドを取得します。


Implementation
    public function get previous():Command
rootproperty 
root:Command  [read-only]

コマンドツリー構造の一番上に位置するコマンドを取得します。


Implementation
    public function get root():Command
runningproperty 
running:Boolean  [read-only]

コマンドが実行中かどうかを取得します。


Implementation
    public function get running():Boolean
scopeproperty 
scope:Object

コマンド実行処理、および中断処理のタイムアウト時間(ミリ秒)を取得または設定します。 指定された時間中に executeComplete() メソッド、もしくは interruptComplete() が実行されなかった場合にエラーが送出されます。 この値が 0 に設定されている場合、タイムアウトは発生しません。


Implementation
    public function get scope():Object
    public function set scope(value:Object):void
thresholdLengthproperty 
thresholdLength:int


Implementation
    public static function get thresholdLength():int
    public static function set thresholdLength(value:int):void
timeOutproperty 
timeOut:int

コマンド実行処理、および中断処理のタイムアウト時間(ミリ秒)を取得または設定します。 指定された時間中に executeComplete() メソッド、もしくは interruptComplete() が実行されなかった場合にエラーが送出されます。 この値が 0 に設定されている場合、タイムアウトは発生しません。


Implementation
    public function get timeOut():int
    public function set timeOut(value:int):void
Constructor Detail
Command()Constructor
public function Command(executeFunction:Function = null, interruptFunction:Function = null, initObject:Object = null)

新しい Command インスタンスを作成します。 Creates a new Command object.

Parameters
executeFunction:Function (default = null)コマンドの実行関数です。
 
interruptFunction:Function (default = null)コマンドの中断関数です。
 
initObject:Object (default = null)設定したいプロパティを含んだオブジェクトです。
Method Detail
_catchError()method
protected function _catchError(target:Command, error:Error):void

コマンド処理でエラーが発生した場合の処理を行います。 エラー処理が発生すると、コマンド処理が停止します。 問題を解決し、通常フローに戻す場合には executeComplete() メソッドを、問題が解決されない為に中断処理を行いたい場合には interrupt() メソッドを実行してください。 関数内で問題が解決、または中断処理に移行しなかった場合には CommandEvent.COMMAND_ERROR イベントが送出されます。 関数実行時の this 参照は実行しているコマンドインスタンスになります。

Parameters

target:Command
 
error:Error

after()method 
public function after(afterFunction:Function, ... afterArgs):Command

コマンドの実行完了直後に処理させたい関数を設定します。 関数実行時の this 参照は実行しているコマンドインスタンスになります。

Parameters

afterFunction:Function実行させたい関数です。
 
... afterArgs関数実行時に引数として使用したい配列です。

Returns
Command自身の参照です。
apply()method 
public function apply(applyFunction:Function, ... applyArgs):Command

コマンドに対してすぐに関数を実行します。 関数実行時の this 参照は実行しているコマンドインスタンスになります。

Parameters

applyFunction:Function実行させたい関数です。
 
... applyArgs関数実行時に引数として使用したい配列です。

Returns
Command自身の参照です。
before()method 
public function before(beforeFunction:Function, ... beforeArgs):Command

コマンドの実行直前に処理させたい関数を設定します。 関数実行時の this 参照は実行しているコマンドインスタンスになります。

Parameters

beforeFunction:Function実行させたい関数です。
 
... beforeArgs関数実行時に引数として使用したい配列です。

Returns
Command自身の参照です。
clone()method 
public function clone():Command

Command インスタンスのコピーを作成して、各プロパティの値を元のプロパティの値と一致するように設定します。 Duplicates an instance of an Command subclass.

Returns
Command元のオブジェクトと同じプロパティ値を含む新しい Command インスタンスです。 A new Command object that is identical to the original.
error()method 
public function error(errorFunction:Function):Command

コマンド実行中に例外エラーが発生した場合に呼び出される関数を設定します。 関数実行時の this 参照はエラーが発生したコマンドインスタンスになります。

Parameters

errorFunction:Function実行させたい関数です。

Returns
Command自身の参照です。
execute()method 
public function execute(extra:Object = null):void

コマンドを実行します。

Parameters

extra:Object (default = null)実行時にコマンドフローをリレーするオブジェクトです。

executeComplete()method 
public function executeComplete():void

実行中のコマンド処理が完了したことを通知します。 このメソッドを実行するためには、事前に execute() メソッドが実行されている必要があります。

getCommandById()method 
public function getCommandById(id:String):Command

指定された id と同じ値が設定されている Command インスタンスを返します。

Parameters

id:String条件となるストリングです。

Returns
Command条件と一致するインスタンスです。
getCommandsByGroup()method 
public function getCommandsByGroup(group:String, sort:Boolean = false):Array

指定された group と同じ値を持つ Command インスタンスを含む配列を返します。

Parameters

group:String条件となるストリングです。
 
sort:Boolean (default = false)配列をソートするかどうかを指定します。

Returns
Array条件と一致するインスタンスです。
getCommandsByRegExp()method 
public function getCommandsByRegExp(fieldName:String, pattern:RegExp, sort:Boolean = false):Array

指定された fieldName が条件と一致する Command インスタンスを含む配列を返します。

Parameters

fieldName:String調査するフィールド名です。
 
pattern:RegExp条件となる正規表現です。
 
sort:Boolean (default = false)配列をソートするかどうかを指定します。

Returns
Array条件と一致するインスタンスです。
interrupt()method 
public function interrupt(enforced:Boolean = false, extra:Object = null):void

コマンド処理を中断します。 このメソッドを実行するためには、事前に execute() メソッドが実行されている必要があります。

Parameters

enforced:Boolean (default = false)現在実行中のコマンド以降の中断処理を無視して、強制的に中断するかどうかです。
 
extra:Object (default = null)実行時にコマンドフローをリレーするオブジェクトです。

interruptComplete()method 
public function interruptComplete():void

実行中のコマンド中断処理が完了したことを通知します。 このメソッドを実行するためには、事前に interrupt() メソッドが実行されている必要があります。

listen()method 
public function listen(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0):Command

コマンド実行中にイベントが発生した場合に呼び出されるリスナー関数を設定します。

Parameters

type:Stringイベントのタイプです。
 
listener:Functionイベントを処理するリスナー関数です。この関数は Event インスタンスを唯一のパラメータとして受け取り、何も返さないものである必要があります。関数は任意の名前を持つことができます。
 
useCapture:Boolean (default = false)リスナーが、キャプチャ段階、またはターゲットおよびバブリング段階で動作するかどうかを判断します。useCapture を true に設定すると、リスナーはキャプチャ段階のみでイベントを処理し、ターゲット段階またはバブリング段階では処理しません。useCapture を false に設定すると、リスナーはターゲット段階またはバブリング段階のみでイベントを処理します。3 つの段階すべてでイベントを受け取るには、addEventListener を 2 回呼び出します。useCapture を true に設定して 1 度呼び出し、useCapture を false に設定してもう一度呼び出します。
 
priority:int (default = 0)イベントリスナーの優先度レベルです。優先度は、符号付き 32 ビット整数で指定します。数値が大きくなるほど優先度が高くなります。優先度が n のすべてのリスナーは、優先度が n -1 のリスナーよりも前に処理されます。複数のリスナーに対して同じ優先度が設定されている場合、それらは追加された順番に処理されます。デフォルトの優先度は 0 です。

Returns
Command自身の参照です。
setProperties()method 
public function setProperties(props:Object):Command

コマンドに対して、複数のプロパティを一括設定します。

Parameters

props:Object設定したいプロパティを含んだオブジェクトです。

Returns
Command設定対象の Command インスタンスです。
toString()method 
override public function toString():String

指定されたオブジェクトのストリング表現を返します。 Returns the string representation of the specified object.

Returns
Stringオブジェクトのストリング表現です。 A string representation of the object.
Event Detail
commandAdded Event
Event Object Type: jp.progression.events.CommandEvent
CommandEvent.type property = jp.progression.events.CommandEvent.COMMAND_ADDED

コマンドがコマンドリストに追加された場合に送出されます。

commandAdded イベントオブジェクトの type プロパティ値を定義します。 The CommandEvent.COMMAND_ADDED constant defines the value of the type property of an commandAdded event object.
commandComplete Event  
Event Object Type: jp.progression.events.CommandEvent
CommandEvent.type property = jp.progression.events.CommandEvent.COMMAND_COMPLETE

コマンドの処理が完了した場合に送出されます。

commandComplete イベントオブジェクトの type プロパティ値を定義します。 The CommandEvent.COMMAND_COMPLETE constant defines the value of the type property of an commandComplete event object.
commandError Event  
Event Object Type: jp.progression.events.CommandEvent
CommandEvent.type property = jp.progression.events.CommandEvent.COMMAND_ERROR

コマンド処理中にエラーが発生した場合に送出されます。

commandError イベントオブジェクトの type プロパティ値を定義します。 The CommandEvent.COMMAND_ERROR constant defines the value of the type property of an commandError event object.
commandInterrupt Event  
Event Object Type: jp.progression.events.CommandEvent
CommandEvent.type property = jp.progression.events.CommandEvent.COMMAND_INTERRUPT

コマンドの処理を停止した場合に送出されます。

commandInterrupt イベントオブジェクトの type プロパティ値を定義します。 The CommandEvent.COMMAND_INTERRUPT constant defines the value of the type property of an commandInterrupt event object.
commandRemoved Event  
Event Object Type: jp.progression.events.CommandEvent
CommandEvent.type property = jp.progression.events.CommandEvent.COMMAND_REMOVED

コマンドがコマンドリストから削除された場合に送出されます。

commandRemoved イベントオブジェクトの type プロパティ値を定義します。 The CommandEvent.COMMAND_REMOVED constant defines the value of the type property of an commandRemoved event object.
commandStart Event  
Event Object Type: jp.progression.events.CommandEvent
CommandEvent.type property = jp.progression.events.CommandEvent.COMMAND_START

コマンドの処理が開始された場合に送出されます。

commandStart イベントオブジェクトの type プロパティ値を定義します。 The CommandEvent.COMMAND_START constant defines the value of the type property of an commandStart event object.
Examples