Jul 30 2008

Using Flex Builder 3 to compile Flex 4 applications

Published by at 2:46 pm under Flex

Flex 4 SDK is available for download now, even though it will be a lot buggy i suppose, nevertheless i decided to play with it and try it out. Flex 4 applications work with Flash Player 10 only and I didn’t want to install it since it can’t co-exist with other FP versions. Also i love FB eclipse plugin and wanted to write Flex 4 code using that. Here is how i achieved my goal, 

 

PS: I am assuming that you are fairly familiar with Flex Builder or the Eclipse FB Plugin

 

Downloading the Flex SDK:

They have started releasing nightly builds of Flex SDK and i downloaded the latest one. Get it.

It doesn’t matter where you save the file. Once you download the file, go to your Eclipse Preferences and then in Flex Settings, select add this SDK. I keep Flex 3 as my default SDK and then we will choose this SDK specifically for Flex 4 projects.

 

Setting up a Project:

Create a standard Flex project as you would normally do in FB. Lets not worry about the main application file for now, first we need to change some settings for our project.

 

Right Click the Project and then select its properties. Go to Flex Compiler option and Select use a specific SDK. 

Choose Flex 4. Also I select the wrapper to have required player version to 10.0.0 even though i will be running swf directly. For my browsers the FP version is still 9.0.115.

I use the following sample code, it is taken from Adobe site,

 

 

<?xml version=”1.0″ encoding=”utf-8″?>

<Application xmlns=”http://ns.adobe.com/mxml/2009

             xmlns:mx=”library:adobe/flex/halo

             layout=”flex.layout.VerticalLayout” backgroundColor=”white

             width=”800” height=”600” xmlns:ns=”library:adobe/flex/gumbo” xmlns:skin=”flex.skin.*>

    <Ellipse width=”10” height=”10” y=”3>

        <fill>

            <mx:RadialGradient>

                <mx:GradientEntry color=”0xAAAAAA/>

                <mx:GradientEntry color=”0x336699/>

            </mx:RadialGradient>

        </fill>

    </Ellipse>

    <mx:Button label=”halo button/>

    <Button label=”gumbo button/>

</Application>

 

 

Note: This is all you have to do if you already have FP 10 installed. 

 

Since i don’t have FP 10, I just have to do a minor modification. FP 10 also comes bundled with your Flex SDK, if you look into flex_sdk_4/runtimes/player/mac, there should be a zip file. I have associated all the swf files with this app. So whenever i click on swf, it opens up with this version of Flash Player. 

 

We can do that change in our project by selecting the Run/Debug Settings for the project and then clicking the edit button.

if everything goes well the next time when you run this project, it will run in FP 10 application and you are all set for writing Flex 4 applications.

No responses yet

Trackback URI | Comments RSS

Leave a Reply