AsWing component based Sprite.
The AsWing Component Assets structure:(Assets means flash player display objects)
| -- foreground decorator asset
|
| [other assets, there is no depth restrict between them, see below ]
AWSprite -- | -- [icon, border, ui creation, children component assets ...]
| [they are above background decorator and below foreground decorator]
|
| -- background decorator asset
cacheAsBitmap:Boolean [write-only]Implementation
public function set cacheAsBitmap(value:Boolean):void
d_numChildren:int [read-only]Implementation
protected function get d_numChildren():int
filters:Array [write-only]Implementation
public function set filters(value:Array):void
mask:DisplayObject [read-write]Implementation
public function get mask():DisplayObject
public function set mask(value:DisplayObject):void
numChildren:int [read-only]Implementation
public function get numChildren():int
public function AWSprite(clipMasked:Boolean = false)Parameters
| clipMasked:Boolean (default = false) |
public override function addChild(dis:DisplayObject):DisplayObject
Adds a child DisplayObject instance to this DisplayObjectContainer instance.
The child is added to the front (top) of all other children except foreground decorator child(It is topest)
in this DisplayObjectContainer instance.
(To avoid this restrict and add a child to a specific index position, use the addChildAt() method.)
(Note: Generally if you don't want to break the component asset depth management, use
getHighestIndexUnderForeground() and getLowestIndexAboveBackground() to get the
right depth you can use. You can also refer to getChildIndex() to
insert child after or before an existing child)
Parameters
| dis:DisplayObject — The DisplayObject instance to add as a child of this DisplayObjectContainer instance.
|
Returns
See also
public override function addChildAt(child:DisplayObject, index:int):DisplayObjectParameters
| child:DisplayObject |
| |
| index:int |
Returns
public function bringToBottom(child:DisplayObject):void
Brings a child to bottom.
This method will keep background child on bottom, if you bring a other object
to bottom, this method will only bring it at bottom of other objects
(mean at bottom of others but on top of the background child).
Parameters
| child:DisplayObject — the child to be bringed to bottom.
|
public function bringToTop(child:DisplayObject):void
Brings a child to top.
This method will keep foreground child on top, if you bring a other object
to top, this method will only bring it on top of other objects
(mean on top of others but bellow the foreground child).
Parameters
| child:DisplayObject — the child to be bringed to top.
|
public function containsChild(child:DisplayObject):Boolean
Returns whether child is directly child of this sprite, true only if getChildIndex(child) >= 0.
Parameters
Returns
| Boolean — true only if getChildIndex(child) >= 0.
|
protected function d_addChild(child:DisplayObject):DisplayObjectParameters
Returns
protected function d_addChildAt(child:DisplayObject, index:int):DisplayObjectParameters
| child:DisplayObject |
| |
| index:int |
Returns
protected function d_getChildAt(index:int):DisplayObjectParameters
Returns
protected function d_getChildByName(name:String):DisplayObjectParameters
Returns
protected function d_getChildIndex(child:DisplayObject):intParameters
Returns
protected function d_removeChild(child:DisplayObject):DisplayObjectParameters
Returns
protected function d_removeChildAt(index:int):DisplayObjectParameters
Returns
protected function d_setChildIndex(child:DisplayObject, index:int):voidParameters
| child:DisplayObject |
| |
| index:int |
protected function d_swapChildren(child1:DisplayObject, child2:DisplayObject):voidParameters
| child1:DisplayObject |
| |
| child2:DisplayObject |
protected function d_swapChildrenAt(index1:int, index2:int):voidParameters
protected function getBackgroundChild():DisplayObject
Returns the background child.
Returns
| DisplayObject — the background child.
|
See also
public override function getChildAt(index:int):DisplayObjectParameters
Returns
public override function getChildByName(name:String):DisplayObjectParameters
Returns
public override function getChildIndex(child:DisplayObject):intParameters
Returns
protected function getForegroundChild():DisplayObject
Returns the foreground child.
Returns
| DisplayObject — the foreground child.
|
See also
public function getHighestIndexUnderForeground():int
Returns the current top index for a new child(none forground child).
Returns
| int — the current top index for a new child that is not a foreground child.
|
public function getLowestIndexAboveBackground():int
Returns the current bottom index for none background child.
Returns
| int — the current bottom index for child that is not a background child.
|
public override function hitTestObject(obj:DisplayObject):BooleanParameters
Returns
public override function hitTestPoint(x:Number, y:Number, shapeFlag:Boolean = false):BooleanParameters
| x:Number |
| |
| y:Number |
| |
| shapeFlag:Boolean (default = false) |
Returns
protected function isChild(child:DisplayObject):Boolean
Returns whether or not the child is this sprite's direct child.
Parameters
Returns
public function isClipMasked():Boolean
Returns whether the component clip should be masked by its bounds. By default it is true.
AsWing A3 use scrollRect property to do the clip mask.
Returns
| Boolean — whether the component clip should be masked.
|
See also
public override function removeChild(child:DisplayObject):DisplayObjectParameters
Returns
public override function removeChildAt(index:int):DisplayObjectParameters
Returns
protected function setBackgroundChild(child:DisplayObject = null):void
Sets the child to be the component background, it will be add to the bottom of all other children.
(old backgournd child will be removed). pass no paramter (null) to remove the background child.
Parameters
| child:DisplayObject (default = null) — the background child to be added.
|
public override function setChildIndex(child:DisplayObject, index:int):voidParameters
| child:DisplayObject |
| |
| index:int |
public function setClipMasked(m:Boolean):void
Sets whether the component clip should be masked by its bounds. By default it is true.
AsWing A3 use scrollRect property to do the clip mask.
Parameters
| m:Boolean — whether the component clip should be masked.
|
See also
protected function setClipMaskRect(b:IntRectangle):voidParameters
protected function setForegroundChild(child:DisplayObject = null):void
Sets the child to be the component foreground, it will be add to the top of all other children.
(old foregournd child will be removed), pass no paramter (null) to remove the foreground child.
Parameters
| child:DisplayObject (default = null) — the foreground child to be added.
|
public override function swapChildren(child1:DisplayObject, child2:DisplayObject):voidParameters
| child1:DisplayObject |
| |
| child2:DisplayObject |
public override function swapChildrenAt(index1:int, index2:int):voidParameters
public override function toString():String
Returns
Event object type: org.aswing.event.ReleaseEvent
ReleaseEvent.type property = org.aswing.event.ReleaseEvent.RELEASE
Dispatched when the mouse released or released out side.
If you need a event like AS2 onRelease you can
use Event.CLICK
The ReleaseEvent.RELEASE constant defines the value of the
type property of the event object for a release event.
The properties of the event object have the following values:
| Property | Value |
bubbles | false |
cancelable | false |
getPressTarget() | The object that
is the target which is pressed and then released |
currentTarget | The Object that defines the
event listener that handles the event. For example, if you use
comp.addEventListener() to register an event listener,
comp is the value of the currentTarget. |
target | The Object that dispatched the event;
it is not always the Object listening for the event.
Use the currentTarget property to always access the
Object listening for the event. |
Event object type: org.aswing.event.ReleaseEvent
ReleaseEvent.type property = org.aswing.event.ReleaseEvent.RELEASE_OUT_SIDE
Dispatched only when the mouse released out side.
The ReleaseEvent.RELEASE_OUT_SIDE constant defines the value of the
type property of the event object for a releaseOutSide event.
The properties of the event object have the following values:
| Property | Value |
bubbles | false |
cancelable | false |
getPressTarget() | The object that
is the target which is pressed and then released out side |
isReleasedOutSide() | true if this is released out side |
currentTarget | The Object that defines the
event listener that handles the event. For example, if you use
comp.addEventListener() to register an event listener,
comp is the value of the currentTarget. |
target | The Object that dispatched the event;
it is not always the Object listening for the event.
Use the currentTarget property to always access the
Object listening for the event. |