Packagejp.progression.casts
Classpublic class CastSprite
InheritanceCastSprite Inheritance ExSprite Inheritance flash.display.Sprite
Implements ICastObject
Subclasses Background, Container

CastSprite クラスは、ExSprite クラスの基本機能を拡張し、イベントフローとの連携機能を実装した jp.progression パッケージで使用される基本的な表示オブジェクトクラスです。

View the examples



Public Properties
 PropertyDefined By
 Inheritedchildren : Array
[read-only] 子ディスプレイオブジェクトが保存されている配列です。 インデックス値が断続的に指定可能である為、getChildAt() ではなくこのプロパティを使用して子ディスプレイオブジェクト走査を行います。 この配列を操作することで元の配列を変更することはできません。 The array that saves child display objects.
ExSprite
 InheritedclassName : String
[read-only] インスタンスのクラス名を取得します。 Indicates the instance className of the IExDisplayObject.
ExSprite
  contextMenu : ContextMenu
[override]
CastSprite
  eventHandlerEnabled : Boolean
オブジェクトのイベントハンドラメソッドを有効化するかどうかを指定します。
CastSprite
  executor : CommandExecutor
[read-only] コマンドを実行する CommandExecutor インスタンスを取得します。
CastSprite
 Inheritedgroup : String
インスタンスのグループ名を取得または設定します。 Indicates the instance group of the IExDisplayObject.
ExSprite
 Inheritedid : String
インスタンスの識別子を取得または設定します。 Indicates the instance id of the IExDisplayObject.
ExSprite
 InheritedisDragging : Boolean
[read-only] startDrag() メソッドを使用したドラッグ処理を行っている最中かどうかを取得します。 Returns if the drag process which uses startDrag() method is executing.
ExSprite
  onCastAdded : Function
キャストオブジェクトが CastEvent.CAST_ADDED イベントを受け取った場合に呼び出されるイベントハンドラメソッドを取得または設定します。 このイベント処理の実行中には、addCommand() メソッド、及び insertCommand() メソッドによるコマンドの同期処理が行えます。
CastSprite
  onCastRemoved : Function
キャストオブジェクトが CastEvent.CAST_REMOVED イベントを受け取った場合に呼び出されるイベントハンドラメソッドを取得または設定します。 このイベント処理の実行中には、addCommand() メソッド、及び insertCommand() メソッドによるコマンドの同期処理が行えます。
CastSprite
  parallelMode : Boolean
CommandExecutor の実行方法を並列処理にするかどうかを取得または設定します。
CastSprite
  toolTip : ToolTip
[read-only] このオブジェクトに関連付けられている ToolTip インスタンスを取得します。
CastSprite
  uiContextMenu : CastObjectContextMenu
[read-only] このオブジェクトに関連付けられている CastObjectContextMenu インスタンスを取得します。
CastSprite
Public Methods
 MethodDefined By
  
CastSprite(initObject:Object = null)
新しい CastSprite インスタンスを作成します。 Creates a new CastSprite object.
CastSprite
 Inherited
addChild(child:DisplayObject):DisplayObject
[override] この DisplayObjectContainer インスタンスに子 DisplayObject インスタンスを追加します。 Adds a child DisplayObject instance to this DisplayObjectContainer instance.
ExSprite
 Inherited
addChildAt(child:DisplayObject, index:int):DisplayObject
[override] この DisplayObjectContainer インスタンスの指定されたインデックス位置に子 DisplayObject インスタンスを追加します。 Adds a child DisplayObject instance to this DisplayObjectContainer instance.
ExSprite
 Inherited
addChildAtAbove(child:DisplayObject, index:int):DisplayObject
この DisplayObjectContainer インスタンスの指定されたインデックス位置に子 DisplayObject インスタンスを追加します。 Adds a child DisplayObject instance to this DisplayObjectContainer instance.
ExSprite
  
addCommand(... commands):void
特定のイベントが送出された際に、自動実行させたい Command インスタンスをリストの最後尾に追加します。 追加された Command インスタンスは、イベントが送出される直前に自動的に削除されます。
CastSprite
 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.
ExSprite
 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.
ExSprite
  
clearCommand(completely:Boolean = false):void
登録されている Command インスタンスを削除します。
CastSprite
 Inherited
