Building and running Flex applications
Visited 831 times, 1 so far today
Flex is a development and run-time environment that you use to create rich Internet applications that use Adobe® Flash® Player 9 to deliver more intuitive and interactive online experiences.
The Flex application development process
Here are the typical steps involved in creating a Flex application:
Define an application interface using a set of predefined components (forms, buttons, and so on.)
Arrange components into a user interface design.
Use styles and themes to define the visual design.
Add dynamic behavior (one part of the application interacting with another, for example).
Define and connect to data services as needed.
Build the source code into a SWF file that runs in Flash Player.
This is just a typical development process; you don’t need to do these steps in this exact order.
The elements of a Flex application
A typical Flex application consists of the following elements.Flex framework
The Adobe® Flex 2 framework contains all the components you need to build rich Internet applications, which include:
Containers that you use to layout the application
Controls you use to gather data from users and to manage the user interface (Text and Button, for example)
Extensive data binding, formatting, and validation features
An event-driven development model that provides rich user interface transformation features such as effects and transitions.
The Flex framework is contained within a shared component library (SWC) file.
MXML
Every Flex application contains at least one MXML file, known as the main application file. MXML is a markup language, an implementation of XML that was designed specifically for creating Flex applications, and you use it to declaratively define the structure of your application using tags.
ActionScript 3.0
You add dynamic behavior to your applications using ActionScript 3.0, which is an implementation of ECMAScript and is similar to JavaScript. You can add ActionScript to Flex applications directly in the MXML file as script blocks or you can create separate files of ActionScript functions and import them into your MXML files.
CSS
Style attributes in visual components (buttons, list boxes, and so on) are controlled by component properties. For example, a button component has a fontFamily property that you use to set the font. Style properties are controlled by a theme, by styles defined in a CSS file, by styles defined in style blocks in an MXML file, or by setting individual style properties in the component instance itself.
Graphic assets
Like most applications, Flex applications contain a variety of graphic assets such as icons and other images.
Data
Some components are used to display data (a combo box or data grid for example) and you can populate these components with data by using arrays, collection objects, data models, external XML data sources, and so on.
How Flex applications are compiled and deployed
All of these elements end up either compiled into or linked to your Flex application, as shown in this illustration:
A Flex application is compiled into a SWF file, which runs in Flash Player. When the source code is compiled into a Flex application it is converted to ActionScript classes and is then merged into the SWF file along with graphics and other assets. At run time, the Flex application SWF file interacts with external libraries, services, and data sources as needed.
Standard Flex applications do not require server-side Flex services. Therefore, you compile them locally on your computer and typically deploy them to your users from an HTML page on a web server.
You can, however, create Flex applications that use Adobe® Flex Data Services 2, the Cold Fusion Flash Remoting Service, or other Java and J2EE services. Flex applications that use these services are deployed from an application server.


















