4 Replies Latest reply on Apr 26, 2011 7:23 AM by LodeRunnr

    How to specify a different name for the compiled swf?

    LodeRunnr

      Hi,

       

      I'm currently working on a project where my main file is Content.as

      This file compiles to a Content.swf flash file.

       

      Since my project is loaded by an external framework, I need it to be called game.swf

       

      Is there a way to compile it to a different name directly?

      I can rename it by hand, but it's kind of hard to streamline my tests when I have to copy it to a new directory to a new name each time.

       

      Thanks.

       

      [EDIT]: Or better yet, can a specify a post-build or pre-launch script?

      That way I can do more than just renaming my file, also manipulate some other stuff and make a general template.

      Any way to do this?

        • 1. Re: How to specify a different name for the compiled swf?
          Gerhard, L. M.

          Right click on project name. Go to Preferences > Actionscript Compiler

           

          At the Addtional compiler arguments you add:

          -output=COMPLETE_FILE_LOCATION/FILE_NAME.swf

           

          Such as

          -output=/Documents/as3/projects/client/trial/publish/MainFileWithNewName.swf

          1 person found this helpful
          • 2. Re: How to specify a different name for the compiled swf?
            LodeRunnr Level 1

            Thanks, Gerhard!

             

            I had actually tried that, and the -output argument isn't accepted in build preferences...

             

            However, I did find another way to do what I wanted:

            - I went to Project > Preferences > Builders

            - Added an external program as a new Builder

            - I had it call a script that copies my swf to the correct location (the script also handles a few assets for me, so in my case it was an even better solution)

            • 3. Re: How to specify a different name for the compiled swf?
              Gerhard, L. M. Level 1

              I had actually tried that, and the -output argument isn't accepted in build preferences...

               

              Its accepted since you use -output= you must write the equal sign, than its allowed.

               

              However, I did find another way to do what I wanted:

              - I went to Project > Preferences > Builders

              - Added an external program as a new Builder

              - I had it call a script that copies my swf to the correct location (the script also handles a few assets for me, so in my case it was an even better solution)

               

              What external program are you using to build?

              I'm having problems with Actionscript Modules since they are beeing build at the wrong directories and I cant change this. Maybe the program you're using could help me too

              • 4. Re: How to specify a different name for the compiled swf?
                LodeRunnr Level 1

                 

                Its accepted since you use -output= you must write the equal sign, than its allowed.

                 

                Ah! Thanks for the tip.

                 

                What external program are you using to build?

                I'm having problems with Actionscript Modules since they are beeing build at the wrong directories and I cant change this. Maybe the program you're using could help me too

                 

                Actually, I'm still building with Flex.

                I just added another builder that calls a shell script that I called postbuild.sh to handle all the post-build operations (copying the swf and assets to the right directory).

                If you work with Windows, you can call a batch file to do that kind of work.

                 

                And if your project is really big and you need to maintain a complex build process, I recommend having a look at Ant. It integrates really well with Eclipse/Flash Builder.