
text="3.1" />
</mx:FormItem>
<mx:FormItem label="Weeks">
<mx:Label id="txtWeeks" />
</mx:FormItem>
</mx:Form>
<mx:DataGrid id="dgWeeks">
<mx:columns>
<mx:DataGridColumn dataField="week" headerText="Week" />
<mx:DataGridColumn dataField="miles" headerText="Miles"/>
</mx:columns>
</mx:DataGrid>
</mx:WindowedApplication>
I could have created a component and shared that between the
web version and the AIR version. But I wanted to focus this
example on building AIR applications and not on the benefits
of reusable MXML components.
The next thing I need to do is to make some small changes to
the AIR_Runner-app.xml that was generated when the
AIR_Runner-app.mxml file was created. The AIR loader appli-
cation uses this XML file when it starts up. It’s populated with
all the biographical information about the application: the path
to the SWF, the dimensions of the startup window, the icon if
you have one, the name of the application, and so on.
I tweak only three things: the name of the window, and its
height and width, as shown in Example 9-2.
Example 9-2. Selected segments of AIR_Runner-app.xml
...
<title>Runner's Calculator</title>
<width>600</width>
<height>250</height>
...
Then I run the AIR application in Flex Builder just as I would
any web application that I develop using Flex. You can see the
result of this in Figure 9-2.
Your customers who want to run this application are first going
to have to install the AIR runtime on their computer. They can
Creating an AIR Version of the Runner’s Calculator | 121
Kommentare zu diesen Handbüchern