Paquete | mx.core |
Interfaz | public interface IChildList |
Implementadores | Container, SystemManager, UIComponent |
Versión del lenguaje: | ActionScript 3.0 |
Versión de producto: | Flex 3 |
Versiones de motor de ejecución: | Flash Player 9, AIR 1.1 |
As an example, consider the Container class.
It overrides DisplayObjectContainer APIs such as the
numChildren
and getChildAt()
methods
to access only "content" children, which are the controls
and other containers that you put inside it.
But a Container can also have additional children
created automatically by the framework, such as a background or border
skin and scrollbars.
So Container exposes a property called rawChildren
of type IChildList, which lets you access all its children,
not just the content children.
As another example, the SystemManager class is a DisplayObjectContainer
whose children are partitioned into various layers:
normal children like the Application are on the bottom,
popups above them, tooltips above them, and cursors on the top.
The SystemManager class has properties named popUpChildren
,
toolTipChildren
, and cursorChildren
which let you access these layers, and the type of each of these
properties is IChildList.
Therefore, you can count the number of popups using the
systemManager.popUpChildren.numChildren
property,
insert another DisplayObject into the tooltip layer using the
systemManager.toolTipChildren.addChild()
method, and so on.
Elementos de API relacionados
mx.managers.SystemManager.rawChildren
mx.managers.SystemManager.popUpChildren
mx.managers.SystemManager.toolTipChildren
mx.managers.SystemManager.cursorChildren
Propiedad | Definido por | ||
---|---|---|---|
numChildren : int [solo lectura]
The number of children in this child list. | IChildList |
Método | Definido por | ||
---|---|---|---|
Adds a child DisplayObject after the end of this child list. | IChildList | ||
Adds a child DisplayObject to this child list at the index specified. | IChildList | ||
Determines if a DisplayObject is in this child list,
or is a descendant of an child in this child list. | IChildList | ||
Gets the child DisplayObject at the specified index in this child list. | IChildList | ||
Gets the child DisplayObject with the specified name
in this child list. | IChildList | ||
Gets the index of a specific child in this child list. | IChildList | ||
Returns an array of DisplayObjects that lie under the specified point
and are in this child list. | IChildList | ||
Removes the specified child DisplayObject from this child list. | IChildList | ||
Removes the child DisplayObject at the specified index
from this child list. | IChildList | ||
Changes the index of a particular child in this child list. | IChildList |
numChildren | propiedad |
addChild | () | método |
public function addChild(child:DisplayObject):DisplayObject
Versión del lenguaje: | ActionScript 3.0 |
Versión de producto: | Flex 3 |
Versiones de motor de ejecución: | Flash Player 9, AIR 1.1 |
Adds a child DisplayObject after the end of this child list.
Calling childList.addChild(child)
is the same as calling
childList.addChild(child, childList.numChildren)
After it has been added, its index of the new child
will be (child.numChildren - 1)
Parámetros
child:DisplayObject — The DisplayObject to add as a child.
|
DisplayObject — The child that was added; this is the same
as the argument passed in.
|
addChildAt | () | método |
public function addChildAt(child:DisplayObject, index:int):DisplayObject
Versión del lenguaje: | ActionScript 3.0 |
Versión de producto: | Flex 3 |
Versiones de motor de ejecución: | Flash Player 9, AIR 1.1 |
Adds a child DisplayObject to this child list at the index specified.
An index of 0 represents the beginning of the DisplayList,
and an index of numChildren
represents the end.
Adding a child anywhere except at the end of a child list will increment the indexes of children that were previously at that index or at higher indices.
Parámetros
child:DisplayObject — The DisplayObject to add as a child.
| |
index:int — The index to add the child at.
|
DisplayObject — The child that was added; this is the same
as the child argument passed in.
|
contains | () | método |
public function contains(child:DisplayObject):Boolean
Versión del lenguaje: | ActionScript 3.0 |
Versión de producto: | Flex 3 |
Versiones de motor de ejecución: | Flash Player 9, AIR 1.1 |
Determines if a DisplayObject is in this child list, or is a descendant of an child in this child list.
Parámetros
child:DisplayObject — The DisplayObject to test.
|
Boolean — true if the DisplayObject is in this child list
or is a descendant of an child in this child list;
false otherwise.
|
getChildAt | () | método |
public function getChildAt(index:int):DisplayObject
Versión del lenguaje: | ActionScript 3.0 |
Versión de producto: | Flex 3 |
Versiones de motor de ejecución: | Flash Player 9, AIR 1.1 |
Gets the child DisplayObject at the specified index in this child list.
Parámetros
index:int — An integer from 0 to (numChildren - 1)
that specifies the index of a child in this child list.
|
DisplayObject — The child at the specified index.
|
getChildByName | () | método |
public function getChildByName(name:String):DisplayObject
Versión del lenguaje: | ActionScript 3.0 |
Versión de producto: | Flex 3 |
Versiones de motor de ejecución: | Flash Player 9, AIR 1.1 |
Gets the child DisplayObject with the specified name in this child list.
Parámetros
name:String — The name of the child to return.
|
DisplayObject — The child with the specified name.
|
getChildIndex | () | método |
public function getChildIndex(child:DisplayObject):int
Versión del lenguaje: | ActionScript 3.0 |
Versión de producto: | Flex 3 |
Versiones de motor de ejecución: | Flash Player 9, AIR 1.1 |
Gets the index of a specific child in this child list.
The first child in the child list has an index of 0,
the second child has an index of 1, and the last child
has an index of (numChildren - 1)
.
If getChildIndex(myChild)
returns 5,
then myView.getChildAt(5)
returns
myChild
.
If you add a child by calling the addChild()
method,
the new child's index is equal to the largest index among the
existing children plus one.
You can insert a child at a specified index by using the
addChildAt()
method
In that case the children previously at that index and higher
indices have their index increased by 1 so that all
children are indexed from 0 to (numChildren - 1)
.
If you remove a child by calling the removeChild()
or removeChildAt()
method, then the children
at higher indices have their index decreased by 1 so that
all children are indexed from 0 to (numChildren - 1)
.
If you change a child's index by calling the
setChildIndex()
method, then the children between
the old index and the new index, inclusive, have their indexes
adjusted so that all children are indexed from
0 to (numChildren - 1)
.
Parámetros
child:DisplayObject — The child whose index to get.
|
int — The index of the child, which is an integer
between 0 and (numChildren - 1) .
|
getObjectsUnderPoint | () | método |
public function getObjectsUnderPoint(point:Point):Array
Versión del lenguaje: | ActionScript 3.0 |
Versión de producto: | Flex 3 |
Versiones de motor de ejecución: | Flash Player 9, AIR 1.1 |
Returns an array of DisplayObjects that lie under the specified point and are in this child list.
Parámetros
point:Point — The point under which to look.
|
Array — An array of object that lie under the specified point
that are children of this Container.
|
removeChild | () | método |
public function removeChild(child:DisplayObject):DisplayObject
Versión del lenguaje: | ActionScript 3.0 |
Versión de producto: | Flex 3 |
Versiones de motor de ejecución: | Flash Player 9, AIR 1.1 |
Removes the specified child DisplayObject from this child list.
Removing a child anywhere except from the end of a child list will decrement the indexes of children that were at higher indices.
The removed child will have its parent set to null and will be garbage collected if no other references to it exist.
Parámetros
child:DisplayObject — The DisplayObject to remove.
|
DisplayObject — The child that was removed; this is the same
as the argument passed in.
|
removeChildAt | () | método |
public function removeChildAt(index:int):DisplayObject
Versión del lenguaje: | ActionScript 3.0 |
Versión de producto: | Flex 3 |
Versiones de motor de ejecución: | Flash Player 9, AIR 1.1 |
Removes the child DisplayObject at the specified index from this child list.
Removing a child anywhere except from the end of a child list will decrement the indexes of children that were at higher indices.
The removed child will have its parent set to null and will be garbage collected if no other references to it exist.
Parámetros
index:int — The child index of the DisplayObject to remove.
|
DisplayObject — The child that was removed.
|
setChildIndex | () | método |
public function setChildIndex(child:DisplayObject, newIndex:int):void
Versión del lenguaje: | ActionScript 3.0 |
Versión de producto: | Flex 3 |
Versiones de motor de ejecución: | Flash Player 9, AIR 1.1 |
Changes the index of a particular child in this child list.
See the getChildIndex()
method for a
description of the child's index.
Parámetros
child:DisplayObject — The child whose index to set.
| |
newIndex:int — The new index for the specified child.
This must be an integer between zero and (numChildren - 1) .
|
Tue Jun 12 2018, 02:12 PM Z