Deploying an application

Version 3.7

Adobe Flash Builder setup

For improved performance, adjust your Adobe Flash Builder settings as follows:

  • Click Project > Properties > Flex Compiler, then uncheck the Enable integration with browser navigation check box. Unless you've added code to specifically support deep links, there is no need for this box to be checked.

Compiling an optimized SWF file

When you compile an application in Adobe Flash Builder, a debug version is created. While useful for development purposes, this is not optimal for deployments.

When you're ready to deploy an application, use the Adobe Flash Builder Export Release Build process to create an optimized release-quality version of the SWF file as follows:

  1. In Adobe Flash Builder, click Project > Export Release Build from the main menu.
  2. Click Finish.


If working with images, it is important to note that embedded resources do not get exported out to the release folder. If you wish to reference an image, you will need to make sure that this image is manually copied in the export build.

Production workflow

The compiled application (SWF file), its HTML wrapper, and its related files (for example, shared libraries) can be moved onto any web server. There are no dependencies on any additional files hosted by you (or Esri) at run time, because the compiled SWF file contains all the necessary code.

Cross domain file is only requied when web server with your application is on a different domain than the ArcGIS Server

When a web user accesses the HTML wrapper file, the browser verifies that Adobe Flash Player is installed and is using the specified minimum Flash Player version. The client browser then downloads the SWF file. At this point, the user might not connect back to this web server at all but instead connect directly to the servers containing map content and tasks. If your web application is not hosted on the same server as ArcGIS Server, you must have a crossdomain.xml file on ArcGIS Server.

About crossdomain.xml

To access data from a server other than the one hosting your Flex application, the remote server needs to have a cross-domain file in the root directory. For security reasons, the web browser cannot access data that resides outside the exact web domain where the SWF file originated. However, Adobe Flash Player can load data across domains if permission is granted from the server. This is accomplished by including a small crossdomain.xml file on the remote server that permits Flash to connect to services on that server. See the following code example:

<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "">
    <site-control permitted-cross-domain-policies="all"/>
    <allow-access-from domain="*"/>

For additional information, see Using cross-domain policy files in the Adobe Flex 3 Help, Adobe TechNote "External data not accessible outside a Macromedia Flash movie's domain," or view a sample cross-domain file.

Working with SSL

It is possible to host your Flex web application using Secure Sockets Layer (SSL). Although it is not required, it is good practice to enable the web server for https rather than http. If this is not an option, you can modify the crossdomain.xml file similar to what is provided below so that http can access https without errors.

Set secure="false" to allow http to https transfer

<?xml version="1.0" ?>
   <allow-access-from domain="*" secure="false"/>
   <site-control permitted-cross-domain-policies="all"/>
   <allow-http-request-headers-from domain="*" headers="*"/>
   <allow-https-request-headers-from domain="*" headers="*"/>

Deploying crossdomain.xml

To deploy the cross-domain file on ArcGIS Server, see the instructions below specific to your platform and version. Note the crossdomain file goes on the server with ArcGIS Server, not the server with your application.

  • For 10.1, the location for Windows is C:\Program Files\ArcGIS\Server\framework\runtime\tomcat\contexts\rootapp.

    ArcGIS 10.1 comes with the crossdomain.xml already installed, so unless you want to make changes, it should work successfully.

  • .NET—Add crossdomain.xml to your web server's root directory, for example, C:\inetpub\wwwroot.
  • Java—Add crossdomain.xml to <ArcGIS_Server_Install_Location>\ArcGIS\java\manager\web_output for 10.0 or <ArcGIS_Server_Install_Location>\ArcGIS\java\web_output for 9.3 installations of ArcGIS Server.
  • On Windows, the default locations for these directories are:
    • 10.0—C:\Program Files\ArcGIS\Server\java\manager\web_output
    • 9.3—C:\Program Files\ArcGIS\java\web_output

To deploy the cross-domain file on ArcGIS Spatial Data Server, see the following instructions specific to your platform and version:

  • ArcGIS 10.1 Spatial Data Server for the Java Platform installs the client access policy files in the Java installation directory (for example, C:\Program Files\ArcGIS\SDS10.1\java). Copy the crossdomain.xml file to your web server's root directory. For example:
    • If you use Apache Tomcat, place the appropriate client access policy file in $CATALINA_HOME/webapps/ROOT (Linux) or %CATALINA_HOME%\webapps\ROOT (Windows) prior to deploying.
    • If you use IBM WebSphere or Oracle WebLogic, create a .war file that contains the appropriate client access policy file and deploy it to the web server's root directory.
  • For ArcGIS 10.1 Spatial Data Server for IIS, install the ‘Cross-domain Policy Files’ when you run the installation wizard. This installs the crossdomain.xml file in the web server root location.

Additional information

Please see the crossdomain.xml for additional information specific to crossdomains.