First of all go and download Flex 4 SDK from Adobe Opensource Pages. Install downloaded files somewhere on your hard drive C:\flex4sdk for example. Set path to this folder. Right click on My Computer icon, go to Advanced tab and click on Environment Variables. In System variables list choose path, click edit and add path to newly created folder to the end of line. Go to Command Prompt and test your work with compc -version command.
You will also need FlashDevelop from their site, downloaded and installed. I have 3.0.6 RTM running, but more recent version is now available. Simple HelloWorld AS3 Project is enough to see if everything is OK.
I got following error after I tried to compile my project: 'C:\Documents and Settings\[USER]\My Documents\FDProjects\HelloWorld\HelloWorld.as: Warning: This compilation unit did not have a factoryClass specified in Frame metadata to load the configured runtime shared libraries. To compile without runtime shared libraries either set the -static-link-runtime-shared-libraries option to true or remove the -runtime-shared-libraries option.'
In order to solve this problem, right click on project name, open Properties and choose Compiler Options. Within Additional Compiler Options add this line: -static-link-runtime-shared-libraries=true (see image). This will solve warning issue.
So, there you have it, basic setup of Flex 4 SDK and FlashDevelop. If you like this post leave comment or share. Thanks.