Packagejp.progression.commands
Classpublic class LoadChild
InheritanceLoadChild Inheritance Command Inheritance EventIntegrator Inheritance flash.events.EventDispatcher

LoadChild クラスは、対象の DisplayObjectContainer インスタンスのディスプレイリストに request プロパティに設定された外部 SWF ファイルを読み込んで追加するコマンドクラスです。 読み込む対象の SWF ファイルのドキュメントクラスが ICastObject インターフェイスを実装している場合には、CastEvent.ADDED イベントが送出され、 対象のイベント処理の実行中に、addCommand() メソッド、及び insertCommand() メソッドによるコマンドの同期処理が行えます。

View the examples



Public Properties
 PropertyDefined By
  autoAlpha : int
読み込んだファイル内容を表示する際に、alpha プロパティを使用したアルファフェード効果を適用するミリ秒を取得または設定します。 この値が 0 である場合には、アルファフェード効果は無効化されます。
LoadChild
 InheritedclassName : String
[read-only] インスタンスのクラス名を取得します。 Indicates the instance className of the Command.
Command
  container : DisplayObjectContainer
読み込んだファイル内容を追加する対象のディスプレイリストを含む DisplayObjectContainer インスタンスを取得または設定します。
LoadChild
  context : LoaderContext
ポリシーファイルの存在の確認や、ApplicationDomain 及び SecurityDomain の設定を行う LoaderContext を取得または設定します。
LoadChild
 InheriteddefaultTimeOut : int
[static]
Command
 Inheriteddelay : int
コマンド実行までの遅延時間(ミリ秒)を取得または設定します。
Command
 Inheritedenabled : Boolean
コマンドが実行可能かどうかを取得または設定します。 この値を false に設定した状態で execute() メソッドを実行すると、何も処理を行わずに CommandEvent.COMMAND_COMPLETE イベントを送出します。
Command
 InheritedenforcedInterrupting : Boolean
[read-only] コマンドが強制中断処理中かどうかを取得します。
Command
 Inheritedextra : Object
[read-only] execute() メソッド実行時に引数として指定されたオブジェクトを取得します。 このコマンドが親の CommandList インスタンスによって実行されている場合には、親の extra オブジェクトの内容をコマンド実行順にリレーする形で引き継ぎます。
Command
 Inheritedgroup : String
インスタンスのグループ名を取得または設定します。 Indicates the instance group of the Command.
Command
 Inheritedid : String
インスタンスの識別子を取得または設定します。 Indicates the instance id of the Command.
Command
 Inheritedinterrupting : Boolean
[read-only] コマンドが中断処理中かどうかを取得します。
Command
 InheritedlatestData : *
CommandList 上で、自身より前に実行された外部データ読み込み系のコマンドが持っている外部データを取得します。
Command
 Inheritedlength : int
[read-only] コマンドの深度を取得します。
Command
  loader : CastLoader
[read-only] この LoadChild オブジェクトに関係した CastLoader オブジェクトです。
LoadChild
 Inheritedname : String
インスタンスの名前を取得または設定します。 Indicates the instance name of the Command.
Command
 Inheritednext : Command
[read-only] このコマンドが CommandList インスタンスに関連付けられている場合に、次に位置するコマンドを取得します。
Command
 Inheritedparent : CommandList
[read-only] このコマンドを子に含んでいる親の CommandList インスタンスを取得します。
Command
 Inheritedprevious : Command
[read-only] このコマンドが CommandList インスタンスに関連付けられている場合に、前に位置するコマンドを取得します。
Command
  request : URLRequest
読み込みたい SWF、JPEG、GIF、または PNG ファイルの絶対 URL または相対 URL を取得または設定します。
LoadChild
 Inheritedroot : Command
[read-only] コマンドツリー構造の一番上に位置するコマンドを取得します。
Command
 Inheritedrunning : Boolean
[read-only] コマンドが実行中かどうかを取得します。
Command
 Inheritedscope : Object
コマンド実行処理、および中断処理のタイムアウト時間(ミリ秒)を取得または設定します。 指定された時間中に executeComplete() メソッド、もしくは interruptComplete() が実行されなかった場合にエラーが送出されます。 この値が 0 に設定されている場合、タイムアウトは発生しません。
Command
 InheritedthresholdLength : int
