Potlatch 2/Developer Documentation/Compiling with Flex Builder

From OpenStreetMap Wiki
Jump to navigation Jump to search

Debugging with FlashBuilder/FlexBuilder

Here's how I (Steve Bennett) made a project using FlexBuilder 3.0.2. You apparently don't need ant to build with.

  1. Git clone the potlatch2 repository somewhere, say inside c:\pot
  2. File | New Flex Project (no server), set the source path as c:\pot\potlatch2
  3. set output folder to potlatch2\resources
  4. set library path ("add SWC folder") to potlatch2\lib
  5. Copy version.as.template to version.as and make up some stuff inside
  6. Remove the "<output>...</output>" line from potlatch2-config.xml. Don't ask me why.
  7. Set Flex SDK version - configure it to point to SDK 4.5
  8. Under HTML Wrapper, set the required Flash Player version to 10.1.85 (otherwise you get "type not found" errors)
    • (Actually I had to make it to 10.2.0 or higher with SDK 4.51)
  9. Update Flash global security settings to allow access to c:\pot\potlatch2\resources (otherwise you get SWF security errors)[1]
  10. Update browser settings (Window | Preferences...) to use a browser that has Flash Debug Player installed (ie, not Chrome).
  11. Right click on potlatch2.mxml, and select "Set as default application"
  12. Under debug settings (click the bug drop down, Other...):
    1. Double click "flex application" to make a new default configuration.
    2. 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.