Search code examples
apache-flexsvnactionscriptantflexbuilder

How to make a Flex Builder project to work on an existing Flex non-project with ant build?


I want to do some development on a Flex project that uses Ant: http://svn.openstreetmap.org/applications/editors/potlatch2/ . I can build it from the command line but now want to use Flex Builder 3.0.2 to build, debug, etc.

I can see a few different paths to follow, but nothing that screams out "this is the right way":

  • create new project, SVN checkout in there (but then the directory structures won't match, and not sure how to tell FB to build using the existing build.xml)
  • create new project, create external source links to another directory with the files in it

Surely people do this all the time? (Never done Flash development before...)


Solution

  • Ok, here's what ended up working for me. It turns out I didn't need to use ant to build the project after all. This is for the specific project (Potlatch2) but lots of the principles are probably common.

    1. File | New Flex Project (no server), save it somewhere, eg "c:\pot"
    2. SVN checkout the potlatch2 files inside, so you have c:\pot\potlatch2\potlatch2.mxml etc...
    3. Rename version.as.template to version.as and make up some stuff inside
    4. Remove the "..." line from potlatch2-config.xml. Don't ask me why.
    5. Set Flex SDK version - configure it to point to SDK 3.5
    6. Project | Properties | Flex Build Path:
      1. set source folder to potlatch2
      2. set output folder to potlatch2\resources
      3. set library path to potlatch2\lib
    7. Update Flash global security settings to allow access to c:\pot\potlatch2\resources (otherwise you get 1. SWF security errors)[1]
    8. Update browser settings (Window | Preferences...) to use a browser that has Flash Debug Player installed (ie, not Chrome).
    9. Under debug settings (click the bug drop down, Other...): Turn off "Use defaults", make debug (and possibly run and profile) point to an HTML host file that passes the right settings to potlatch2.swf, passing lat/long coordinates of a place you want to edit.