Packagejp.progression.commands
Classpublic class Command
InheritanceCommand Inheritance flash.events.EventDispatcher
ImplementsIIdGroup, jp.progression.core.impls.IDisposable
SubclassesAddChild, Break, CommandList, DoExecutor, DoSound, DoTransition, DoTween, DoTweener, DoTweenFrame, Func, Goto, Jumpto, Listen, LoadCommand, NavigateToURL, PreloadSWF, Prop, RemoveAllChildren, RemoveChild, Return, SendToURL, Stop, Trace, Var, Wait

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


Example
  // Command インスタンスを作成する
  var com:Command = new Command();
  
  // コマンドを実行する
  com.execute();
  

See also

jp.progression.commands.getCommandById()
jp.progression.commands.getCommandsByGroup()


Public Properties
 PropertyDefined by
  catchError : Function
コマンドの実行中に例外が発生した際に実行するエラー処理関数を取得または設定します。
Command
  className : String
[read-only] インスタンスのクラス名を取得します。 Indicates the instance className of the Command.
Command
  defaultInterruptType : int
[static] interruptType プロパティの初期値を取得または設定します。 すでに生成済みのコマンドに対しては適用されません。
Command
  defaultTimeout : Number
[static] timeout プロパティの初期値を取得または設定します。 すでに生成済みのコマンドに対しては適用されません。
Command
  delay : Number
コマンドが実際に実行されるまでの遅延時間を取得または設定します。 コマンド実行中に値を変更しても、処理に対して反映されません。
Command
  depth : int
[read-only] コマンドツリー構造上での自身の深度を取得します。
Command
  extra : Object
コマンドの実行処理、または中断処理の開始時に指定されているリレーオブジェクトを取得または設定します。 このコマンドが親の CommandList インスタンスによって実行されている場合には、親のリレーオブジェクトを順々に引き継ぎます。
Command
  group : String
インスタンスのグループ名を取得または設定します。 Indicates the instance group of the Command.
Command
  id : String
インスタンスを表すユニークな識別子を取得または設定します。
Command
  interruptType : int
中断処理時の処理方法を取得または設定します。 コマンド実行中に値を変更しても、処理に対して反映されません。
Command
  latestData : *
自身から見て最後に関連付けられた読み込みデータを取得または設定します。 このコマンドが CommandList インスタンス上に存在する場合には、自身より前、または自身の親のデータを取得します。
Command
  name : String
インスタンスの名前を取得または設定します。 Indicates the instance name of the Command.
Command
  next : Command
[read-only] このコマンドが関連付けられている親の CommandList インスタンス内で、次に位置する Command インスタンスを取得します。
Command
  onComplete : Function
コマンドオブジェクトが ExecuteEvent.EXECUTE_COMPLETE イベントを受け取った場合に呼び出されるイベントハンドラメソッドを取得または設定します。
Command
  onError : Function
コマンドオブジェクトが ExecuteErrorEvent.EXECUTE_ERROR イベントを受け取った場合に呼び出されるイベントハンドラメソッドを取得または設定します。
Command
  onInterrupt : Function
コマンドオブジェクトが ExecuteEvent.EXECUTE_INTERRUPT イベントを受け取った場合に呼び出されるイベントハンドラメソッドを取得または設定します。
Command
  onStart : Function
コマンドオブジェクトが ExecuteEvent.EXECUTE_START イベントを受け取った場合に呼び出されるイベントハンドラメソッドを取得または設定します。
Command
  parent : CommandList
[read-only] この Command オブジェクトを含む CommandList オブジェクトを示します。 Indicates the CommandList object that contains this Command object.
Command
  previous : Command
[read-only] このコマンドが関連付けられている親の CommandList インスタンス内で、一つ前に位置する Command インスタンスを取得します。
Command
  root : Command
[read-only] コマンドツリー構造の一番上に位置する Command インスタンスを取得します。
Command
  scope : Object
コマンドの実行処理、または中断処理に指定されている関数内でのスコープ対象を取得または設定します。
Command
  state : int
[read-only] コマンドの実行状態を取得します。
Command
  thresholdLength : int
[static] 同一プロセス上で実行可能な最大コマンド数を取得または設定します。 設定された閾値を超えて実行された場合には、強制的に 1 ミリ秒の遅延を発生させます。 この値が大きすぎる場合、スタックオーバーフローが発生する可能性があります。
Command
  timeout : Number