completelyRemoveEventListener(type:String, listener:Function, useCapture:Boolean = false):void
EventIntegrator インスタンスからリスナーを削除します。 このメソッドを使用して削除されたリスナーは、restoreRemovedListeners() メソッドで再登録させることができません。 Remove the listener from EventIntegrator instance.
ExSprite
 Inherited
contains(child:DisplayObject):Boolean
[override] 指定された表示オブジェクトが DisplayObjectContainer インスタンスの子であるか、オブジェクト自体であるかを指定します。 Determines whether the specified display object is a child of the DisplayObjectContainer instance or the instance itself.
ExSprite
 Inherited
dispatchEvent(event:Event):Boolean
[override] イベントをイベントフローに送出します。 Dispatches an event into the event flow.
ExSprite
 Inherited
getChildAt(index:int):DisplayObject
[override] 指定のインデックス位置にある子表示オブジェクトオブジェクトを返します。 Returns the child display object instance that exists at the specified index.
ExSprite
 Inherited
getChildByName(name:String):DisplayObject
[override] 指定された名前に一致する子表示オブジェクトを返します。 Returns the child display object that exists with the specified name.
ExSprite
 Inherited
getChildIndex(child:DisplayObject):int
[override] 子 DisplayObject インスタンスのインデックス位置を返します。 Returns the index position of a child DisplayObject instance.
ExSprite
 Inherited
getInstanceById(id:String):DisplayObject
指定された id と同じ値が設定されている IExDisplayObject インターフェイスを実装したインスタンスを返します。 Returns the instance implements the IExDisplayObject interface which is set the same value of the specified id.
ExSprite
 Inherited
getInstancesByGroup(group:String, sort:Boolean = false):Array
指定された group と同じ値を持つ IExDisplayObject インターフェイスを実装したインスタンスを含む配列を返します。 Returns the array contains the instance which implements the IExDisplayObject interface that has the same value of the specified group.
ExSprite
 Inherited
getInstancesByRegExp(fieldName:String, pattern:RegExp, sort:Boolean = false):Array
指定された fieldName が条件と一致する IExDisplayObject インターフェイスを実装したインスタンスを含む配列を返します。 Returns the array contains the instance which implements the IExDisplayObject interface that match the condition to the specified fieldName.
ExSprite
 Inherited
hasEventListener(type:String):Boolean
[override] EventIntegrator インスタンスに、特定のイベントタイプに対して登録されたリスナーがあるかどうかを確認します。 Checks whether the EventDispatcher object has any listeners registered for a specific type of event.
ExSprite
  
insertCommand(... commands):void
特定のイベントが送出された際に、自動実行させたい Command インスタンスをすでにリストに登録され、実行中の Command インスタンスの次の位置に追加します。 追加された Command インスタンスは、イベントが送出される直前に自動的に削除されます。
CastSprite
 Inherited
DisplayObjectContainer に追加されている全ての子 DisplayObject インスタンスを削除します。 Removes the whole child DisplayObject instance added to the DisplayObjectContainer.
ExSprite
 Inherited
removeAllListeners(completely:Boolean = false):void
addEventListener() メソッド経由で登録された全てのイベントリスナー登録を削除します。 完全に登録を削除しなかった場合には、削除されたイベントリスナーを restoreRemovedListeners() メソッドで復帰させることができます。 Remove the whole event listener registered via addEventListener() method.
ExSprite
 Inherited
removeChild(child:DisplayObject):DisplayObject
[override] DisplayObjectContainer インスタンスの子リストから指定の DisplayObject インスタンスを削除します。 Removes the specified child DisplayObject instance from the child list of the DisplayObjectContainer instance.
ExSprite
 Inherited
removeChildAt(index:int):DisplayObject
[override] DisplayObjectContainer の子リストの指定されたインデックス位置から子 DisplayObject インスタンスを削除します。 Removes a child DisplayObject from the specified index position in the child list of the DisplayObjectContainer.
ExSprite
 Inherited
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
[override] EventIntegrator インスタンスからリスナーを削除します。 このメソッドを使用して削除されたリスナーは、restoreRemovedListeners() メソッドで再登録させることができます。 Remove the listener from EventIntegrator instance.
ExSprite
 Inherited
removeEventListener() メソッド、または removeAllListeners() メソッド経由で削除された全てイベントリスナーを再登録します。 Re-register the whole event listener removed via removeEventListener() or removeAllListeners() method.
ExSprite
 Inherited
