Packageorg.aswing
Classpublic class AWSprite
InheritanceAWSprite Inheritance flash.display.Sprite
SubclassesComponent

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
 



Public Properties
 PropertyDefined by
  cacheAsBitmap : Boolean
[write-only]
AWSprite
  filters : Array
[write-only]
AWSprite
  mask : DisplayObject
AWSprite
  numChildren : int
[read-only]
AWSprite
Protected Properties
 PropertyDefined by
  d_numChildren : int
[read-only]
AWSprite
Public Methods
 MethodDefined by
  
AWSprite(clipMasked:Boolean = false)
AWSprite
  
addChild(dis:DisplayObject):DisplayObject
Adds a child DisplayObject instance to this DisplayObjectContainer instance.
AWSprite
  
addChildAt(child:DisplayObject, index:int):DisplayObject
AWSprite
  
bringToBottom(child:DisplayObject):void
Brings a child to bottom.
AWSprite
  
bringToTop(child:DisplayObject):void
Brings a child to top.
AWSprite
  
containsChild(child:DisplayObject):Boolean
Returns whether child is directly child of this sprite, true only if getChildIndex(child) >= 0.
AWSprite
  
getChildAt(index:int):DisplayObject
AWSprite
  
getChildByName(name:String):DisplayObject
AWSprite
  
getChildIndex(child:DisplayObject):int
AWSprite
  
Returns the current top index for a new child(none forground child).
AWSprite
  
Returns the current bottom index for none background child.
AWSprite
  
hitTestObject(obj:DisplayObject):Boolean
AWSprite
  
hitTestPoint(x:Number, y:Number, shapeFlag:Boolean = false):Boolean
AWSprite
  
isClipMasked():Boolean
Returns whether the component clip should be masked by its bounds.
AWSprite
  
removeChild(child:DisplayObject):DisplayObject
AWSprite
  
removeChildAt(index:int):DisplayObject
AWSprite
  
setChildIndex(child:DisplayObject, index:int):void
AWSprite
  
setClipMasked(m:Boolean):void
Sets whether the component clip should be masked by its bounds.
AWSprite
  
swapChildren(child1:DisplayObject, child2:DisplayObject):void
AWSprite
  
swapChildrenAt(index1:int, index2:int):void
AWSprite
  
toString():String
AWSprite
Protected Methods
 MethodDefined by
  
d_addChild(child:DisplayObject):DisplayObject
AWSprite
  
d_addChildAt(child:DisplayObject, index:int):DisplayObject
AWSprite
  
d_getChildAt(index:int):DisplayObject
AWSprite
  
d_getChildByName(name:String):DisplayObject
AWSprite
  
d_getChildIndex(child:DisplayObject):int
AWSprite
  
d_removeChild(child:DisplayObject):DisplayObject
AWSprite
  
d_removeChildAt(index:int):DisplayObject
AWSprite
  
d_setChildIndex(child:DisplayObject, index:int):void
AWSprite
  
d_swapChildren(child1:DisplayObject, child2:DisplayObject):void
AWSprite
  
d_swapChildrenAt(index1:int, index2:int):void
AWSprite
  
getBackgroundChild():DisplayObject
Returns the background child.
AWSprite
  
getForegroundChild():DisplayObject
Returns the foreground child.
AWSprite
  
isChild(child:DisplayObject):Boolean
Returns whether or not the child is this sprite's direct child.
AWSprite
  
setBackgroundChild(child:DisplayObject = null):void
Sets the child to be the component background, it will be add to the bottom of all other children.
AWSprite
  
AWSprite
  
setForegroundChild(child:DisplayObject = null):void
Sets the child to be the component foreground, it will be add to the top of all other children.
AWSprite
Events
 EventSummaryDefined by
   Dispatched when the mouse released or released out side.AWSprite
   Dispatched only when the mouse released out side.AWSprite
Property detail
cacheAsBitmapproperty
cacheAsBitmap:Boolean  [write-only]Implementation
    public function set cacheAsBitmap(value:Boolean):void
d_numChildrenproperty 
d_numChildren:int  [read-only]Implementation
    protected function get d_numChildren():int
filtersproperty 
filters:Array  [write-only]Implementation
    public function set filters(value:Array):void
maskproperty 
mask:DisplayObject  [read-write]Implementation
    public function get mask():DisplayObject
    public function set mask(value:DisplayObject):void
numChildrenproperty 
numChildren:int  [read-only]Implementation
    public function get numChildren():int
Constructor detail
AWSprite()constructor
public function AWSprite(clipMasked:Boolean = false)Parameters
clipMasked:Boolean (default = false)
Method detail
addChild()method
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
DisplayObject

See also

