【问题标题】:Flex ant build - how to reduce swf file sizeFlex ant build - 如何减小 swf 文件大小
【发布时间】:2011-06-22 16:16:31
【问题描述】:

当我使用 ant 构建 flex 项目时,生成的 .SWF 文件大小为 329 KB。同一个项目使用 flex builder 导出 .SWF 文件,.SWF 文件大小为 108 KB。在 flex builder 中,我在库路径中使用 .SWC 库,并使用 RSL 作为框架链接。

以下是我的蚂蚁脚本-

<!-- Internal project properties -->

<target name="build-flex" depends="init-flex, build_apphealth">
    <echo>Build Application Health View flex movies completed</echo>
</target>

<target name="init-flex">
    <property environment="env"/>
    <property name="FLEX_HOME" value="${env.FLEX_SDK}"/>
    <taskdef resource="flexTasks.tasks" classpath="${FLEX_HOME}/ant/lib/flexTasks.jar"/>
</target>

<target name="build_apphealth">
    <echo>Building Application Health View</echo>
    <mxmlc file="${basedir}/src/appha_guest_installer.mxml" keep-generated-actionscript="false"
           output="${basedir}/bin-release/appha_guest_installer.swf">
            <locale>en_US</locale>
        <load-config filename="${FLEX_HOME}/frameworks/flex-config.xml"/>
        <source-path path-element="${FLEX_HOME}/frameworks"/>
        <source-path path-element="${basedir}/src/locale/{locale}"></source-path>
        <compiler.library-path file="${basedir}/../wizard_framework/bin/wizard_framework.swc" append="true"/>
        <include-resource-bundles>ErrorMessages</include-resource-bundles>
        <include-resource-bundles>Strings</include-resource-bundles>
    </mxmlc>
</target>

我觉得 compiler.library-path 选项中应该有一些额外的属性。请让我知道可能的解决方案。

【问题讨论】:

    标签: flex3


    【解决方案1】:

    您是否尝试在 ant 构建文件中使用 runtime-shared-library-path?更多详情请参考this链接。

    【讨论】:

    • 感谢兄弟的建议。有效。我刚刚在 标签中的 static-rsls="false" 中添加了一个属性,发现 ant 生成的 swf 尺寸减小了。
    猜你喜欢
    • 2010-10-08
    • 2023-02-23
    • 1970-01-01
    • 2010-10-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-11-25
    • 1970-01-01
    相关资源
    最近更新 更多