Tabbed Application

0
86

The final option for application type is the Tabbed Application. Selecting Tabbed Application when creating a new Flex Mobile project will prompt Flash Builder to provide some additional functionality. As you can see within Figure 2-8, choosing Tabbed Application allows you to define your tabs right within the New Flex Mobile Project interface. In this example, I have added “My Application” and “My Preferences” tabs. After clicking Finish, Flash Builder will create my new Tabbed Application, as well as views for the tabs I defined. The code example below shows the contents of my main application file, named Tabbed.mxml. It is important to note that each of the views I defined (My Application and My Preferences) are included as View Navigator objects. This means that they will have their own navigator objects and can
include their own independent navigation, just as within the View-Based Application we previously discussed. Figure 2-9 shows the running Tabbed Application. Figure 2-10 shows the View-Based Application views we previously created, within the My Application tab of the Tabbed Application:

<?xml version=”1.0″ encoding=”utf-8″?>
<s:TabbedViewNavigatorApplication xmlns:fx=”http://ns.adobe.com/mxml/2009″
xmlns:s=”library://ns.adobe.com/flex/spark”>
<s:ViewNavigator label=”My Application” width=”100%” height=”100%”
firstView=”views._MyApplicationView”/>
<s:ViewNavigator label=”My Preferences” width=”100%” height=”100%”
firstView=”views._MyPreferencesView”/>
<fx:Declarations>
<!– Place non-visual elements (e.g., services, value objects) here –>
</fx:Declarations>
</s:TabbedViewNavigatorApplication>

Create a new Tabbed Application

A Tabbed ApplicationA Tabbed Application with navigators