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

Navigation Components

There might not always be enough space onscreen for everything you want to display. In such situations, you can make your content selectable using tabs. Consider how user settings are presented in most desktop applications and operating systems. Complex arrays of preferences are arranged by category—and those categories are often organized by tabs. This is just one way to handle navigation in an application.

Flex comes with a standard set of components—called navigators—that help you control the flow of your application by arranging visible elements into different views. Instead of presenting their children in vertical or horizontal (or other) layouts, navigators provide the means to switch between their children, showing one child at a time while hiding the others.

This section explores some of the navigator controls available to you in Flex, particularly the TabNavigator, TabBar, ButtonBar, LinkBar, and Accordion.

TabNavigator

The TabNavigator is one of the most common navigator controls, so we’ll discuss it first. The TabNavigator takes any number of child containers and provides a tab for each. Like all navigator components, the TabNavigator requires its children to be container objects. Containers, as you know, group other elements into a single entity; thus, they’re perfectly suited to handling thematic content.

You set a tab’s text by assigning a label property to each container attached to the navigator control. Containers from the Halo (mx:) namespace have ...

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