[static]
Command
 InheritedtimeOut : int
コマンド実行処理、および中断処理のタイムアウト時間(ミリ秒)を取得または設定します。 指定された時間中に executeComplete() メソッド、もしくは interruptComplete() が実行されなかった場合にエラーが送出されます。 この値が 0 に設定されている場合、タイムアウトは発生しません。
Command
Public Methods
 MethodDefined By
  
LoadChild(container:DisplayObjectContainer, request:URLRequest, initObject:Object = null)
新しい LoadChild インスタンスを作成します。 Creates a new LoadChild object.
LoadChild
 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
 Inherited
after(afterFunction:Function, ... afterArgs):Command
コマンドの実行完了直後に処理させたい関数を設定します。 関数実行時の this 参照は実行しているコマンドインスタンスになります。
Command
 Inherited
apply(applyFunction:Function, ... applyArgs):Command
コマンドに対してすぐに関数を実行します。 関数実行時の this 参照は実行しているコマンドインスタンスになります。
Command
 Inherited
before(beforeFunction:Function, ... beforeArgs):Command
コマンドの実行直前に処理させたい関数を設定します。 関数実行時の this 参照は実行しているコマンドインスタンスになります。
Command
  
[override] LoadChild インスタンスのコピーを作成して、各プロパティの値を元のプロパティの値と一致するように設定します。 Duplicates an instance of an LoadChild subclass.
LoadChild
 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
 Inherited
error(errorFunction:Function):Command
コマンド実行中に例外エラーが発生した場合に呼び出される関数を設定します。 関数実行時の this 参照はエラーが発生したコマンドインスタンスになります。
Command
 Inherited
execute(extra:Object = null):void
コマンドを実行します。
Command
 Inherited
実行中のコマンド処理が完了したことを通知します。 このメソッドを実行するためには、事前に execute() メソッドが実行されている必要があります。
Command
 Inherited
指定された id と同じ値が設定されている Command インスタンスを返します。
Command
 Inherited
getCommandsByGroup(group:String, sort:Boolean = false):Array
指定された group と同じ値を持つ Command インスタンスを含む配列を返します。
Command
 Inherited
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
 Inherited
interrupt(enforced:Boolean = false, extra:Object = null):void
コマンド処理を中断します。 このメソッドを実行するためには、事前に execute() メソッドが実行されている必要があります。
Command
 Inherited
実行中のコマンド中断処理が完了したことを通知します。 このメソッドを実行するためには、事前に interrupt() メソッドが実行されている必要があります。
Command
 Inherited
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
 Inherited
setProperties(props:Object):Command
コマンドに対して、複数のプロパティを一括設定します。
Command
 Inherited
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
 Inherited
_catchError(target:Command, error:Error):void
コマンド処理でエラーが発生した場合の処理を行います。 エラー処理が発生すると、コマンド処理が停止します。 問題を解決し、通常フローに戻す場合には executeComplete() メソッドを、問題が解決されない為に中断処理を行いたい場合には interrupt() メソッドを実行してください。 関数内で問題が解決、または中断処理に移行しなかった場合には CommandEvent.COMMAND_ERROR イベントが送出されます。 関数実行時の this 参照は実行しているコマンドインスタンスになります。
Command
Events
 Event Summary Defined By
 Inheritedコマンドがコマンドリストに追加された場合に送出されます。Command
 Inheritedコマンドの処理が完了した場合に送出されます。Command
 Inheritedコマンド処理中にエラーが発生した場合に送出されます。Command
 Inheritedコマンドの処理を停止した場合に送出されます。Command
 Inheritedコマンドがコマンドリストから削除された場合に送出されます。Command
 Inheritedコマンドの処理が開始された場合に送出されます。Command
  データが正常にロードされたときに送出されます。LoadChild
  ネットワーク要求が HTTP を介して行われ、Flash Player が HTTP 状況コードを検出できる場合に送出されます。LoadChild
  入出力エラーが発生してロード処理が失敗したときに送出されます。LoadChild
  ロード操作が開始したときに送出されます。LoadChild
  ダウンロード処理を実行中にデータを受信したときに送出されます。LoadChild
  ロードされたオブジェクトが Loader オブジェクトの unload() メソッドを使用して削除されるたびに、LoaderInfo オブジェクトによって送出されます。LoadChild
