Chapter 4. Flex Controls and Layout
The first step in building a Flex application is to create the user interface. Flex not only has a rich set of controls. It also has a complete set of layout mechanisms that make it easy to build user interfaces that look good and can scale appropriately as the display area of the Flash application is resized.
This chapter covers both layout mechanisms and controls. We will start by covering the layout mechanisms, and then we will discuss the available controls.
The Application Container
At the root of a Flex application is a single container,
called the Application container, which
holds all other containers and components. The Application container lays out all its children
vertically by default (when the layout
property is not specifically defined). There are three possible values for
the Application component’s layout property:
verticalLays out each child component vertically from the top of the application to the bottom in the specified order
horizontalLays out each child component horizontally from the left of the application to the right in the specified order
absoluteDoes no automatic layout, and requires you to explicitly define the location of each child component
If the Application component’s
layout property is absolute, each child
component must have an x and y
coordinate defined; otherwise, the component will be displayed in the
(0,0) position.
The Application container can
also be formatted using any of the several style parameters that ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access