Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/actionscript-3/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/backbone.js/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Flash 为什么MX库在我的SWF中?_Flash_Actionscript 3_Mxmlc - Fatal编程技术网

Flash 为什么MX库在我的SWF中?

Flash 为什么MX库在我的SWF中?,flash,actionscript-3,mxmlc,Flash,Actionscript 3,Mxmlc,我有一个纯AS3项目。我用蚂蚁来建造它。以下是我的ant脚本的一部分: <target name="mxmlc"> <exec executable="${flex.home}/${mxmlc}" failonerror="true"> <arg line="-compiler.include-libraries=${lib}"/> <arg line="-compiler.incremental=false"/&

我有一个纯AS3项目。我用蚂蚁来建造它。以下是我的ant脚本的一部分:

<target name="mxmlc">
    <exec executable="${flex.home}/${mxmlc}" failonerror="true">
        <arg line="-compiler.include-libraries=${lib}"/>
        <arg line="-compiler.incremental=false"/>
        <arg line="-compiler.optimize=true"/>
        <arg line="-debug=false"/>
        <arg line="-default-background-color=0x${background.color}"/>
        <arg line="-default-frame-rate=60"/>
        <arg line="-default-size 800 600"/>
        <arg line="-static-link-runtime-shared-libraries=true"/>
        <arg line="-source-path='${src}'"/>
        <arg line="'${basedir}/${src}/${src.file}'"/>
        <arg line="-o=${bin}/${output.file}"/>
        <arg line="-use-network=true"/>
    </exec>
</target>

问题是我得到的SWF真的很大。当我检查里面的东西时,我看到它有来自Flex的mx.*libs。为什么会这样?如何从我的SWF中踢mx.*


p、 在我的代码中,我不使用mx.*库中的任何内容。

即使您的代码没有直接导入任何mx.*类,但您导入的某些类可能有自己的导入。例如,您是否使用任何内置闪存、Flex或Spark组件

无论如何,我不会担心mx.*导入,而是检查您正在使用的资产:

  • 组件(您是否可以不使用一些组件,并用自己更简单的实现替换它们?)
  • 字体
  • 图像
  • 电影
  • 听起来

这些通常会导致SWF的膨胀,例如,调整图像质量或减少嵌入字体中的字符数可以大大减小文件大小。

如果不看源代码,很难说。您确定Ant没有自动包含FlexSDK吗?它如何找到通往图书馆的路径?也许您需要编辑默认的Ant配置文件并注释掉其中包含Flex.weltraumpirat的行,您是对的。我所有的媒体资源都得到了很好的优化。当我用SWF反编译器打开我的SWF时,我看到的问题是代码占用了我的SWF的90%以上。。。这是非常困难的。。