Datasheet

Luchner c01.tex V3 - 03/20/2008 2:29pm Page 7
Chapter 1: The Development Environment
The
filename
element reflects the name given to the application and is displayed as the value for
‘‘Application name’’ within the installer window. With the optional
programMenuFolder
property set
in the descriptor file, the filename will also be displayed within the subpath of the Windows Start
Programs menu.
The
version
attribute is an application-defined designator and does not relate to the version of AIR. Its
value is specified by the developer, and typically conforms to the standard
MajorVersion.MinorVersion
form. Within this example, the
version
value is
0.1
.
The
initialWindow
element has various optional child elements pertaining to the properties applied
to the initial application window. Properties, such as positioning and size, are applied as children
of the
initialWindow
node, but most have a default value and are considered optional. The
title
,
systemChrome
,
transparent
,and
visible
properties are all optional but are included in this example
with their default values because they are frequently used to customize the visual aspects of your appli-
cation. The only required property of
initialWindow
is the
content
element. The value for
content
is
the URL of the SWF file generated when you compile your application.
The
name
,
description
,
installationFolder
,and
programMenuFolder
properties are all optional. The
description
value is displayed within the installation window. The
name
value appears in the title of the
installation window; it is the application name available in the uninstall panel and is the name given to
the installation folder. The
installFolder
element’s value specifies the installation location of the appli-
cation within the application directory of your operating system —
C:
\
Program Files
on Windows and
HD name/Applications
on Mac OS X. The
programMenuFolder
is the subpath displayed in the Windows
Start Programs menu, where the application can be found under the value of
filename
. This setting
is ignored by any operating system other than Windows. The
installFolder
and
programMenuFolder
property values follow the same character restrictions as the file and folder naming conventions of your
operating system.
Many more properties can be set in the application descriptor file that are specific to the operating system
(such as associated file types) and the look and feel of your AIR application (such as icons). These are
optional and will be addressed in applications throughout this book.
The second snippet you saved as
HelloWorld.mxml
is your main application file. This book does not cover
the Flex language and MXML markup, but it does describe additions and changes to the Application
Program Interface (API) that pertains to AIR. A good first start is the
WindowedApplication
container:
<mx:WindowedApplication
xmlns:mx="http://www.adobe.com/2006/mxml"
layout="vertical"
windowComplete="completeHandler();">
The
WindowedApplication
tag defines the container for the application. Those familiar with the Flex
language are used to defining
Application
as their application container. In fact,
WindowedApplication
extends the
Application
component. It has extra attributes that can be set in the descriptor file and
overriddenwithinthistag,aswellasspecified events and styles unique to
WindowedApplication
.The
windowComplete
event is one such unique event, which is dispatched when the window’s initial layout is
completed and made visible. The
completeHandler()
method within the
<mx:Script>
tag is the handler
for this event. Currently, no operations are performed in this method, but one will be added when the
ADL tool is discussed in the next section.
7