コマンドの実行中のタイムアウト時間を取得または設定します。 指定された時間中に executeComplete() メソッド、または interrupt() メソッドが実行されなかった場合にはエラーが送出されます。 この値が 0 に設定されている場合、タイムアウト処理は発生しません。
Command
Public Methods
 MethodDefined by
  
Command(executeFunction:Function = null, interruptFunction:Function = null, initObject:Object = null)
新しい Command インスタンスを作成します。 Creates a new Command object.
Command
  
Command インスタンスのコピーを作成して、各プロパティの値を元のプロパティの値と一致するように設定します。 Duplicates an instance of an Command subclass.
Command
  
dispose():void
保持しているデータを解放します。
Command
  
execute(extra:Object = null):void
コマンド処理を実行します。
Command
  
実行中のコマンド処理が完了したことを通知します。 このメソッドを実行するためには、事前に execute() メソッドが実行されている必要があります。
Command
  
interrupt(enforced:Boolean = false):void
コマンド処理を中断します。 このメソッドを実行するためには、事前に execute() メソッドが実行されている必要があります。
Command
  
setProperties(parameters:Object):Command
インスタンスに対して、複数のプロパティを一括設定します。
Command
  
toString():String
指定されたオブジェクトのストリング表現を返します。 Returns the string representation of the specified object.
Command
Protected Methods
 MethodDefined by
  
throwError(target:Command, error:Error):void
コマンド処理中に例外が発生したことを通知します。 エラー処理が発生すると、コマンド処理が停止します。 問題を解決し、通常フローに戻す場合には executeComplete() メソッドを、問題が解決されず中断処理を行いたい場合には interrupt() メソッドを実行してください。 関数内で問題が解決、または中断処理に移行しなかった場合には ExecuteErrorEvent.EXECUTE_ERROR イベントが送出されます。
Command
Events
 EventSummaryDefined by
   処理が完了した場合に送出されます。 Command
   処理の途中でエラーが発生した場合に送出されます。 Command
   処理が中断された場合に送出されます。 Command
   処理が開始された場合に送出されます。 Command
Property detail
catchErrorproperty
catchError:Function  [read-write]

コマンドの実行中に例外が発生した際に実行するエラー処理関数を取得または設定します。

Implementation
    public function get catchError():Function
    public function set catchError(value:Function):void

See also

classNameproperty 
className:String  [read-only]

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

Implementation
    public function get className():String
defaultInterruptTypeproperty 
defaultInterruptType:int  [read-write]

interruptType プロパティの初期値を取得または設定します。 すでに生成済みのコマンドに対しては適用されません。

Implementation
    public static function get defaultInterruptType():int
    public function set defaultInterruptType(value:int):void

See also

defaultTimeoutproperty 
defaultTimeout:Number  [read-write]

timeout プロパティの初期値を取得または設定します。 すでに生成済みのコマンドに対しては適用されません。

Implementation
    public static function get defaultTimeout():Number
    public function set defaultTimeout(value:Number):void

See also

delayproperty 
delay:Number  [read-write]

コマンドが実際に実行されるまでの遅延時間を取得または設定します。 コマンド実行中に値を変更しても、処理に対して反映されません。

Implementation
    public function get delay():Number
    public function set delay(value:Number):void

See also

depthproperty 
depth:int  [read-only]

コマンドツリー構造上での自身の深度を取得します。

Implementation
    public function get depth():int
extraproperty 
extra:Object  [read-write]

コマンドの実行処理、または中断処理の開始時に指定されているリレーオブジェクトを取得または設定します。 このコマンドが親の CommandList インスタンスによって実行されている場合には、親のリレーオブジェクトを順々に引き継ぎます。

Implementation
    public function get extra():Object
    public function set extra(value:Object):void

See also

groupproperty 
group:String  [read-write]

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

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

See also

idproperty 
id:String  [read-write]

インスタンスを表すユニークな識別子を取得または設定します。

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

See also

interruptTypeproperty 
interruptType:int  [read-write]

中断処理時の処理方法を取得または設定します。 コマンド実行中に値を変更しても、処理に対して反映されません。

Implementation
    public function get interruptType():int
    public function set interruptType(value:int):void

See also

latestDataproperty 
latestData:*  [read-write]

自身から見て最後に関連付けられた読み込みデータを取得または設定します。 このコマンドが CommandList インスタンス上に存在する場合には、自身より前、または自身の親のデータを取得します。

Implementation
    public function get latestData():*
    public function set latestData(value:*):void
nameproperty 
name:String  [read-write]

インスタンスの名前を取得または設定します。 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 インスタンス内で、次に位置する Command インスタンスを取得します。

