Flex 编程注意之Flex Complier参数
在介绍这些参数之前,先要介绍一个工具:mxmlc.exe。 
mxmlc是Flex SDK里面的一个重要的工具:编译器,也就是无论是Flash Builder(Flex Builder) IDE、还是plug-in形式的Flash Builder(Flex Builder)在编译Flex Project的时候,都会自动调用mxmlc来完成我们的编译任务。 
而由于Adobe那边可以直接下载Flex SDK,因此如果是此种方式的话,则需要手动编译你的MXML文件了。
mxmlc.exe的地址: 
Flex SDK mxmlc path: 
{OS}:\FLexSDK\bin\mxmlc.exe
Flash Builder(Flex Builder) mxmlc path: 
{OS}:\.....\sdks\4.0.0\bin\mxmlc.exe
具体用法: 
从doc里面进入到mxmlc.exe所在目录,然后输入如下内容: 
mxmlc x:/test.mxml 
mxmlc x:/test.as 
上述两个内容分别是对text.mxml和test.as进行编译。同时上述的写法也是最简答的一种,也就是不加入任何参数的形式。
下面的列表提供了mxmlc的一些可选参数:
| 属性 | 描述 | 
| accessible=true|false | 是否具有可理解性 | 
| actionscript-file-encoding | 设置文件编码 | 
| advanced | mxmlc -help advanced | 检索mxmlc高级参数 | 
| allow-source-path-overlap=true|false | 验证source-path中定义的路径是否出现重叠,出现互相包含的现象 | 
| as3=true|false | 是否使用as3对象模型,默认为ture,如果选false,则es一定要定义为true | 
| benchmark=true|false | 是否输出编译时期的详细内容,默认是true | 
| context-root context-path | 设置flex-services.xml中的{context.root},如果没有详细定义,那flex将用空值。 | 
| contributor name | |
| creator name | 添加到swf文件里,name是作者的名字 | 
| date text | |
| debug=true|false | 是否可以进行调试 | 
| debug-password string | 远程调试用,设置密码 | 
| default-background-color int | 默认背景颜色 | 
| default-frame-rate int | 设置帧数,默认为24 | 
| default-script-limits | 定义应用脚本程序的执行限制 | 
| max-recursion-depth | 最大的递归默认是:1000 | 
| max-execution-time | 最大的执行时间默认是:60 | 
| default-size width height | 设置应用程序的大小 | 
| defaults-css-url string | 设置css的路径 | 
| description text | 添加到swf文件里的描述内容 | 
| dump-config filename | |
| es=true|false | |
| externs symbol [...] | |
| external-library-path path-element [...] | |
| file-specs path-element [...] | |
| fonts.languages.language-range lang range | 指定 Unicode编码语言的范围 | 
| fonts.managers manager-class [...] | 字体管理器 | 
| fonts.max-cached-fonts string | 在服务器缓存上可以保存的最大字体数 | 
| fonts.max-glyphs-per-face string | 最大限度的字符缓存 | 
| frames.frame label class name [...] | |
| generate-frame-loader=true|false | 绑定到默认的loader类上 | 
| headless-server=true|false | 能否设置编译器的执行头文件 | 
| help | 帮助 | 
| include-libraries library [...] | 引用所有的在swc中的类 | 
| includes class [...] | 引用具体的类 | 
| incremental=true|false | 保持原有的as,放在/generated目录下,默认的值是false | 
| keep-generated-actionscript=true|false | |
| language code | 预设字母表的编码,默认是false | 
| lazy-init=true|false | |
| library-path path-element [...] | 打印详细的连接报告 | 
| link-report filename | 指定编译器详细的配置文件,覆盖所有的命令行参数,可以通过+=连接多个配置文件。 | 
| load-config filename | |
| load-externs filename [...] | |
| localized-description text lang | |
| namespaces.namespace uri manifest | 指定mxml文件的命名空间,可以用 uri或本地的证明文件。(manifest.xml) | 
| optimize=true|false | 优化程序,减少文件大小,增加性能,默认为false | 
| output filename | 指定输出文件名字,如果不指定就用当前文件名。如果路径不存在,将会自动生成。 | 
| publisher name | |
| resource-bundle-list filename | 
| runtime-shared-libraries url [...] | 指定一系列运行时共享库,如果library.swf在 web_root/libraries目录下,那你可以使用 libraries/library.swf.来调用。 | 
| services filename | 指定 services-config.xml文件,该文件用在FDS中 | 
| show-binding-warnings=true|false | 当flash player不能探测时,显示警告。默认为true | 
| show-actionscript-warnings=true|false | 发生as类错误时,发出提示。默认为true。 | 
| show-deprecation-warnings=true|false | 为flex组件显示不可用。默认为true | 
| source-path path-element [...] | 添加源路径的路径或文件,会自动寻找mxml和as文件。可以使用通配符包含所有的文件和子路径,连接全部的文件,不能单个使用类和路径,可以使用+=。 | 
| strict=true|false | 输出为定义的属性和函数,也能执行编译时期类型的验证和提供默认参数。默认为true | 
| theme filename [...] | 指定主题数组 | 
| title text | |
| use-network=true|false | 指定当前应用程序的网络服务,默认为true.如果设为false就只能访问本地,不能访问网络。 | 
| verbose-stacktraces=true|false | 默认值为false,只在运行发生错误时候,提供错误显示。 | 
| version | 编译器的版本号 | 
| warn-warning_type=true|false | 是否验证自定义警告类型。 | 
| warnings=true|false | 如果设置false就废除所有的警告,此参数覆盖 warn-warning_typed 的值默认为true。 | 