addChildAt()method 
public override function addChildAt(child:DisplayObject, index:int):DisplayObjectParameters
child:DisplayObject
 
index:int

Returns
DisplayObject
bringToBottom()method 
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.
bringToTop()method 
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.
containsChild()method 
public function containsChild(child:DisplayObject):Boolean

Returns whether child is directly child of this sprite, true only if getChildIndex(child) >= 0.

Parameters
child:DisplayObject

Returns
Boolean — true only if getChildIndex(child) >= 0.
d_addChild()method 
protected function d_addChild(child:DisplayObject):DisplayObjectParameters
child:DisplayObject

Returns
DisplayObject
d_addChildAt()method 
protected function d_addChildAt(child:DisplayObject, index:int):DisplayObjectParameters
child:DisplayObject
 
index:int

Returns
DisplayObject
d_getChildAt()method 
protected function d_getChildAt(index:int):DisplayObjectParameters
index:int

Returns
DisplayObject
d_getChildByName()method 
protected function d_getChildByName(name:String):DisplayObjectParameters
name:String

Returns
DisplayObject
d_getChildIndex()method 
protected function d_getChildIndex(child:DisplayObject):intParameters
child:DisplayObject

Returns
int
d_removeChild()method 
protected function d_removeChild(child:DisplayObject):DisplayObjectParameters
child:DisplayObject

Returns
DisplayObject
d_removeChildAt()method 
protected function d_removeChildAt(index:int):DisplayObjectParameters
index:int

Returns
DisplayObject
d_setChildIndex()method 
protected function d_setChildIndex(child:DisplayObject, index:int):voidParameters
child:DisplayObject
 
index:int
d_swapChildren()method 
protected function d_swapChildren(child1:DisplayObject, child2:DisplayObject):voidParameters
child1:DisplayObject
 
child2:DisplayObject
d_swapChildrenAt()method 
protected function d_swapChildrenAt(index1:int, index2:int):voidParameters
index1:int
 
index2:int
getBackgroundChild()method 
protected function getBackgroundChild():DisplayObject

Returns the background child.

Returns
DisplayObject — the background child.

See also

getChildAt()method 
public override function getChildAt(index:int):DisplayObjectParameters
index:int

Returns
DisplayObject
getChildByName()method 
public override function getChildByName(name:String):DisplayObjectParameters
name:String

Returns
DisplayObject
getChildIndex()method 
public override function getChildIndex(child:DisplayObject):intParameters
child:DisplayObject

Returns
int
getForegroundChild()method 
protected function getForegroundChild():DisplayObject

Returns the foreground child.

Returns
DisplayObject — the foreground child.

See also

getHighestIndexUnderForeground()method 
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.
getLowestIndexAboveBackground()method 
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.
hitTestObject()method 
public override function hitTestObject(obj:DisplayObject):BooleanParameters
obj:DisplayObject

Returns
Boolean
hitTestPoint()method 
public override function hitTestPoint(x:Number, y:Number, shapeFlag:Boolean = false):BooleanParameters
x:Number
 
y:Number
 
shapeFlag:Boolean (default = false)

Returns
Boolean
isChild()method 
protected function isChild(child:DisplayObject):Boolean

Returns whether or not the child is this sprite's direct child.

Parameters
child:DisplayObject

Returns
Boolean
isClipMasked()method 
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

removeChild()method 
public override function removeChild(child:DisplayObject):DisplayObjectParameters
child:DisplayObject

Returns
DisplayObject
removeChildAt()method 
public override function removeChildAt(index:int):DisplayObjectParameters
index:int

Returns
DisplayObject
setBackgroundChild()method 
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.
setChildIndex()method 
public override function setChildIndex(child:DisplayObject, index:int):voidParameters
child:DisplayObject
 
index:int
setClipMasked()method 
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

setClipMaskRect()method 
protected function setClipMaskRect(b:IntRectangle):voidParameters
b:IntRectangle
setForegroundChild()method 
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.
swapChildren()method 
public override function swapChildren(child1:DisplayObject, child2:DisplayObject):voidParameters
child1:DisplayObject
 
child2:DisplayObject
swapChildrenAt()method 
public override function swapChildrenAt(index1:int, index2:int):voidParameters
index1:int
 
index2:int
toString()method 
public override function toString():String

Returns
String
Event detail
releaseevent 
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:

PropertyValue
bubblesfalse
cancelablefalse
getPressTarget()The object that is the target which is pressed and then released
currentTargetThe 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.
targetThe 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.
releaseOutSideevent  
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:

PropertyValue
bubblesfalse
cancelablefalse
getPressTarget()The object that is the target which is pressed and then released out side
isReleasedOutSide()true if this is released out side
currentTargetThe 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.
targetThe 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.