setChildIndex(child:DisplayObject, index:int):void
[override] 表示オブジェクトコンテナの既存の子の位置を変更します。 Changes the position of an existing child in the display object container.
ExSprite
 Inherited
setChildIndexAbove(child:DisplayObject, index:int):void
表示オブジェクトコンテナの既存の子の位置を変更します。 Changes the position of an existing child in the display object container.
ExSprite
 Inherited
setProperties(props:Object):DisplayObject
インスタンスに対して、複数のプロパティを一括設定します。 Setup the several instance properties.
ExSprite
 Inherited
startDrag(lockCenter:Boolean = false, bounds:Rectangle = null):void
[override] 指定されたスプライトをユーザーがドラッグできるようにします。 Allow the user to drag the specified sprite.
ExSprite
 Inherited
stopDrag():void
[override] startDrag() メソッドを終了します。 Ends the startDrag() method.
ExSprite
 Inherited
swapChildren(child1:DisplayObject, child2:DisplayObject):void
[override] 指定された 2 つの子オブジェクトの z 順序(重ね順)を入れ替えます。 Swaps the z-order (front-to-back order) of the two specified child objects.
ExSprite
 Inherited
swapChildrenAt(index1:int, index2:int):void
[override] 子リスト内の指定されたインデックス位置に該当する 2 つの子オブジェクトの z 順序(重ね順)を入れ替えます。 Swaps the z-order (front-to-back order) of the child objects at the two specified index positions in the child list.
ExSprite
 Inherited
toBitmapData(transparent:Boolean = true, fillColor:uint = 0xFFFFFFFF):BitmapData
指定されたオブジェクトの BitmapData 表現を返します。 Returns the BitmapData representation of the specified object.
ExSprite
 Inherited
toString():String
[override] 指定されたオブジェクトのストリング表現を返します。 Returns the string representation of the specified object.
ExSprite
 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.
ExSprite
Protected Methods
 MethodDefined By
  
サブクラスで onCastAdded イベントハンドラメソッドの処理を override で実装したい場合に上書きします。 onCastAdded プロパティに、別のメソッドを設定された場合は無効化されます。
CastSprite
  
サブクラスで onCastRemoved イベントハンドラメソッドの処理を override で実装したい場合に上書きします。 onCastRemoved プロパティに、別のメソッドを設定された場合は無効化されます。
CastSprite
Events
 Event Summary Defined By
  ICastObject オブジェクトが AddChild コマンド、または AddChildAt コマンド経由でディスプレイリストに追加された場合に送出されます。 このイベント処理の実行中には、addCommand() メソッド、及び insertCommand() メソッドによるコマンドの同期処理が行えます。CastSprite
  ICastObject オブジェクトが RemoveChild コマンド、または RemoveAllChild コマンド経由でディスプレイリストから削除された場合に送出されます。 このイベント処理の実行中には、addCommand() メソッド、及び insertCommand() メソッドによるコマンドの同期処理が行えます。CastSprite
Property Detail
contextMenuproperty
contextMenu:ContextMenu[override]


Implementation
    public function get contextMenu():ContextMenu
    public function set contextMenu(value:ContextMenu):void
eventHandlerEnabledproperty 
eventHandlerEnabled:Boolean

オブジェクトのイベントハンドラメソッドを有効化するかどうかを指定します。


Implementation
    public function get eventHandlerEnabled():Boolean
    public function set eventHandlerEnabled(value:Boolean):void
executorproperty 
executor:CommandExecutor  [read-only]

コマンドを実行する CommandExecutor インスタンスを取得します。


Implementation
    public function get executor():CommandExecutor
onCastAddedproperty 
onCastAdded:Function

キャストオブジェクトが CastEvent.CAST_ADDED イベントを受け取った場合に呼び出されるイベントハンドラメソッドを取得または設定します。 このイベント処理の実行中には、addCommand() メソッド、及び insertCommand() メソッドによるコマンドの同期処理が行えます。


Implementation
    public function get onCastAdded():Function
    public function set onCastAdded(value:Function):void
onCastRemovedproperty 
onCastRemoved:Function

キャストオブジェクトが CastEvent.CAST_REMOVED イベントを受け取った場合に呼び出されるイベントハンドラメソッドを取得または設定します。 このイベント処理の実行中には、addCommand() メソッド、及び insertCommand() メソッドによるコマンドの同期処理が行えます。


Implementation
    public function get onCastRemoved():Function
    public function set onCastRemoved(value:Function):void
