Search code examples
actionscript-3flash

Compile actionscript to a swf


I have a folder which is full of .as files, theres one .as file who is the "main" which has a ui (buttons) etc. i need to compile all into a swf file, or a way to debug it.

these are the files: https://github.com/amitp/mapgen2

I have like 3 days trying to compile it and debug it, I even downloaded flash professional cs6.

any help?, Im a complete noob in .swf and .as files, I just want to debug the code so I can learn somethings.


Solution

  • At the bottom of your github link, there are instructions explaining how to compile using 'mxmlc'. This is the Flex SDK compiler. You get it when you download one of the Flex SKDs - http://www.adobe.com/devnet/flex/flex-sdk-download.html.

    It's used instead of Flash to compile 'Actionscript' (contain .as files only) or 'Flex' projects (may also contain .mxml files).

    You can use it simply from the command line, once you obtain it from the SDK:

    mxmlc input.as
    

    IDEs

    However, you might find it more effective to use an IDE for developing Actionscript and/or Flex projects.

    FlashDevelop

    If it's only .as files - that is, it's an 'Actionscript' project and not necessarily a 'Flash' project (with .fla, etc), and not a 'Flex' project including .mxml files where you might like to edit these in a Design View, you may wish to consider using the free, opensource, and all around fantastic FlashDevelop:

    http://www.flashdevelop.org/

    You probably will just need to create a project in the folder where you have the files, specify which one is the 'main' one (which it sounds like is clear enough) and you should be able to compile. Depending on the project, you may need different versions of the Flex SDK to target when compiling, but hopefully what comes pre-installed with the IDE will get you there. As per your link's explanation of how to compile, you may need to configure a few additional compiler options for it to pass to mxmlc.

    If the project contains .mxml files, it will still work, but I don't believe it supports a 'design view' for working with these.

    FlashBuilder

    If the project contained .mxml files that you'd like to edit in a 'Design View', or you're familiar with Eclipse and would enjoy more of the same, the equivalent Adobe tool is 'FlashBuilder' (previously FlexBuilder): http://www.adobe.com/au/products/flash-builder.html