3 May 2011
Beginning
In this exercise you will use multiple navigator containers to display the content shown in Figure 1.
In this section you will create an Accordion container to display employee information.
The components are displayed vertically (see Figure 3).
Accordion container.<components:InformationTechnology label="Information Technology" />
<mx:Accordion>
</mx:Accordion>
Accordion container.<mx:Accordion>
<components:HumanResources label="Human Resources" />
<components:Marketing label="Marketing" />
<components:InformationTechnology label="Information Technology" />
</mx:Accordion>
The components are now listed in an Accordion container, but note that the employees are not contained within the container. (see Figure 4).
Next, you will use the resizeToContent property to assure the employee content is visible.
Accordion container, add the resizeToContent property set to true.<mx:Accordion resizeToContent="true">
...
</mx:Accordion>
Notice that each pane resizes to fit all of the components (see Figure 5).
In this section you will replace the Accordion container with a TabNavigator container.
Accordion container into a TabNavigator container. Remember to change both the opening and closing tags.<mx:TabNavigator resizeToContent="true">
<components:HumanResources label="Human Resources" />
...
</mx:TabNavigator>
You should see a TabNavigator container interface (see Figure 6).
In this section you will create a ViewStack container to display employee information.
TabNavigator container into a ViewStack container. Remember to change both the opening and closing tags.<mx:ViewStack resizeToContent="true">
<components:HumanResources label="Human Resources" />
...
</mx:ViewStack>
Note that only the content of the first child container is displayed by default in the ViewStack container (see Figure 7).
In this section you will use a TabBar control to switch between components in the control.
ViewStack container, add the id property set to employeeDepartments.<mx:ViewStack id="employeeDepartments"
resizeToContent="true">
<components:HumanResources label="Human Resources" />
...
ViewStack container, create a Spark TabBar control.<s:TabBar/>
<mx:ViewStack id="employeeDepartments"
resizeToContent="true">
...
TabBar control, add the dataProvider property with a value that is bound to the content in the employeeDepartments ViewStack container.<s:TabBar dataProvider="{employeeDepartments}"/>
In this section you will replace the TabBar control with a LinkBar control.
TabBar control into a LinkBar control.<mx:LinkBar dataProvider="{employeeDepartments}"/>
The application now uses a LinkBar control to switch between components in the ViewStack container (see Figure 9).
In this section, you will use a ButtonBar control toswitch between components in the control.
<s:ButtonBar dataProvider="{employeeDepartments}"/>
The application now uses a ButtonBar control to switch betweencomponents in the ViewStack container (see Figure 10).
In this exercise you used multiple navigator containers to display the content shown in Figure 10. In the next exercise you will use Flash Builder to create a login page.
This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License. Permissions beyond the scope of this license, pertaining to the examples of code included within this work are available at Adobe.