parallelModeproperty 
parallelMode:Boolean

CommandExecutor の実行方法を並列処理にするかどうかを取得または設定します。


Implementation
    public function get parallelMode():Boolean
    public function set parallelMode(value:Boolean):void
toolTipproperty 
toolTip:ToolTip  [read-only]

このオブジェクトに関連付けられている ToolTip インスタンスを取得します。


Implementation
    public function get toolTip():ToolTip
uiContextMenuproperty 
uiContextMenu:CastObjectContextMenu  [read-only]

このオブジェクトに関連付けられている CastObjectContextMenu インスタンスを取得します。


Implementation
    public function get uiContextMenu():CastObjectContextMenu
Constructor Detail
CastSprite()Constructor
public function CastSprite(initObject:Object = null)

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

Parameters
initObject:Object (default = null)設定したいプロパティを含んだオブジェクトです。
Method Detail
_onCastAdded()method
protected function _onCastAdded():void

サブクラスで onCastAdded イベントハンドラメソッドの処理を override で実装したい場合に上書きします。 onCastAdded プロパティに、別のメソッドを設定された場合は無効化されます。

_onCastRemoved()method 
protected function _onCastRemoved():void

サブクラスで onCastRemoved イベントハンドラメソッドの処理を override で実装したい場合に上書きします。 onCastRemoved プロパティに、別のメソッドを設定された場合は無効化されます。

addCommand()method 
public function addCommand(... commands):void

特定のイベントが送出された際に、自動実行させたい Command インスタンスをリストの最後尾に追加します。 追加された Command インスタンスは、イベントが送出される直前に自動的に削除されます。

Parameters

... commands登録したいコマンドを含む配列です。

clearCommand()method 
public function clearCommand(completely:Boolean = false):void

登録されている Command インスタンスを削除します。

Parameters

completely:Boolean (default = false)true が設定されている場合は登録されている全てのコマンド登録を解除し、false の場合には現在処理中のコマンド以降の登録を解除します。

insertCommand()method 
public function insertCommand(... commands):void

特定のイベントが送出された際に、自動実行させたい Command インスタンスをすでにリストに登録され、実行中の Command インスタンスの次の位置に追加します。 追加された Command インスタンスは、イベントが送出される直前に自動的に削除されます。

Parameters

... commands登録したいコマンドを含む配列です。

Event Detail
castAdded Event
Event Object Type: jp.progression.events.CastEvent
CastEvent.type property = jp.progression.events.CastEvent.CAST_ADDED

ICastObject オブジェクトが AddChild コマンド、または AddChildAt コマンド経由でディスプレイリストに追加された場合に送出されます。 このイベント処理の実行中には、addCommand() メソッド、及び insertCommand() メソッドによるコマンドの同期処理が行えます。

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

ICastObject オブジェクトが RemoveChild コマンド、または RemoveAllChild コマンド経由でディスプレイリストから削除された場合に送出されます。 このイベント処理の実行中には、addCommand() メソッド、及び insertCommand() メソッドによるコマンドの同期処理が行えます。

castRemoved イベントオブジェクトの type プロパティ値を定義します。 The CastEvent.CAST_REMOVED constant defines the value of the type property of an castRemoved event object.
Examples
     // CastSprite を作成する
     var cast:CastSprite = new CastSprite();
     cast.graphics.beginFill( 0xFF000000 );
     cast.graphics.drawRect( 0, 0, 100, 100 );
     cast.graphics.endFill();
     cast.onCastAdded = function():void {
         trace( "CastSprite で CastEvent.CAST_ADDED イベントが送出されました。" );
     };
     cast.onCastRemoved = function():void {
         trace( "CastSprite で CastEvent.CAST_REMOVED イベントが送出されました。" );
     };
     
     // Progression インスタンスを作成する
     var prog:Progression = new Progression( "index", stage );
     
     // ルートシーンのイベントハンドラメソッドを設定します。
     prog.root.onLoad = function():void {
         // コマンドを実行する
         this.addCommand(
             // CastSprite を画面に表示する
             new AddChild( prog.container, cast )
         );
     };
     prog.root.onInit = function():void {
         // コマンドを実行する
         this.addCommand(
             // CastSprite を画面から削除する
             new RemoveChild( prog.container, cast )
         );
     };
     
     // ルートシーンに移動します。
     prog.goto( new SceneId( "/index" ) );