Class DisplayObjectContainer
Extends
DisplayObject.
The DisplayObjectContainer class is an abstract base class for all objects that can contain child objects. It cannot be instantiated directly.
Each DisplayObjectContainer object has its own child list for organizing the z-order of the objects. The z-order is the front-to-back order that determines which object is drawn in front, which is behind, and so on.
Constructor Attributes | Constructor Name and Description |
---|---|
Constructor.
|
Field Attributes | Field Name and Description |
---|---|
An array list of all children in the display object container.
|
|
Determines whether or not the children of the object are mouse enabled.
|
- Fields borrowed from class DisplayObject:
- alpha, height, id, mouseEnabled, name, parent, regX, regY, rotation, scaleX, scaleY, stage, useHandCursor, visible, width, x, y
Method Attributes | Method Name and Description |
---|---|
addChild(child)
Adds a child DisplayObject instance to this DisplayObjectContainer instance.
|
|
addChildAt(child, index)
Adds a child DisplayObject instance to the specific index of this DisplayObjectContainer instance.
|
|
contains(child)
Determines whether the specified display object is a child of the DisplayObjectContainer instance or the instance itself.
|
|
getChildAt(index)
Returns the child display object instance that exists at the specified index.
|
|
getChildByName(name)
Returns the child display object that exists with the specified name.
|
|
getChildIndex(child)
Returns the index position of a child DisplayObject instance.
|
|
Returns the number of children of this object.
|
|
getObjectUnderPoint(x, y, usePixelCollision, tolerance, returnAll)
Returns an array of objects that lie under the specified point and are children(or grandchildren, and so on) of this DisplayObjectContainer instance.
|
|
Removes all children of the DisplayObjectContainer.
|
|
removeChild(child)
Removes the specified child DisplayObject instance from the child list of the DisplayObjectContainer instance.
|
|
removeChildAt(index)
Removes a child DisplayObject from the specified index position in the child list of the DisplayObjectContainer.
|
|
removeChildByName(name)
Removes a child DisplayObject with the specified name in the child list of the DisplayObjectContainer.
|
|
setChildIndex(child, index)
Changes the position of an existing child in the display object container.
|
- Methods borrowed from class DisplayObject:
- getCurrentHeight, getCurrentWidth, getRect, getStage, globalToLocal, hitTestObject, hitTestPoint, localToGlobal, localToTarget, onMouseEvent, render, toString
- Methods borrowed from class EventDispatcher:
- addEventListener, dispatchEvent, hasEventListener, removeAllEventListeners, removeEventListener, removeEventListenerByType
Field Detail
children
An array list of all children in the display object container.
mouseChildren
Determines whether or not the children of the object are mouse enabled.
Method Detail
addChild(child)
Adds a child DisplayObject instance to this DisplayObjectContainer instance.
- Parameters:
- child
addChildAt(child, index)
Adds a child DisplayObject instance to the specific index of this DisplayObjectContainer instance.
- Parameters:
- child
- index
contains(child)
Determines whether the specified display object is a child of the DisplayObjectContainer instance or the instance itself.
- Parameters:
- child
getChildAt(index)
Returns the child display object instance that exists at the specified index.
- Parameters:
- index
getChildByName(name)
Returns the child display object that exists with the specified name.
- Parameters:
- name
getChildIndex(child)
Returns the index position of a child DisplayObject instance.
- Parameters:
- child
getNumChildren()
Returns the number of children of this object.
getObjectUnderPoint(x, y, usePixelCollision, tolerance, returnAll)
Returns an array of objects that lie under the specified point and are children(or grandchildren, and so on) of this DisplayObjectContainer instance.
- Parameters:
- x
- y
- usePixelCollision
- tolerance
- returnAll
removeAllChildren()
Removes all children of the DisplayObjectContainer.
removeChild(child)
Removes the specified child DisplayObject instance from the child list of the DisplayObjectContainer instance.
- Parameters:
- child
removeChildAt(index)
Removes a child DisplayObject from the specified index position in the child list of the DisplayObjectContainer.
- Parameters:
- index
removeChildByName(name)
Removes a child DisplayObject with the specified name in the child list of the DisplayObjectContainer.
- Parameters:
- name
setChildIndex(child, index)
Changes the position of an existing child in the display object container.
- Parameters:
- child
- index