Deploying Applications

Once you’ve compiled a Flex application, you next need to deploy the application. Many Flex applications are deployed on the Web, and that will be our focus in this section. If you want to learn more about deploying desktop applications (AIR applications), see Chapter 21.

Every Flex application consists of at least one main .swf file. Therefore, at a minimum you will always need to copy at least this one file to the deployment location (typically a web server). However, in addition to the main .swf, a Flex application may consist of the following deployable elements:

  • An HTML wrapper file

  • Data services (web services, Flash Remoting services, etc.)

  • Text and XML assets loaded at runtime

  • Images loaded at runtime

  • Audio and video assets loaded at runtime

  • Additional .swf files loaded at runtime

  • Runtime shared libraries

  • Modules

When you deploy an application, you need to make sure that you copy all the necessary files to the deployment locations.

Note

We cover embedding applications in a web browser, along with deeper integration with a web browser, in more detail in Chapter 20.

If you are using Ant, you can easily write a build.xml file that copies the necessary files to the deployment directories. Ant natively supports filesystem tasks such as copy and move. It also supports FTP tasks for deploying applications to remote servers.

Get Programming Flex 3 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.