mxmlc --strict=true --file-specs MyFirst.mxml
MTASC is the first ActionScript 2 Open Source free compiler.
It can compile large number of
.as class files in a very short time and generate directly the corresponding SWF bytecode without relying on Macromedia Flash or other tools
-swf file: specify input SWF which contains assets.
-cp path: add a directory path to the ClassPath : this is the list of directories that MTASC will use to look for
.asfiles. You can use several times -cp to add several directories.
-main: will automaticaly call static function
mainonce all classes are registered.
-header width:height:fps:bgcolor: does not load a SWF, instead create a new one containing only compiled code and using provided header informations. bgcolor is optional and should be 6 digits hexadecimal value.
-mx: use precompiled MX classes (see section on V2 components below).
Some other arguments, for advanced users :
-version n: specify SWF version : 6 to generate Player 6r89 compatible SWF or 8 to access Flash8 features.
-v: activate verbose mode, printing some additional informations about compiling process.
-out file: change output swf file.
-msvc: use Microsoft Visual Studio errors style formating instead of Java style (for file names and lines number).
-strict: will use strict compilation mode which require that all variables are explicitely typed.
-exclude file: exclude code generation of classes listed in specified file (format is one full class path per line).
-trace function: specify a custom trace function. (see Trace Facilities), or
nodisable all the traces.
-keep: keep AS2 classes compiled by MCC into the SWF (this could cause some classes to be present two times if also compiled with MTASC).
-frame f: will export AS2 classes into target frame of swf.
-pack path: compile all the files contained in specified package - not recursively (eg to compile files in
mtasc -cp c:\flash\code -pack my/app).
-group: will merge classes into one single clip (this will reduce SWF size but might cause some problems if you're using -keep or -mx).
-wimp: adds warnings for import statements that are not used in the file.
-infer: adds type inference for initialized local variables (see below).
命令示例: mtasc -swf tuto.swf -main -header 800:600:20 Tuto.as800:600是指文件宽高,20是指贞率