Getting started for developers
This page describes an older version, please read about the latest version at:
http://resources.arcgis.com/en/help/flex-viewer/concepts/
http://resources.arcgis.com/en/help/flex-viewer/concepts/
You should be familiar with:
- The ArcGIS Viewer for Flex in general;
- How to configure with xml files.
- Understanding the folder structure of the Viewer application.
- Developing with Flex 4 or above.
- Using Adobe Flash Builder.
You should have:
- Access to a web server.
- Adobe Flash Builder 4.0, 4.1, 4.5, 4.5.1 or 4.6 - or some other way of compiling the Viewer.
- Adobe Flex 4.1 SDK or later.
- Source code for ArcGIS Viewer for Flex, part of the source code for Flex Viewer download.
- The ArcGIS API for Flex - download API library.
Getting the source code setup in Flash Builder onto your own machine.
- Download flexviewer-2.5-src.zip into a folder, e.g. "C:\Documents and Settings\jack\My Documents". Do not extract the files at this time.
- In Adobe Flash Builder, go to File -> Import -> Flash Builder project.
- Keeping "File" option selected, click Browse button.
- Select file downloaded in step 1, e.g. "C:\Documents and Settings\jack\My Documents\flexviewer-2.5-src.zip".
- The Extract new project to: textbox will be automatically set to location where the project source will reside, e.g. "C:\Documents and Settings\jack\Adobe Flash Builder 4.6\FlexViewer. Caution:
Do not put it onto your web server - you should separate the location of your application source code from your compiled output.
- Click Finish button. Project will be created and displayed in the Package Explorer window of Adobe Flash Builder, e.g. in this case FlexViewer.
- Download the API library and unzip it.
- From the unzipped API Library, copy the *.swc file into your Flash Builder projects "libs" folder.
Verify setup of Viewer
- Open the FlexViewer -> src -> (default package) folder
- Select index.mxml
- Now let's run it - there are multiple ways of doing this. One way is to click green triangle button on top. Another way is click Ctrl-F11. A third way is to click Run menu, then select Run Index.
- Browser will open and Flex Viewer application will be displayed.
As a best practice, you might want to follow below instructions for development
- Right click on this project (FlexViewer) -> Click Properties -> Click Flex Build Path.
- In the Output folder textbox at bottom, specify the location of your web server where your Flex Viewer should be deployed, e.g. in case of IIS web server, C:\Inetpub\wwwroot\flexviewerdebug.
- In Output folder URL text box , specify the URL that matches with your output folder specified in last step, e.g. http://localhost/flexviewerdebug/
- Click OK.
- Rebuild the project.
- Select the project and run it.
- Browser will open and Flex Viewer application will be displayed from a web site.
Compiler Performance Tip
- Only compile the Flex modules (a.k.a widgets) that you actually use. Go to Project -> Properties -> Flex modules and remove the widgets you don't use from this list. This will make your application faster.
General Performance Tips
- Compile an optimized SWF:
When you are ready to deploy your application, use Adobe's Flex Export Release Build process to create an optimized release-quality version of your SWF file:
- In Adobe Flash Builder, click Project > Export Release Build from the main menu.
- Click Finish.
- For your data, used tiled services were feasible.
- If using dynamic services, have your data and services in same projection as your basemap to avoid having to project data on-the-fly.
2/15/2012