About Spark containers

Spark includes the following containers:
  • Group and DataGroup

  • SkinnableContainer, SkinnableDataContainer, Panel, TitleWindow, NavigatorContent, BorderContainer, and Application

    Note: The Panel and NavigatorContent classes are subclasses of the SkinnableContainer class. The information below for SkinnableContainer applies also to the Panel and NavigatorContent classes.

For more information on the Application container, see Application containers.

All Spark containers support interchangeable layouts. That means you can set the layout of a container to any of the supported layout types, such as basic, horizontal, vertical, or tiled layout. You can also define a custom layout.

To improve performance and minimize application size, some Spark containers do not support skinning. Use the Group and DataGroup containers to manage child layout. Use SkinnableContainer and SkinnableDataContainer to manage child layout and to support custom skins.

The Group and SkinnableContainer classes can take any visual components as children. Visual components implement the IVisualElement interface, and include subclasses of the UIComponent class and the GraphicElement class.

The UIComponent class is the base class of all Flex components. Therefore, you can use any Flex component as a child of the Group and SkinnableContainer class.

The GraphicElement class is the base class for the Flex drawing classes, such as the Ellipse, Line, and Rect classes. Therefore, you can use subclass of the GraphicElement class as a child of the Group and SkinnableContainer class.

The DataGroup and SkinnableDataContainer classes take as children visual components that implement the IVisualElement interface and are subclasses of DisplayObject. This includes subclasses of the UIComponent class.

However, the DataGroup and SkinnableDataContainer containers are optimized to hold data items. Data items can be simple data items such as String and Number objects, and more complicated data items such as Object and XMLNode objects. Therefore, while these containers can hold visual children, use Group and SkinnableContainer for children that are visual components.

The following table lists the main characteristics of the Spark containers:

 

Children

Skinnable

Scrollable

Creation policy

Primary use

Group

IVisualElement

No

As a child of Scroller

All

Lay out visual children.

DataGroup

Data Item IVisualElement and DisplayObject

No

As a child of Scroller

All

Render and lay out data items.

SkinnableContainer

IVisualElement

Yes

By skinning

Selectable

Lay out visual children in a skinnable container.

SkinnableDataContainer

Data item IVisualElement and DisplayObject

Yes

By skinning

Selectable

Render and lay out data items in a skinnable container.

BorderContainer

IVisualElement

No

No

Selectable

Lay out visual children in a nonskinnable container that includes a border.

NavigatorContent

IVisualElement

Yes

By skinning

Inherited from parent container

Subclass of SkinnableContainer that can be used as the child of an MX navigator container.

Panel

IVisualElement

Yes

By skinning

Selectable

Subclass of SkinnableContainer that adds a title bar and other visual elements to the container.

TitleWindow

IVisualElement

Yes

By skinning

Selectable

Subclass of Panel that is optimized for use as a pop-up window.

For information on skinning, see Spark Skinning. For information on creation policy, see About the creation policy.