If you want to use Eclipse as your IDE for developing Flex, you'll need to do a bit of configuration to get it to work.
One time: XML Editor
In order to view your MXML files with syntax highlighting, you'll need to download an XML editor.
- Go to the 'Help' menu, then click on 'Install New Software...'
- Paste the URL http://editorxml.sourceforge.net/updates/ into the 'Work with' text box.
- Click Next, then Next, then agree to the terms. Then click Finish.
- Restart Eclipse to finish the installation.
One time: File Associations
Following these instructions will help Eclipse associate your Flex files with the appropriate editors.
- Go to the 'Window' menu on a Windows machine, or the 'Eclipse' menu on a Mac. Click on 'Preferences'
- Expand the 'General' node in the preferences tree pane, then expand 'Editors'. Click on 'File Associations'
- From here you'll be able to create file associations for
the file types you'll use. For each of the following pairs,
complete steps 4-5.
- File type: *.as - Editor: Java Editor
- File type: *.mxml - Editor: Rinzo XML Editor
- File type: *.swf - Editor: Go to 'External editors' and pick your browser of choice
- Click the 'Add...' button next to the 'File types' list. Copy the file type into the text box and click OK
- Click the 'Add...' button next to the 'Associated editors' list. Choose the matching editor and click OK
Each New Project: Configure Flex Builder
I'll provide starter Eclipse project files for each assignment which will provide most of the configuration you need; however, you will need to adjust the provided Flex builder so that it can find your Flex SDK. If you're creating your own new project, you can start with this code.
- Right-click on the project you're editing and select 'Properties'
- Choose 'Builders' in the left pane if it is not already selected. Then choose the builder 'MyFlexBuilder' and click 'Edit...'
- The text box under 'Location:' will be empty. Click the button 'Browse File System...' under it and navigate to your downloaded copy of the Flex 4.6 SDK. From there, go into the 'bin' folder, then select 'mxmlc.exe' if you're on a Windows machine, or 'mxmlc' if you're using a Mac
- Click the 'Apply' button at the bottom of the screen, then 'OK', then 'OK again
- To make sure your configured builder works, go to the 'Project' menu and select 'Build All'. There should be no errors in your Console, and a .swf file should appear in your bin folder.
Thanks to Sean Smith's guide for providing the implementation we use here!