Compiling an .SWF using Action Script Files

12,395

The project you want to compile actually includes a Make file.

MXMLC = "/Applications/Adobe Flash Builder 4.5/sdks/4.5.0/bin/mxmlc"

build:
    $(MXMLC) -debug=false -static-link-runtime-shared-libraries=true -optimize=true -o recorder.swf -file-specs flash/FlashRecorder.as

clean:
    rm recorder.swf

It looks setup for osx, but you get the idea. If you only need to do minor changes and could do without an IDE that shows error/warnings/etc. you can do this:

  1. Download the FlexSDK
  2. Setup an environment variable so you can access the mxmlc compiler from anywhere on your system
  3. Navigate to your project and compile from the command line

Step 1 is trivial. Step 2 depends on your os a bit. On Windows should be something like My Computer > Properties > Advanced > Environment variables (I remember this is on XP, should still be somewhere on the Computer Properties properties on Windows 7) and add to the PATH variable the location of the FlexSDK's bin folder. On unix you should add something like this to either ~/.profile or ~/.bash_profile : export PATH=/your/path/to/FlexSDK/bin:$PATH At this you should be able to run mxmlc -version from the command line

Step 3 means navigating to the project and running:

mxmlc -warnings=false -debug=false -static-link-runtime-shared-libraries=true -optimize=true -o recorder.swf -file-specs flash/FlashRecorder.as

So that's the command line option in a nutshell.

If you have a bit more editing to do you can use an IDE. If you're on Windows I warmly recommend FlashDevelop: it's fast/lightweight/free/opensource. It downloads the sdk and setups everything for you.

If you're on OSX you can use FDT 5 Free or a trial version of Flash Builder(60 days by default) or setup TextMate with the actionscript 3 bundle.

Share:
12,395
Rion Williams
Author by

Rion Williams

I'm Rion, a Full Stack Software Engineer and a Microsoft MVP with a love for solving problems, building meaningful applications, embracing the latest development standards, teaching and helping fellow developers, continually learning and improving, and getting things done. I'm very passionate about making the developer community a better place and you'll frequently find me on the ASP.NET Forums, Stack Overflow, writing articles or blog posts, or working on open-source projects.

Updated on June 04, 2022

Comments

  • Rion Williams
    Rion Williams almost 2 years

    This may be somewhat trivial, but I am attempting to work on an Action Script / Flash project and need to make some changes to it and attempt to rebuild the .SWF file associated with it.

    The project itself is fairly straightforward and is available on github here It is jwagener's recorder.js, which consists of several Action Script files and a single compiled .SWF file.

    I am not terribly familiar with the build process for Action Scripts and I am sure that I have all of the necessary tools (Flash Builder, Adobe Flash Professional etc.) but I am not sure about how to go about it.

    I've attempted to simply create a new ActionScript project and add all of the necessary ActionScript files from his repository, but upon building the .SWF it didn't function at all and lacked all of the External Interface elements that I need to use.

    Any ideas, walk-throughs, or tutorials that would point me in the right direction would be extraordinarily helpful.