Output filename in Flash Builder

后端 未结 4 1291
盖世英雄少女心
盖世英雄少女心 2021-01-12 10:55

I am trying Flash Builder for the first time and I\'m stuck in a simple task. How can I change the output filename?

By default, Flash Builder gives the SWF the same

相关标签:
4条回答
  • 2021-01-12 11:20

    The -output argument will compile your swf in your FlashBuilder install directory (ex : -output myNewName.swf will output at C:/program files/Adobe/Flash Builder 4/myNewName.swf)

    0 讨论(0)
  • 2021-01-12 11:33

    Simply change the name of main app (.mxml) file name when you compile and make a build the swf is changed auomaticaly.

    0 讨论(0)
  • 2021-01-12 11:33

    Yeah, the "-output" compiler param won't work if you're compiling in Flash Builder, as you've no doubt realized. It's by design, believe or not (not sure why).

    The solution that has worked for me has been to use a bit of indirection:

    1. use mxmlc to compile to ApplicationClass.swf
    2. command line copy ApplicationClass.swf to YourCustomSwf.swf
    3. command line run YourCustomSwf.swf

    You can do this with either a simple (platform-dependent) build script, or with Flex Ant Tasks. I highly recommend the latter; it's easy to setup, integrates well with Flash Builder, and (as a mostly platform-independent solution) will work in a multi-team multi-OS environment. Here are the above steps as ant tasks that will perform the magic for you:

    <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>
    

    you need only define all ${VARIABLES} I've listed in "your.properties.file", like so:

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

    (et cetera)

    And anyway - what's in a name? A program by any other name, would be as awesome... B-)

    0 讨论(0)
  • 2021-01-12 11:41

    Command line arguments for mxmlc are listed here and it seems that adding -output file.swf to the additional compiler arguments field in Project|Properties|Flex Compiler is the way to go. But it didn't work for me (I am using FB3, but that shouldn't matter).

    0 讨论(0)
提交回复
热议问题