Tuesday, 23 December 2008

Compiling AS3 classes on the command line

As an update to my previous posting - I've just discovered this:

If you've installed the free Adobe Flex SDK, you can use the command line to compile .as files, making it possible for you to use any editor you like to author your Actionscript files.

Obviously one of the reasons I was so interested in using IntelliJ is because you can compile and run your flash movies through the debugger (as you can with the FlexBuilder eclipse plugin). However, this may well be useful for someone.

First cd to wherever you installed your SDK - in this case, for Leopard:

It'll load a flex-config.xml file (in the frameworks folder), write out any errors / warnings and then tell you that it has created:

ClassName.swf (and output the size in bytes).

Also (may be worth noting):

This approach could (possibly?) be useful if you were building an application that would compile as3 classes as part of its execution, or if you were using ANT to compile an as3 app as part of a build process (there are a few blog postings on this too).

Quick disclaimer:

It should probably be said that it's currently unclear to me whether mxmlc.jar is part of the SDK or whether it's part of the eclipse plugin. If you were planning to use it as part of an application, you would need to check licencing requirements with Adobe.

No comments: