Skip to content
rondevera edited this page Sep 13, 2010 · 8 revisions

Environment files

Inside your /path/to/hemlock/src/ directory, look inside the config/ directory. Duplicate the environment.as-example file as environment.as.

Via environment.as, you can customize configurations and constants for your local development environment. If you make any important changes here that everyone else needs for running an app, add these changes to environment.as-example (and other similarly named files) and commit them. Do not add your environment.as to the repository.

Compiling with mxmlc

You can use mxmlc to compile ActionScript in a given application’s main class file to create a SWF file. For instance, you can compile the PersonMostLikely app like so:

cd /path/to/hemlock/src/
mxmlc com/mintdigital/personMostLikely/PersonMostLikely.as

This compiles the file com/mintdigital/personMostLikely/PersonMostLikely.swf, which you can run in your browser with the Flash plugin, or with a standalone Flash Player desktop app.

During development, you should always run mxmlc with debugging enabled:

mxmlc -compiler.debug=true com/mintdigital/personMostLikely/PersonMostLikely.as

More mxmlc options

Testing with fdb

The utility opens a given SWF in the standalone Flash Player desktop app, and opens a command-line console for logging ActionScript messages given by the trace() command. However, this console will only work if you compiled the SWF file with debugging enabled! To do this, you should always run mxmlc with the -compiler.debug=true option mentioned above.

Tips

  • Add this to your ~/.profile or equivalent for quick debugging:
    mf(){ mxmlc -compiler.debug=true -compiler.source-path=. -compiler.fonts.managers=flash.fonts.AFEFontManager ${1}.as && fdb ${1}.swf; }
    
    Then, from your /path/to/hemlock/src directory, you can use this command to compile an app (like PersonMostLikely) with mxmlc and run it with fdb:
    mf com/mintdigital/personMostLikely/PersonMostLikely
    In the example command above, note the lack of the .as extension. The last item in the path is the app’s name.
  • To test an app with multiple users logged in at once, you can open the SWF file in the Flash Player standalone app, and another copy in your browser (with the Flash plugin installed). Be sure to create additional local accounts as needed.

Clone this wiki locally