Property Detail
autoAlphaproperty
autoAlpha:int

読み込んだファイル内容を表示する際に、alpha プロパティを使用したアルファフェード効果を適用するミリ秒を取得または設定します。 この値が 0 である場合には、アルファフェード効果は無効化されます。


Implementation
    public function get autoAlpha():int
    public function set autoAlpha(value:int):void
containerproperty 
container:DisplayObjectContainer

読み込んだファイル内容を追加する対象のディスプレイリストを含む DisplayObjectContainer インスタンスを取得または設定します。


Implementation
    public function get container():DisplayObjectContainer
    public function set container(value:DisplayObjectContainer):void
contextproperty 
context:LoaderContext

ポリシーファイルの存在の確認や、ApplicationDomain 及び SecurityDomain の設定を行う LoaderContext を取得または設定します。


Implementation
    public function get context():LoaderContext
    public function set context(value:LoaderContext):void
loaderproperty 
loader:CastLoader  [read-only]

この LoadChild オブジェクトに関係した CastLoader オブジェクトです。


Implementation
    public function get loader():CastLoader
requestproperty 
request:URLRequest

読み込みたい SWF、JPEG、GIF、または PNG ファイルの絶対 URL または相対 URL を取得または設定します。


Implementation
    public function get request():URLRequest
    public function set request(value:URLRequest):void
Constructor Detail
LoadChild()Constructor
public function LoadChild(container:DisplayObjectContainer, request:URLRequest, initObject:Object = null)

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

Parameters
container:DisplayObjectContainer読み込んだファイル内容を表示リストを追加する対象の DisplayObjectContainer インスタンスです。
 
request:URLRequest読み込みたい SWF、JPEG、GIF、または PNG ファイルの絶対 URL または相対 URL です。
 
initObject:Object (default = null)設定したいプロパティを含んだオブジェクトです。
Method Detail
clone()method
override public function clone():Command

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

Returns
Command元のオブジェクトと同じプロパティ値を含む新しい LoadChild インスタンスです。 A new LoadChild object that is identical to the original.
Event Detail
complete Event
Event Object Type: flash.events.Event
Event.type property = flash.events.Event.COMPLETE

データが正常にロードされたときに送出されます。

httpStatus Event  
Event Object Type: flash.events.HTTPStatusEvent
HTTPStatusEvent.type property = flash.events.HTTPStatusEvent.HTTP_STATUS

ネットワーク要求が HTTP を介して行われ、Flash Player が HTTP 状況コードを検出できる場合に送出されます。

ioError Event  
Event Object Type: flash.events.IOErrorEvent
IOErrorEvent.type property = flash.events.IOErrorEvent.IO_ERROR

入出力エラーが発生してロード処理が失敗したときに送出されます。

open Event  
Event Object Type: flash.events.Event
Event.type property = flash.events.Event.OPEN

ロード操作が開始したときに送出されます。

progress Event  
Event Object Type: flash.events.ProgressEvent
ProgressEvent.type property = flash.events.ProgressEvent.PROGRESS

ダウンロード処理を実行中にデータを受信したときに送出されます。

unload Event  
Event Object Type: flash.events.Event
Event.type property = flash.events.Event.UNLOAD

ロードされたオブジェクトが Loader オブジェクトの unload() メソッドを使用して削除されるたびに、LoaderInfo オブジェクトによって送出されます。

Examples
     // 表示コンテナとなる Sprite インスタンスを作成します。
     var container:Sprite = new Sprite();
     
     // LoadChild コマンドを作成します。
     var com:LoadChild = new LoadChild( container, new URLRequest( "external.swf" ) );
     
     // オブジェクトの load() メソッドによる読み込みが開始された瞬間に送出されます。
     com.loader.onCastLoadStart = function():void {
         this.addCommand(
             new Trace( "onCastLoadStart" )
         );
     };
     
     // オブジェクトの load() メソッドによる読み込みが完了された瞬間に送出されます。
     com.loader.onCastLoadComplete = function():void {
         this.addCommand(
             new Trace( "onCastLoadComplete" )
         );
     };
     
     // エラー処理を設定します。
     com.error( function( e:Error ):void {
         // エラーを解決します。
         this.executeComplete();
     } );
     
     // LoadChild コマンドを実行します。
     com.execute();