Chapter 3. Building a Basic Flex Application


  • Creating a "Hello World" application

  • Switching workspaces

  • Creating a Flex project

  • Understanding HTML templates

  • Exporting a release build

  • Deploying a Flex application on the Web

  • Integrating Flex applications with Web pages in Dreamweaver CS4

In this chapter, I describe how to create and deploy a basic "Hello World" Flex application for the Web. After the application is built, I describe the fundamental nature of a Flex application, including the relationship between the application SWF file and the supporting HTML (Hypertext Markup Language) files. I describe the contents of the HTML "wrapper" file that's generated for you in Flash Builder and its associated JavaScript library file.

Finally, I describe how to deploy the Flex application into a Web site in these ways:

  • As a distinct application that opens in its own window

  • As an applet that's displayed as part of an existing Web page

  • As a desktop application deployed on Adobe AIR

By the end of this chapter, you should have a good sense of what a Flex application is and how it's delivered to the user.


The code samples and screen shots in this chapter assume that you're using Flash Builder 4 to build the application. If you're using the Flex 4 SDK and your own text editor, the steps will be similar, but you won't have access to some of the code completion and other productivity tools I describe.

Creating a "Hello World" Application

In all programming languages, your first task is to write ...

Get Flash® Builder™ 4 and Flex® 4 Bible now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.