To change the visible appearance of a SkinnableContainer,
create a custom skin. However, to make it simple to add a border
or change the background of a container, Flex defines the Spark BorderContainer container
as a subclass of the SkinnableContainer. The BorderContainer container
provides a set of CSS styles and class properties to control the
border and background of the container.
Note: Because you use CSS styles and class properties to control
the appearance of the BorderContainer container, you typically do
not create a custom skin for it. If you do create a custom skin,
your skin class should apply any styles to control the appearance
of the container.
The following example uses the backgroundColor, borderStyle, borderWeight,
and cornerRadius styles of the BorderContainer
container to control the appearance of the BorderContainer container:
The executing SWF file for the previous example is shown below:
The BorderContainer container defines two properties that also
let you control the appearance of the container:
The backgroundFill property,
of type IFill, defines the fill of the container. If you set the backgroundFill property,
then the container ignores the backgroundAlpha, backgroundColor, backgroundImage,
and backgroundImageResizeMode styles.
The borderStroke property, of type IStroke,
defines the stroke of the border. If you set the borderStroke property,
then the container ignores the borderAlpha, borderColor, borderStyle, borderVisible, and borderWeight styles.
The following example sets the backgroundFill and borderStroke properties:
The executing SWF file for the previous example is shown below:
Because the BorderContainer container does not implement the
IViewport interface, it does not directly support scroll bars. However,
you can wrap the Scroller control inside the BorderContainer container
to add scroll bars, as the following example shows: