Building your first Flex app without using FlexBuilder

One of the biggest news this week has been that Adobe has made FlexSDK opensource which is like yay! Well, the SDK has the compiler for the mxml and as code but the FlexBuilder does all this automatically for the user without her having to know the compiler commandline et al; but hoping that Adobe gives out the FlexBuilder to FOSS :D I know, i know we geeks can be greedy. Well.. I downloaded the FlexSDK yesterday, now that it was opensource and tried building my first application and guess what? Its very easy. Maybe thats because its the hello world program. Here’s how:

  • Download the SDK from here.
  • Unzip the SDK into a directory of your choice and for the sake of easy; add its bin directory to your path variable.
  • Now to writing your first helloworld program.
  • Most of the code is self explanatory; so I’ll skip the step of having to explain all that to you.
  • The code is as follows. See that you save it into helloworld.mxml
    <?xml version="1.0" encoding="utf-8"?>
    
    <mx:Application
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="absolute"
        backgroundGradientColors="{#ffffff, #ffffff}">
    <mx:Button
          label="Say Hello World"
          click="Alert.show('Hello World!')"
          height="75" width="186"
          horizontalCenter="0"
        verticalCenter="0"/>
    
    <mx:Script>
        <![CDATA[
             import mx.controls.Alert;
        ]]>
      </mx:Script>
    </mx:Application>
  • Compile this file now in the commandline using the command ‘mxmlc helloworld.mxml‘. An output swf file helloworld.swf is created!
  • Compile this file now in the commandline using the command ‘mxmlc helloworld.mxml‘. An output swf file helloworld.swf is created!
  • See how it works in your browser with the flash runtime installed!

Im really hoping I get enough time to try build a simple Eclipse based plugin for Flex using its SDK… Or are there projects already doing it?


About this entry