Search Flex Components Free

Custom Search

December 10, 2007

Flex on the command line

I am a big fan of the command line. There is nothing as pleasing as typing some commands and compiling an app. So I located the MXML Compiler in my Flex installation and one argument later, SWF.&

The Flex MXML compiler is located at Flex\bin\mxmlc.exe and simply passing this exe valid MXML document will result in a SWF file:

C:\Flex\bin>mxmlc test.mxml

Depending on your licensing, the SWF will have an expiration time or not. If Flex licensing is in developer or trial mode, the swf will expire within 24 hours. I expect the SWF below to shrivel and die at 9AM tomorrow.

WARNING - Above data is highly subjective and fake, some may find disturbing!

Also depending what you use within your MXML, the swf files may be portable to other http servers. Above is an example that I compiled this morning. It is being served by my FreeBSD server over http. This type of portablity is sorely needed in Flex. I have personally had 2 clients who could not use Flex for this very reason, yet were willing to pay for licensing. If licensing would allow me to create portable SWF files, I would purchase a FLEX license for PowerSDK in order to service consulting clients more fully. Combined with AriaWare Optimizer, I could generate very small SWF files for clients and reuse the base components via shared libraries.

Correction: Ariaware Optimizer is not yet compatible with Flex output as the __Package paths are different than the V2 framework. I ran the SWF output through Ariaware to test and although it states it work, it fails to partion classes in to separate file. Sorry for the confusion.

So what is so great about the command line? It is scriptable, consistant, simple, strict, extensible, and very precise. There are thousands of tools that can be integrated from the command line and writing your own command line tools is easy.

Related Flex Tutorials