The IVisualElementContainer interface defines the minimum properties and methods
required for a container to manage Spark components for display.
Note that the Spark SkinnableDataContainer and DataGroup containers
do not implement this interface.
Those containers manage their
children through the dataProvider property.
Swaps the visual elements at the two specified index
positions in the container.
IVisualElementContainer
Property Detail
numElements
property
numElements:int [read-only]
Language Version :
ActionScript 3.0
Product Version :
Flex 4
Runtime Versions :
Flash Player 10, AIR 1.5
The number of visual elements in this container.
Visual elements include classes that implement
the IVisualElement interface, such as subclasses of
UIComponent and GraphicElement.
Implementation public function get numElements():int
Adds a visual element to this container.
The element is added after all other elements
and appears top of all other elements.
To add a visual element to a specific index position, use
the addElementAt() method.
If you add a visual element that already has a different
container as a parent, the element is removed from
the other container.
Parameters
element:IVisualElement — The visual element to add as a child of this container.
Adds a visual element to this container.
The element is added at the index position specified.
An index of 0 represents the first element in the display list.
If you add a visual element that already has a different
container as a parent, the element is removed from
the other container.
Parameters
element:IVisualElement — The element to add as a child of this visual container.
index:int — The index position to which the element is added. If
you specify a currently occupied index position, the child
that exists at that position and all higher positions are moved
up one position in the child list.
Removes the specified visual element from the child list of
this container.
The index positions of any elements
above the element in this visual container are decreased by 1.
Parameters
element:IVisualElement — The element to be removed from the container.
ArgumentError — If the element parameter is not a child of
this visual container.
removeElementAt
()
method
public function removeElementAt(index:int):IVisualElement
Language Version :
ActionScript 3.0
Product Version :
Flex 4
Runtime Versions :
Flash Player 10, AIR 1.5
Removes a visual element from the specified index position
in the container.
The index positions of any elements
above the element in this visual container are decreased by 1.
RangeError — If the index does not exist in the child list.
setElementIndex
()
method
public function setElementIndex(element:IVisualElement, index:int):void
Language Version :
ActionScript 3.0
Product Version :
Flex 4
Runtime Versions :
Flash Player 10, AIR 1.5
Changes the position of an existing visual element in the visual container.
When you call the setElementIndex() method and specify an
index position that is already occupied, the only positions
that change are those in between the elements's former and new position.
All others stay the same.
If a visual element is moved to an index
lower than its current index, the index of all elements in between increases
by 1. If an element is moved to an index
higher than its current index, the index of all elements in between
decreases by 1.
Parameters
element:IVisualElement — The element for which you want to change the index number.
index:int — The resulting index number for the element.
Throws
RangeError — If the index does not exist in the child list.
ArgumentError — If the element parameter is not a child
of this visual container.