【问题标题】:Output filename in Flash BuilderFlash Builder 中的输出文件名
【发布时间】:2009-09-21 22:05:20
【问题描述】:

我是第一次尝试 Flash Builder,但我遇到了一个简单的任务。 如何更改输出文件名?

默认情况下,Flash Builder 为 SWF 提供与入口点类相同的名称,我找不到任何地方可以更改它。

有人吗?

【问题讨论】:

    标签: flash actionscript-3


    【解决方案1】:

    编译和构建时只需更改主应用程序的名称(.mxml)文件名,swf 会自动更改。

    【讨论】:

      【解决方案2】:

      是的,如果您在 Flash Builder 中编译,“-output”编译器参数将不起作用,您无疑已经意识到这一点。这是设计使然,信不信由你(不知道为什么)。

      对我有用的解决方案是使用一些间接性:

      1. 使用mxmlc编译成ApplicationClass.swf
      2. 命令行复制ApplicationClass.swf到YourCustomSwf.swf
      3. 命令行运行YourCustomSwf.swf

      您可以使用简单的(依赖于平台的)构建脚本或使用 Flex Ant 任务来完成此操作。我强烈推荐后者;它是easy to setup,与 Flash Builder 很好地集成,并且(作为一个主要独立于平台的解决方案)将在多团队多操作系统环境中工作。以下是将上述步骤作为 ant 任务为您执行魔法:

      <project name="sample-build" default="run-your-swf">    
          <property file="${basedir}/your.properties.file"/>
      
          <target name="compile-your-app">
              <mxmlc file="${SOURCE_DIR}/ApplicationFile.mxml" compiler.debug="${IS_DEBUG}" incremental="true" failonerror="true">
                  <load-config filename="${DEFAULT_FLEX_CONFIG}"/>
                  <define name="CONFIG::DEBUG" value="${IS_DEBUG}"/>
                  <define name="CONFIG::FLASH_AUTHORING" value="${IS_FLASH_AUTHORING}"/>
                  <define name="CONFIG::IS_RELEASE" value="${IS_RELEASE}"/>
              </mxmlc>
          </target>
      
          <target name="rename-your-swf" depends="compile-your-app">
              <copy file="${OUTPUT_DIR}/feed/FeedComponent.swf" tofile="${OUTPUT_DIR}/YourNewSexyFilename.swf"/>
          </target>
      
          <target name="run-your-swf" depends="rename-your-swf">
              <exec executable="${STANDALONE_FLASH_DEBUG_PLAYER}">
                  <arg line="${OUTPUT_DIR}/YourNewSexyFilename.swf"/>
              </exec>
          </target>
      
      </project>
      

      您只需要定义我在“your.properties.file”中列出的所有 ${VARIABLES},如下所示:

      FLASH_PLAYER_DEBUG=/Applications/Adobe Flash CS5/Players/Debug/Flash Player Debugger.app/Contents/MacOS/Flash Player Debugger
      IS_DEBUG=true
      

      (等等)

      不管怎样——名字里有什么?任何其他名称的程序都会很棒... B-)

      【讨论】:

        【解决方案3】:

        mxmlc 的命令行参数列在here 中,似乎将-output file.swf 添加到 Project|Properties|Flex Compiler 的附加编译器参数字段中是可行的方法。但这对我不起作用(我正在使用 FB3,但这不重要)。

        【讨论】:

        • 嘿。我也被困在那里,试图使用 -output 参数。尝试输入完整路径,它对我有用。
        • 你好,我得到 Option -在 Flash Builder 中编译时无法使用输出。我使用 Flash Builder 4.5
        【解决方案4】:

        -output 参数将在您的 FlashBuilder 安装目录中编译您的 swf(例如:-output myNewName.swf 将在 C:/program files/Adobe/Flash Builder 4/myNewName.swf 输出)

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 2011-08-09
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2014-03-29
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多