Ted Patrick > { Events & Community } > Adobe Systems


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.

FLEX EXAMPLE REMOVED
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.

Fire up the command line and compile some MXML!

Cheers,

Ted ;)

6 Responses to “ Flex on the command line ”

  1. # Anonymous Anonymous

    What does the optimizer give us over runtime share libaries?

    Do you have figures on what reduction in size it gives for a single Flex application?  

  2. # Anonymous Anonymous

    Another huge advantage of the command line is that you can compile on your development workstation, without the overhead of the entire J2EE stack always in the background. My server is a 1998 vintage "underpowered" P2 with 128 MB ram, that's great at serving up PHP pages, some SWF's, some Python CGI scripts and the odd MySQL query. However it would absolutely choke on having to run the full J2EE app that is Flex. (Obviously I'm not in MACR's enterprise category).

    While I usually hate produict differentiation, I'd actually love to see Flex split into two packages: (1) An Enterprise edition that is the full presentation server that is now available, and (2) a compiler only version at a reasonable price, comparable to compiler tools for other languages from other vendors,think Delphi, Visual C++, etc.

    And while I'm at it, FlexBuilder should have simply been Dreamweaver Pro. FB and DW2004 keep fighting for control on my system!

    Adam  

  3. # Anonymous Anonymous

    Hi there. Your phrase about being command line fan have catched my eye.

    I'm a big fan of it too, so I've wrote an AS2 class to implement command line logic.

    If you're interested, take a look at this.
    http://antistatic.net/ai/archives/2005/01/minor_update.html  

  4. # Blogger Ted Patrick

    The optimizer takes the classes/clips in a SWF and makes them shared libraries that can be reused across multiple applications. The size reduction directly coorolates with the number of reused classes. I have not used shared libraries with Flex yet so I cannot comment on that aspect.

    Ted ;)  

  5. # Anonymous Anonymous

    Hi Theodore,

    Thanks for your answer. It sounds like the optimizer does no more that Runtime Shared Libraries in Flex gives us for free, so am i right in saying that it isn't really a candidate solution for that technology?

    Just wondered if would give Flex developers anything for the cost.

    Cheers  

  6. # Blogger Ted Patrick

    I think it is fair to say that Optimizer does not yet provide any benefits to Flex developers. It provides allot of benefits for developing in V2 in Flash.

    I looked at RSL's in Flex and I was suprized how extensively they are implemented. The ability to reference SWC.swf is very useful and the ability to reuse another app as a RSL is also great.

    I would stick with Flex RSL's, why go external when everything is integrated so nicely. I am looking forward to exploring RSL's with Flex.

    Cheers,

    ted ;)  

Post a Comment



© 2008 Ted On Flash