default-background-color int
-default-frame-rate int
-default-size width height
设置SWF的背景色,帧频与宽高,这个也可以通过元标签设置,诸如
[SWF(width="720",height="560",backgroundColor="#000000")]
-default-script-limits
-max-recursion-depth
-max-execution-time
定义应用脚本程序的执行**,最大代码条目,最大递归层次,最大的执行时间
-debug=true|false
是否生成调试用SWF,调试用SWF会比一般的SWF要大。在Flex Builder中,默认为true,而在以Release方式时发布时,默认为false,所以用Release发布的文件会被debug时小很多。
-optimize=true|false
优化as,减少文件大小,增加性能,默认为true。
-strict=true|false
是否采用严谨模式
-use-network=true|false
可读取网络或者可读取本地文件
-includes class [...]
强制导入类,不管是否曾使用过这个类
-include-libraries library [...]
强制导入SWC文件中的所有类,不管是否曾使用过这个类
-frames.frame label class_name [...]
将类绑定label标记的帧上
【后台相关】
-context-root string
-context-path string
设置{context.root}的值,这个数值被应用在flex-services.xml,flex-config.xml内,是flash Remoting的必要参数,以确认服务端目录。也可通过设置Flex Server内的context root。
-services filename
指定services-config.xml的位置,用于Flash Remoting。也可以通过新建项目的选项卡设置。
【调试时信息】
-benchmark=true|false
是否输出编译时期的详细信息,默认为true
-warnings=true|false
是否显示警告信息
-show-unused-type-selector-warnings=true|false
是否显示未使用CSS的警告信息
-show-binding-warnings=true|false
是否显示绑定失效信息
【其他】
-keep-generated-actionscript=true|false
保留编译MXML文件过程中的AS文件
在介绍这些参数之前,先要介绍一个工具: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。
flex 编译函数
最新推荐文章于 2025-08-08 17:29:33 发布