Using Flex SDK on mac
Adobe recently made Flex opensource. That mean that you don’t have to use their Flex Builder in order to make Flex-apps.
This is a quick intro in how to use Flex with Textmate on mac.
Download the Flex SDK
You can download the Flex SDK from Adobe’s site. Place it whereevery you want, but be sure to make it available in your Path:
/Users/gerhard/.bashrc
export PATH; PATH="/Developer/SDKs/air_sdk/bin/:/Developer/SDKs/flex_sdk_3/bin/:/Developer/Tools:/Developer/Applications:/usr/local/bin:/usr/local/subversion/bin:$PATH"<br>alias flex="mxmlc"
I also added a alias for the compiler, located inside the bin/ dir of the SDK.
Download the TextMate bundle for AS3 and Flex
The ActionScript 3 Bundle and the Flex Bundle can be downloaded from TextMates Repository at: http://macromates.com/svn/Bundles/trunk/Review/Bundles/ (Use the SvnX app for mac to access these). Install this and you are ready to start developing in Flex.
Mini tutorial – your first Flex-app with TextMate
Create a new file in TextMate, and name it FlexTest1.mxml:
<?xml version="1.0"?> <br><!-- mxml/TriggerCodeExample.mxml --> <br><mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"><br> <mx:Panel title="My Application" <br> paddingTop="10" <br> paddingBottom="10" <br> paddingLeft="10" <br> paddingRight="10" <br> > <br> <mx:TextArea id="textarea1"/> <br> <mx:Button label="Submit" click="textarea1.text='Hello World';"/> <br> </mx:Panel> <br></mx:Application> <br>
The ActionScript 3 bundle will provide you with a buildin “Build (mxmlc)” command, but I prefer just compiling the files direct with Terminal.app:
gersh:~/Desktop/Adobe Flex/HelleWorldFlex gerhard$ mxmlc FlexTest1.mxml<br>Loading configuration file /Developer/SDKs/flex_sdk_3/frameworks/flex-config.xml<br>/Users/gerhard/Desktop/Adobe Flex/HelleWorldFlex/FlexTest1<br>.swf (164508 bytes)<br>gersh:~/Desktop/Adobe Flex/HelleWorldFlex gerhard$
If you have installed the last version of flash-player you will be able to open the .swf file in Finder.