views:

1850

answers:

3

Although the Flex command-line compiler (mxmlc) can compile MXML+ActionScript files into SWFs, I need specific insights into its capabilities, via the command-line switches.

  • Configure which language you're writing in, ActionScript 2 / 3
  • Configure which Flash Player version you're targetting, 7 / 8 / 9 / 10
  • Configure what frames of the movie, contain what ActionScript code.

An article covering Mxmlc, an intro to the Flex SDK.

+3  A: 
$> mxmlc --help target-player

-target-player <version>
    specifies the version of the player the application is targeting.
    Features requiring a later version will not be compiled into the
    application. The minimum value supported is "9.0.0".

You can't define the language afaik - mxmlc version 3 is an actionscript 3 compiler only. There may be some backwards compatibility, but it's not a combined AS2 and 3 compiler.

I'm not even sure what your third point actually means, or in fact what you're asking overall.

inferis
+1  A: 

Using the flex complier is not the same as making something in flash, you do not put specific code into specific frames. Flex apps only have 2 frames anyway.

If you wished to compile your code for AS2 then you'd need to use the mxmlc that was build for flex 2, if you’re using the latest mxmlc then it does it for AS3.

If you are coding in AS3 then you must target flashplayer 9 or above.

kenneth
Flex 1.x used AS2. Flex 2 was the first compiler to support AS3.
joshtynjala
yip your right, I forgot about 1.x as flex 2 was so short lived :)
kenneth
Another correction to this line: "If you wished to compile your code for AS2 then you'd need to..."Unlike Flex 1.5 which was a *server* technology and no longer available, one can use MTASC (http://mtasc.org) to compile ActionScript 2.0 code.Given the other problems with it, the line should probably just be removed.
Luke Bayes
+3  A: 

Though not a direct answer to your question, it's interesting to note that the following arguments to MXMLC will allow you to write AS1-style code:

-strict=false -as3=false -es=true

With those arguments, you'll be able to extend via prototype again and the compiler won't use strict mode. It's a fun way to "extend" the language and play with the JS-like capabilities not normally used with AS3.

joshtynjala