Ubuntu, Flex, ANT, AXDT and Flare – getting started

Update: This visualization and other Flare stuff can be seen in a fully functioning state in the VizReader RSS reader.

If you follow me on twitter you might know that processingjs didn’t work out for me, too slow for what I’m trying to do.

The following is based on this guide. This guide assumes you already have installed the newest version of Java SDK, if you haven’t just open synaptic and search for Sun and take it from there.


1.) Download Flex SDK here.

2.) sudo apt-get install ant

3.) Extract the contents of the Flex SDK download to /opt/flex.

4.) cp /opt/flex/ant/lib/flexTasks.jar /usr/share/ant/lib/flexTasks.jar

5.) Install the flash debug player by extracting the contents of /opt/flex/runtimes/player/lnx/install_flash_player_9_linux.tar.gz, then run the bash script. Choose /usr/lib/firefox-3-0.14 as the Firefox directory (if that is indeed your version).

6.) Add the following to your .bashrc file in your home directory:
PATH=$PATH:/opt/flex/bin
export PATH

7.) Download Flare and put it in /opt/flex_projects/flare.

8.) Go to the flare directory in a shell and run ant all. If everything worked according to plan you have now built the flare libraries.

9.) Create a file called Tutorial.as in /opt/flex_projects, paste the contents of this file in it. It’s the complete listing of the last example in the Flare tutorial.

10.) Download eclipse 3.5.

11.) Install AXDT so you have a proper IDE that works for Actionscript 3.

12.) Create a new project in Eclipse and link the /opt/flex_projects folder, check out your nice code highlighting and more if you open Tutorial.as in it.

13.) Create a file called build.xml in /opt/flex_projects, put this in it:

<?xml version="1.0" ?>
<project name="tutorial" default="build" >
    <property name="FLEX_HOME" value="/opt/flex/" />
    <property name="APP_ROOT" value="/opt/flex_projects/" />
    <taskdef
        resource="flexTasks.tasks"
        classpath="${FLEX_HOME}/ant/lib/flexTasks.jar" />

  <property name="build.dir" value="${basedir}/flare/build"/>
	
  <target name="build">
    <mxmlc file="Tutorial.as" output="Tutorial.swf">
	  <compiler.library-path dir="${build.dir}">
        <include name="flare.swc"/>
      </compiler.library-path>
      <compiler.library-path dir="${FLEX_HOME}frameworks/libs">
        <include name="framework.swc"/>
      </compiler.library-path>
    </mxmlc>
  </target>
		
</project>

14.) Run ant without any options or anything in /opt/flex_projects, voila! You just built the tutorial project.

15.) You can use the standalone player in /opt/flex/runtimes/player/lnx/ (not the one above, the other one) to test shockwaves with, I’ve copied it to the folder where I have my builds and just run ./flashplayer movie.swf. You get a lot of debug info in the shell if you do.

And that was that, you’re now ready to rock and roll!

Related Posts

Tags: , , , , , , ,