Implementation
    public function get next():Command

See also

onCompleteproperty 
onComplete:Function  [read-write]

コマンドオブジェクトが ExecuteEvent.EXECUTE_COMPLETE イベントを受け取った場合に呼び出されるイベントハンドラメソッドを取得または設定します。

Implementation
    public function get onComplete():Function
    public function set onComplete(value:Function):void

See also

onErrorproperty 
onError:Function  [read-write]

コマンドオブジェクトが ExecuteErrorEvent.EXECUTE_ERROR イベントを受け取った場合に呼び出されるイベントハンドラメソッドを取得または設定します。

Implementation
    public function get onError():Function
    public function set onError(value:Function):void

See also

onInterruptproperty 
onInterrupt:Function  [read-write]

コマンドオブジェクトが ExecuteEvent.EXECUTE_INTERRUPT イベントを受け取った場合に呼び出されるイベントハンドラメソッドを取得または設定します。

Implementation
    public function get onInterrupt():Function
    public function set onInterrupt(value:Function):void

See also

onStartproperty 
onStart:Function  [read-write]

コマンドオブジェクトが ExecuteEvent.EXECUTE_START イベントを受け取った場合に呼び出されるイベントハンドラメソッドを取得または設定します。

Implementation
    public function get onStart():Function
    public function set onStart(value:Function):void

See also

parentproperty 
parent:CommandList  [read-only]

この Command オブジェクトを含む CommandList オブジェクトを示します。 Indicates the CommandList object that contains this Command object.

Implementation
    public function get parent():CommandList

See also

previousproperty 
previous:Command  [read-only]

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

Implementation
    public function get previous():Command

See also

rootproperty 
root:Command  [read-only]

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

Implementation
    public function get root():Command

See also

scopeproperty 
scope:Object  [read-write]

コマンドの実行処理、または中断処理に指定されている関数内でのスコープ対象を取得または設定します。

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

See also

stateproperty 
state:int  [read-only]

コマンドの実行状態を取得します。

Implementation
    public function get state():int

See also

thresholdLengthproperty 
thresholdLength:int  [read-write]

同一プロセス上で実行可能な最大コマンド数を取得または設定します。 設定された閾値を超えて実行された場合には、強制的に 1 ミリ秒の遅延を発生させます。 この値が大きすぎる場合、スタックオーバーフローが発生する可能性があります。

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

See also

timeoutproperty 
timeout:Number  [read-write]

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

Implementation
    public function get timeout():Number
    public function set timeout(value:Number):void

See also

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
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.
dispose()method 
public function dispose():void

保持しているデータを解放します。

execute()method 
public function execute(extra:Object = null):void

コマンド処理を実行します。

Parameters
extra:Object (default = null)実行時に設定されるリレーオブジェクトです。

See also

executeComplete()method 
public function executeComplete():void

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

See also

interrupt()method 
public function interrupt(enforced:Boolean = false):void

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

Parameters
enforced:Boolean (default = false)親が存在する場合に、親の処理も中断させたい場合には true を、自身のみ中断したい場合には false を指定します。

See also

setProperties()method 
public function setProperties(parameters:Object):Command

インスタンスに対して、複数のプロパティを一括設定します。

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

Returns
Command自身の参照です。
throwError()method 
protected function throwError(target:Command, error:Error):void

コマンド処理中に例外が発生したことを通知します。 エラー処理が発生すると、コマンド処理が停止します。 問題を解決し、通常フローに戻す場合には executeComplete() メソッドを、問題が解決されず中断処理を行いたい場合には interrupt() メソッドを実行してください。 関数内で問題が解決、または中断処理に移行しなかった場合には ExecuteErrorEvent.EXECUTE_ERROR イベントが送出されます。

Parameters
target:Command問題の発生元である Command インスタンスです。
 
error:Error原因となるエラーオブジェクトです。

See also

toString()method 
public override function toString():String

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

Returns
Stringオブジェクトのストリング表現です。 A string representation of the object.
Event detail
executeCompleteevent 
Event object type: jp.progression.events.ExecuteEvent

処理が完了した場合に送出されます。

executeErrorevent  
Event object type: jp.progression.events.ExecuteErrorEvent

処理の途中でエラーが発生した場合に送出されます。

executeInterruptevent  
Event object type: jp.progression.events.ExecuteEvent

処理が中断された場合に送出されます。

executeStartevent  
Event object type: jp.progression.events.ExecuteEvent

処理が開始された場合に送出されます。