패키지 | mx.core |
인터페이스 | public interface IChildList |
구현자 | Container, SystemManager, UIComponent |
언어 버전: | ActionScript 3.0 |
제품 버전: | Flex 3 |
런타임 버전: | 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.
관련 API 요소
mx.managers.SystemManager.rawChildren
mx.managers.SystemManager.popUpChildren
mx.managers.SystemManager.toolTipChildren
mx.managers.SystemManager.cursorChildren
속성 | 정의 주체 | ||
---|---|---|---|
numChildren : int [읽기 전용]
The number of children in this child list. | IChildList |
메서드 | 정의 주체 | ||
---|---|---|---|
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 | 속성 |
addChild | () | 메서드 |
public function addChild(child:DisplayObject):DisplayObject
언어 버전: | ActionScript 3.0 |
제품 버전: | Flex 3 |
런타임 버전: | 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)
매개 변수
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 | () | 메서드 |
public function addChildAt(child:DisplayObject, index:int):DisplayObject
언어 버전: | ActionScript 3.0 |
제품 버전: | Flex 3 |
런타임 버전: | 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.
매개 변수
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 | () | 메서드 |
public function contains(child:DisplayObject):Boolean
언어 버전: | ActionScript 3.0 |
제품 버전: | Flex 3 |
런타임 버전: | 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.
매개 변수
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 | () | 메서드 |
public function getChildAt(index:int):DisplayObject
언어 버전: | ActionScript 3.0 |
제품 버전: | Flex 3 |
런타임 버전: | Flash Player 9, AIR 1.1 |
Gets the child DisplayObject at the specified index in this child list.
매개 변수
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 | () | 메서드 |
public function getChildByName(name:String):DisplayObject
언어 버전: | ActionScript 3.0 |
제품 버전: | Flex 3 |
런타임 버전: | Flash Player 9, AIR 1.1 |
Gets the child DisplayObject with the specified name in this child list.
매개 변수
name:String — The name of the child to return.
|
DisplayObject — The child with the specified name.
|
getChildIndex | () | 메서드 |
public function getChildIndex(child:DisplayObject):int
언어 버전: | ActionScript 3.0 |
제품 버전: | Flex 3 |
런타임 버전: | 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)
.
매개 변수
child:DisplayObject — The child whose index to get.
|
int — The index of the child, which is an integer
between 0 and (numChildren - 1) .
|
getObjectsUnderPoint | () | 메서드 |
public function getObjectsUnderPoint(point:Point):Array
언어 버전: | ActionScript 3.0 |
제품 버전: | Flex 3 |
런타임 버전: | Flash Player 9, AIR 1.1 |
Returns an array of DisplayObjects that lie under the specified point and are in this child list.
매개 변수
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 | () | 메서드 |
public function removeChild(child:DisplayObject):DisplayObject
언어 버전: | ActionScript 3.0 |
제품 버전: | Flex 3 |
런타임 버전: | 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.
매개 변수
child:DisplayObject — The DisplayObject to remove.
|
DisplayObject — The child that was removed; this is the same
as the argument passed in.
|
removeChildAt | () | 메서드 |
public function removeChildAt(index:int):DisplayObject
언어 버전: | ActionScript 3.0 |
제품 버전: | Flex 3 |
런타임 버전: | 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.
매개 변수
index:int — The child index of the DisplayObject to remove.
|
DisplayObject — The child that was removed.
|
setChildIndex | () | 메서드 |
public function setChildIndex(child:DisplayObject, newIndex:int):void
언어 버전: | ActionScript 3.0 |
제품 버전: | Flex 3 |
런타임 버전: | 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.
매개 변수
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, 03:17 PM Z