Tech n mad stuff for mads like me ;) Here i will share tech problems i came across and how i solved em !

About Me

My photo
Think a lot but do less.Life full of downs and less ups but ups are stronger than downs.

Thursday, October 29, 2009

Using open source flex sdk to compile flex apps in linux

I installed Fedora core 9 on the mission of trying to be open :)
The major challenge was how to do stuffs in linux which were in xp
Some how i installed tomcat,mysql and managed to run php apps
the next chellenge was flex !
thanks to Adobe for making flex sdk open source which allows user to compile as3 and flex
but it has its limitation
free flex sdk donot support advanced features like graphs and pie charts :(
so for simple applications and learning purpose its the best !

I downloaded latest flex sdk (version 4) from here and after a lots of google and struggle i found a simple way to compile and run flex apps.

extract the files to somewhere like your documents folder and give it a simple name(flex_sdk_4)

prepare the commands
export FLEX_SDK_HOME=/home/piyush/development/flex_sdk_4 (set this sdk home path)

and

alias mxmlc='/usr/lib/jvm/jre-1.6.0/bin/java -jar "$FLEX_SDK_HOME/lib/mxmlc.jar" +flexlib="$FLEX_SDK_HOME/frameworks" "$@"'

here /usr/lib/jvm/jre-1.6.0/bin/java is the path to java command, just find it in /usr/lib/jvm

and after you edited the paths run the above commands one by one
now we are all set to compile mxml apps :)

to check type mxmlc and if it shows following message then congrats


Loading configuration file /home/piyush/development/flex_sdk_4/frameworks/flex-config.xml
Adobe Flex Compiler (mxmlc)
Version 4.0.0 build 11120
Copyright (c) 2004-2009 Adobe Systems, Inc. All rights reserved.

Error: a target file must be specified

Use 'mxmlc -help' for information about using the command line.


be smart and go through help !!

or

to compile an mxml file give this command

mxmlc test.mxml

here text.mxml contains ur flex/mxml code !!

If u dont got java support then mxmlc will show errors ...

enjoy !!

related links :
http://asantoso.wordpress.com/2008/05/18/flex-3-sdk-command-line-development-with-example-on-linux/