Pages

Monday 22 November 2010

Developing Flash on Linux

I recently bought a new net-book, and having no patience whatsoever with Windows 7 Starter, I decided to install Ubuntu. The OS works fantastically with only 1Gb of RAM and as a first time Linux user I was really impressed with the ease of use and customisability of Ubuntu. Clearly as a flash developer I needed a way to develop flash, to at least a basic level (I wasn't after full debugging or any fancy features, just a way to compile some apps and to allow me to work on the train or in front of the TV)!

I decided to keep it simple; just a text editor with command-line compiling and testing.

So here is how I did it:

1. Install the flex sdk:

The free SDK is downloadable from adobe ( http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4 ), I downloaded 4.5 to try out some of the new features, but you can choose the build that meets your requirements. Save the library somewhere to your local disk (I chose /home/USER/developer/sdks/flex_sdk). The next step is to enable the terminal to access the executables in the flex_sdk which will build your programs.

Open a new terminal and type sudo nano ~/.bashrc (you may be asked to enter your password) and add the line:

export PATH=/home/USER/developer/sdks/flex_sdk/bin:$PATH

to your bashrc file. To test it has worked restart the terminal type "which mxmlc",  it should echo the path you just provided.

2. Download the Flash 10.1 Debugger for Linux:

Download the Debugger and install it using:

$ cd /tmp
$ wget http://fpdownload.macromedia.com/get/flashplayer/current/install_flash_player_10_linux.tar.gz
$ tar -zxvf install_flash_player_10_linux.tar.gz
$ cd install_flash_player_10_linux
$ ./flashplayer-installer


in your terminal.

Hopefully you'll have a functioning debugger now. Check it works by finding an swf, setting all swfs to open with the flash player, and run gnome-open file.swf, and the debugger should open in the flash player.

Failing this just use the flash for Firefox plugin.

3. Install AS3 and MXML language files for Gedit:

If you don't have Gedit, get it, its a great little text editor, and for me at least it does everything I need to (at least for editing AS3 files). Download the MXML and AS3 files from http://conic.se/blog/posts/8/ and copy them into ~/.local/share/gtksourceview-2.0/language-specs/. When you run Gedit you should be able to switch to the correct syntax highlighting for each language.


Finally put all three together. Create a directory containing the actionscript library you want to compile, and in your command line run mxmlc test.as. If you've followed the steps you should have created an swf. Finally run the swf using gnome-open test.swf.

Here are a few screenshots of the system in action:




 Good luck developing AS3 in Linux

Monday 1 November 2010

Some Beautiful Transparency Renders in ASTrace

My raytracing project has been on hold for a while as I have been fixing minor bugs and not really creating anything new. I am rewriting some features of the raytracer completely from scratch which will hopefully improve performance and clarity of the code. I will implement features such as bounding spheres for intersection tests, as well as possible octrees or similar to improve performance for large numbers of objects. Once the engine is working fully in flash I will port it to alchemy, and hopefully with those performance boosts the engine will be ready for distribution.

Here are a few renders showing transparency and reflection that I created last night. Both are the same scene with different sky boxes applied. You can download the full size images (2200 by 1600px) by right clicking and saving as: