Build 10 classic Flash games and learn game development along the way with this ultra-fast paced game development course.

If you love this blog, this is the book for you.

Buy the book

Get the source code of 12 commercial Flash games, which have been loaded more than 50 million times!

Learn from real world successful examples.

Get it now

Box2D for Flash Games teaches you how to make Flash physics games from scratch with the most advanced features.

Create the new Flash game smashing hit.

Buy the book

Getting started with Adobe Alchemy – Mac version

Do you know what is Adobe Alchemy?

Alchemy allows programmers to compile C and C++ scripts into SWC files to make them run on Adobe Flash Player 10 or Adobe AIR 1.5. In other words, you can compile the hundreds of millions of lines of existing open source C and C++ project to use them in Flash.

Some examples of existing C libraries compiled with Alchemy are Doom Triple Pack and World Construction Kit. And it’s free!!

The other side of the coin is still in beta (Adobe calls it “prerelease software”), not supported by Adobe, and not that user friendly.

That’s why I am writing this guide to have Alchemy running on your Mac. I’m starting with a Mac because if you find this guide difficult, be prepared… Windows installation is even worse. Anyway, let’s start:

Download everything you need

Before you start playing with Alchemy, there are some free softwares to download.

Xcode. It’s the developer tool for for Mac OSX and you will need to register to download it. Simply install it following the instruction it will give you.

Alchemy Toolkit for Mac OSX, that’s Alchemy itself. Unzip the entire folder in the root directory of your hard drive. Usually it’s called Macintosh HD.

Adobe Flex SDK, used to produce the final SWC. I wouldn’t use Nightly Builds. Unzip this package in the root directory of your hard drive, just like you made with Alchemy.

Also try to call the folders in a way easy to remember, such as flex and alchemy. This is how should it be your download window:

And this is what you should see in your finder:

Using Terminal

I told you it wasn’t user friendly… so we have to open Terminal and enter some text commands.

“Open” alchemy folder…

and execute config file

You should see something like this:

Don’t worry if you get a warning like this:

as it will be corrected later.

Now edit adl file in your flex/bin folder. Find this line:

and assuming your Flex folder is called flex, change with:

Return to Terminal and enter the following commands, assuming you are using flex and alchemy folder names:

Finally turn on alchemy:

Enter in a folder with an example source code:

and compile the C source code into an SWC:

You should see something like this:

And you should see a file called stringecho_triqui.swc in your stringecho folder, like in this picture:

Congratulations! You just compiled your first C code into a SWC with Alchemy.

Next time, I’ll show you what to do with it.

Rate this post: 1 Star2 Stars3 Stars4 Stars5 Stars (5 votes, average: 4.80 out of 5)
Loading ... Loading ...
Flash Templates provided by Template Monster are pre-made web design products developed using Flash technology.
They can be easily customized to meet the unique requirements of your project.
Be my fan on Facebook and follow me on Twitter! Exclusive content for my Facebook fans and Twitter followers

This post has 5 comments

  1. Marquezi Medeiros

    on November 9, 2010 at 2:15 am

    Very good, i’ll try to use this program to make the inverse, SWF into C code to edit that!

  2. Pradeek

    on November 9, 2010 at 3:52 am

    I’ve written a couple of getting started posts on Alchemy some time ago. You can find them here : http://pradeek.blogspot.com/search/label/alchemy

  3. sban

    on November 9, 2010 at 7:29 am

    look nice, thanks a lot for your share

  4. Jay

    on November 16, 2010 at 3:56 am

    Cannot compile, I have FlexSDK 3.5.0

    And what do we do with the sec file?

    In file included from stringecho.c:5:
    /alchemy/avm2-libc/include/stdlib.h:90: warning: conflicting types for built-in function ‘calloc’
    /alchemy/avm2-libc/include/stdlib.h:97: warning: conflicting types for built-in function ‘malloc’
    In file included from stringecho.c:6:
    /alchemy/avm2-libc/include/stdio.h:230: warning: conflicting types for built-in function ‘fwrite’
    /alchemy/avm2-libc/include/stdio.h:258: warning: conflicting types for built-in function ‘snprintf’
    /alchemy/avm2-libc/include/stdio.h:263: warning: conflicting types for built-in function ‘vsnprintf’

  5. spyder

    on May 26, 2012 at 6:17 am

    Thank You!