<?xml version="1.0" encoding="UTF-8"?>
<flex-config>
<compiler>
<keep-generated-actionscript>false</keep-generated-actionscript>
<allow-source-path-overlap>true</allow-source-path-overlap>
<debug>false</debug>
<optimize>true</optimize>
<define>
<name>CONFIG::release</name>
<value>true</value>
</define>
<define>
<name>CONFIG::ENGLISH</name>
<value>false</value>
</define>
<define>
<name>CONFIG::SHUIHU</name>
<value>true</value>
</define>
<define>
<name>CONFIG::TAIWAN</name>
<value>false</value>
</define>
<library-path>
<path-element>D:\ResouresManager\ReleaseVersion\bin\sdk\4.6\frameworks\libs\authoringsupport.swc</path-element>
<path-element>D:\ResouresManager\ReleaseVersion\bin\sdk\4.6\frameworks\libs\core.swc</path-element>
<path-element>D:\ResouresManager\ReleaseVersion\bin\sdk\4.6\frameworks\libs\osmf.swc</path-element>
<path-element>D:\ResouresManager\ReleaseVersion\bin\sdk\4.6\frameworks\libs\textLayout.swc</path-element>
<path-element>D:\ResouresManager\ReleaseVersion\bin\sdk\4.6\frameworks\libs\player\11.1\playerglobal.swc</path-element>
</library-path>
<source-path>
<path-element>C:\Users\Administrator\Desktop\TaiWanVersion\Comp_Shuihu\src</path-element>
<path-element>C:\Users\Administrator\Desktop\TaiWanVersion\ShuiHu\src</path-element>
<path-element>C:\Users\Administrator\Desktop\TaiWanVersion\ShuiHuLoader\src</path-element>
</source-path>
</compiler>
<warnings>false</warnings>
<static-link-runtime-shared-libraries>true</static-link-runtime-shared-libraries>
<output></output>
<flex-config>
<compiler>
<keep-generated-actionscript>false</keep-generated-actionscript>
<allow-source-path-overlap>true</allow-source-path-overlap>
<debug>false</debug>
<optimize>true</optimize>
<define>
<name>CONFIG::release</name>
<value>true</value>
</define>
<define>
<name>CONFIG::ENGLISH</name>
<value>false</value>
</define>
<define>
<name>CONFIG::SHUIHU</name>
<value>true</value>
</define>
<define>
<name>CONFIG::TAIWAN</name>
<value>false</value>
</define>
<library-path>
<path-element>D:\ResouresManager\ReleaseVersion\bin\sdk\4.6\frameworks\libs\authoringsupport.swc</path-element>
<path-element>D:\ResouresManager\ReleaseVersion\bin\sdk\4.6\frameworks\libs\core.swc</path-element>
<path-element>D:\ResouresManager\ReleaseVersion\bin\sdk\4.6\frameworks\libs\osmf.swc</path-element>
<path-element>D:\ResouresManager\ReleaseVersion\bin\sdk\4.6\frameworks\libs\textLayout.swc</path-element>
<path-element>D:\ResouresManager\ReleaseVersion\bin\sdk\4.6\frameworks\libs\player\11.1\playerglobal.swc</path-element>
</library-path>
<source-path>
<path-element>C:\Users\Administrator\Desktop\TaiWanVersion\Comp_Shuihu\src</path-element>
<path-element>C:\Users\Administrator\Desktop\TaiWanVersion\ShuiHu\src</path-element>
<path-element>C:\Users\Administrator\Desktop\TaiWanVersion\ShuiHuLoader\src</path-element>
</source-path>
</compiler>
<warnings>false</warnings>
<static-link-runtime-shared-libraries>true</static-link-runtime-shared-libraries>
<output></output>
</flex-config>
上面为编译配置文件config_flex.xml
注:编译需要添加SDK bin到环境变量中
配置文件中<output></output>可以填写路径输出swf 也可以在运行cmd的时候指定
下面为编译命令:
command = "mxmlc -load-config D:\\config_flex.xml D:\\ShuiHuLoader\\src\\ShuiHuLoader.as -output D:\\ShuiHuLoader.swf"
os.system(command)
如果mxmlc -help 出现could not find jvm 需要手动把sdk下的jvm.config 中的java.home= 同一sdk目录下的jre路径输入
如果py调用命令不成功 cmd调用成功 则需要mxmlc.exe的绝对路径 如果路径出现空格 需要用双引号搞起来