Open Source Flash#2: Quick Tutorial

21 Feb

Based on Steve Love’s great tutorial-post and on a great post of Life of a programmer geek blog I summarize here a possible quick tutorial for those that wish to develop flash using all open source tools.

What do you need to install Flex on Linux?

  1. The Flex SDK
  2. Sun Java (needed for compiling the SWF binaries)

1) Check Java version

Because it has been reported that version 7 gives you trouble for open source flash. You might as well go for version 6, to check the currently installed version type:

~$ java -version
java version "1.6.0_0"
OpenJDK Runtime Environment (IcedTea6 1.6.1) (6b16-1.6.1-3ubuntu1)
OpenJDK 64-Bit Server VM (build 14.0-b16, mixed mode)

2) Get Open Source Flex SDK (under Mozilla Licence)

Simple download it from here, unzip it as you prefer and save it anywhere.

3) Place it under /opt/flex

If you are following the Filesystem Hierarchy Standard, one should place the package under /opt/flex (or other name of your choice).

4) Change permissions to +x

Now if you go under the /opt/flex directory and execute the /bin/mxmlc it will report that you actually do not have permissions. To change this is fairly easy, just type:

~$ sudo chmod +x /opt/flex_sdk_3/bin/mxmlc

5) Link the terminal to the compiler

Now if you type mxmlc (the compiler) your system don’t know where the compiler is! So you need to add a new location to the path on the .bashrc, simple edit it with your favourite editor (use sudo), mine is vim, and add this line in the end:

export PATH=/opt/flex/bin:$PATH

Now just test by typing:

~$ mxmlc -help
Adobe Flex Compiler (mxmlc)
Version 3.4.1 build 10084

EXTRA) How to resolve the /opt/flex_sdk_3/bin/mxmlc: /bin/sh^M: bad interpreter: No such file or directory error?

This is very simple, actually what is happening is the DOS newlines are causing errors in the shell script execution…

Install this tool (I’m using Ubuntu, so will use apt-get for this):

sudo apt-get install tofrodos

Next simple execute the dos2unix conversion on the mxmlc executable, and the problem is fixed:

sudo dos2unix /opt/flex_sdk_3/bin/mxmlc

Conclusions and ackowledgements

Once again the credits go to the brilliant tutorials of Steve Love and on a Life of a programmer geek.

Advertisements

3 Responses to “Open Source Flash#2: Quick Tutorial”

  1. PedroLopes February 21, 2010 at 8:02 pm #

    Also there’s a possible way of solving the bad lines under VIM (without installing any new stuff)

    —————-
    vim mxmlc
    :set ff=unix
    :wq
    —————-

    see http://vim.wikia.com/wiki/Change_end-of-line_format_for_dos-mac-unix

  2. PedroLopes February 22, 2010 at 3:01 am #

    If you wish to install the Flex Builder, it is also possible under Linux, here’s two guides:

    1) http://www.insideria.com/2008/04/step-by-step-setting-up-flex-b.html

    2)http://kbala.com/2009/03/install-adobe-flex-builder-linux-alpha-in-ubuntu/

  3. PedroLopes February 25, 2010 at 9:37 am #

    NOTICE: Download from here directly if you are not finding the OPEN SOURCE SDK (ONLY!):
    http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+3

    Them Adobe guys are quite sneaky in getting you in the “wrong” pages and downloading the Adobe Flex SDK (non-full-open) or even the Builder 60 days trial.

    ūüôā
    don’t be FLEXible

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: