O'Reilly logo

Learning Flex 4 by Elijah Robison, Alaric Cole

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Adding Components to the Application

As mentioned previously, Design mode lets us add Flex UI components to a project by dragging and dropping. You’ll find the common controls and containers in the Components pane.

Dragging and Dropping Components

In the Components pane, scroll down until you notice the Label control, and then drag it into your application and drop it somewhere near the top-left corner. Once dropped, the control should remain selected. Remember, the blue border and the presence of handles indicate that a component is selected. With the label selected, return to the Properties pane to make some changes.

The Properties pane offers access to the properties for the currently selected component, and it has three different views: Standard, Category, and Alphabetical. The Properties pane should be in Standard view by default (Figure 3-7). Standard view is good for quick designing, and it’s subdivided into three more categories: Common, Style, and Size and Position.

Under the Common theme, set the label’s id to titleLabel, and set its Text property to “My First Flex 4 Application”.

Below the Style heading, you can modify typography characteristics such as font family, size, styling, alignment, and color. Let’s change some of these. We set the font family to Arial, kept the size at 12, and changed the style to bold. Feel free to take liberties.

But something’s vexing us. In the Size and Position area, the X and Y properties were casually set by dragging and dropping the label ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required