Flex is a powerful SDK that allows you to build Flash applications that can then be embedded into any web page. The SDK is that Flex uses quite large and covers a whole range of things from interface controls to data processing. To program in Flex you need to use ActionScript 3. What Flex creates as output is swf files, which can be run separately or embedded into a web page.
To get started you will need the Flex SDK. Download the Flex SDK 3 zip file and extract it into a directory where you can get to it. As an example, I put mine in C:\dev\flex_sdk_3.
Next, you will need something to compile your SDK applications. You could use the Adobe Flex Builder application, but since this is a commercial product it will set you back quite a bit of money. A very good alternative is to use FlashDevelop, which is a free, open source, Flex IDE. I have used it quite extensively and it definitely does the job.
Download FlashDevelop from the site and install it. You will then need to point FlashDevelop to your Flex SDK files. To do this run the IDE and go to Tool->Program Settings, you can also press F10 to get the same menu up. Click on AS3Context in the left hand menu and enter the path to the Flex SDK directory in the Flex SDK Location box. The screenshot below has the dialog box you need open, with the appropriate box filled in.
You will now need to create a new Flex 3 project, which will use the correct Flex SDK to create your application. To do this click on Project in the menu and then click New Project..., which will open a dialog. Scroll down this dialog until you find the section marked ActionScript 3, and select Flex 3 Project. Next, enter a name for your project, define a location and click OK.
This will create a directory in the place you stipulated that contains three folders (bin,obj and src) and a file called your_project_name.as3proj. The folder src will contain a file called Main.mxml, which is the name application file that controls everything else.
One final thing you will need is a special version of Flashplayer that will send messages back to your IDE. This is called the Flash debugging version is available from the Adobe website.
You will now need to point FlashDevelop at the debugging version of Flash. Unzip the file that you have downloaded from Adobe (which should be something like sa_flashplayer_9_debug.exe) and place it into a directory that you can get hold of. I put this file into the same folder as before (so as to keep everything in one place). Next open up the options menu again and go to the FlashViewer option in the left menu. Enter the file that you have downloaded.
So what next? Well I over the next few posts I am going to run through how to create simple applications and also how to solve some common problems that I have encountered whilst using Flex.
Add new comment