<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Floorplanner Tech Blog &#187; textmate actionscript flex sdk</title>
	<atom:link href="http://techblog.floorplanner.com/tag/textmate-actionscript-flex-sdk/feed/" rel="self" type="application/rss+xml" />
	<link>http://techblog.floorplanner.com</link>
	<description>Our latest geek adventures!</description>
	<lastBuildDate>Tue, 16 Mar 2010 18:45:44 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Build ActionScript3 projects with TextMate in 5 easy steps</title>
		<link>http://techblog.floorplanner.com/2009/09/05/build-actionscript3-projects-with-textmate-in-5-easy-steps/</link>
		<comments>http://techblog.floorplanner.com/2009/09/05/build-actionscript3-projects-with-textmate-in-5-easy-steps/#comments</comments>
		<pubDate>Sat, 05 Sep 2009 11:51:34 +0000</pubDate>
		<dc:creator>Gert-Jan van der Wel</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Flash+ActionScript]]></category>
		<category><![CDATA[textmate actionscript flex sdk]]></category>

		<guid isPermaLink="false">http://techblog.floorplanner.com/?p=704</guid>
		<description><![CDATA[The text editor of choice of our Rails team is TextMate. Our Flash team is a bit divided between Eclipse+FDT and FlexBuilder. I wanted to see if TextMate is a good alternative for building Flash/ActionScript projects.
There are a couple of good sources on using TexMate for ActionScript projects, but it&#8217;s a little fragmented and sometimes [...]]]></description>
			<content:encoded><![CDATA[<p>The text editor of choice of our Rails team is TextMate. Our Flash team is a bit divided between Eclipse+FDT and FlexBuilder. I wanted to see if TextMate is a good alternative for building Flash/ActionScript projects.</p>
<p>There are a couple of good sources on using TexMate for ActionScript projects, but it&#8217;s a little fragmented and sometimes outdated. I found <a href="http://www.pixelate.de/blog/setting-up-a-as3-project-in-textmate">pixelate&#8217;s blog post</a> and <a href="http://blog.simongregory.com/">Simon&#8217;s blog</a> very useful.</p>
<h3>1. TextMate</h3>
<p>First of all, you need have MacroMates&#8217; <a href="http://macromates.com/">TexMate</a> of course. If you don&#8217;t already own a copy, you can download a <a href="http://download-b.macromates.com/TextMate_1.5.9.dmg">30-day-trial</a>.</p>
<h3>2. ActionScript3 bundle</h3>
<p><a href="http://blog.simongregory.com/">Simon Gregory</a> did some fine work by creating a TextMate bundle for ActionScript3. The most important things that the bundle handles are <a href="http://blog.simongregory.com/09/as3-autocompletion-in-textmate/">auto-completion</a> and <a href="http://blog.simongregory.com/02/improved-auto-import-for-actionscript-3-in-textmate/">auto-import</a>.  You can <a href="http://blog.simongregory.com/wp-content/assets/bundles/ActionScript%203.tmbundle.zip">download it</a> directly from his blog, or fetch it with Git or SVN.</p>
<p>To install via Subversion:</p>

<div class="wp_syntax"><div class="code"><pre class="console" style="font-family: Monaco,monospace;">export LC_CTYPE=en_US.UTF-8
cd ~/&quot;Library/Application Support/TextMate/Bundles/&quot;
svn co http://svn.textmate.org/trunk/Review/Bundles/ActionScript\ 3.tmbundle
osascript -e 'tell app &quot;TextMate&quot; to reload bundles'</pre></div></div>

<p>To install via Git:</p>

<div class="wp_syntax"><div class="code"><pre class="console" style="font-family: Monaco,monospace;">cd ~/&quot;Library/Application Support/TextMate/Bundles/&quot;
git clone git://github.com/simongregory/actionscript3-tmbundle.git &quot;ActionScript 3.tmbundle&quot;
osascript -e 'tell app &quot;TextMate&quot; to reload bundles'</pre></div></div>

<h3>3. Flex SDK</h3>
<p>The actual building of your project is done by the free <a href="http://www.adobe.com/cfusion/entitlement/index.cfm?e=flexbuilder3&#038;promoid=DJGYF">Flex 3 SDK</a>. Download it and move the extracted folder into your /Developer/SDKs/ folder. The SDK has to be accessible throughout your whole system. You can do this by adding it to the PATH variable in the /etc/profile file. Open terminal and type:</p>

<div class="wp_syntax"><div class="code"><pre class="console" style="font-family: Monaco,monospace;">sudo mate /etc/profile</pre></div></div>

<p>Then add the folder &#8220;/Developers/SDKs/flex_sdk_3/bin&#8221; to the file and save it. It should look something like this:</p>

<div class="wp_syntax"><div class="code"><pre class="console" style="font-family: Monaco,monospace;">PATH=&quot;/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/mysql/bin:/Developer/SDKs/flex_sdk_3/bin&quot;</pre></div></div>

<h3>4. TextMate settings</h3>
<p>Before we can start the ActionScript fun we have to setup a few things in TextMate. Open TextMate and select File→New Project. Click on the info button located in the bottom of the Project Drawer. Add two shell variables so that the ActionScript Bundle knows where to look for your files:</p>

<div class="wp_syntax"><div class="code"><pre class="console" style="font-family: Monaco,monospace;">TM_FLEX_FILE_SPECS    src/Main.as
TM_FLEX_OUTPUT        bin/Main.swf</pre></div></div>

<p>We also need to let TextMate know where the Flex SDK is located. Go to TextMate→Preferences→Advanced→Shell Variables and add a new global variable:</p>

<div class="wp_syntax"><div class="code"><pre class="console" style="font-family: Monaco,monospace;">TM_FLEX_PATH    Developer/SDKs/flex_sdk_3</pre></div></div>

<h3>5. Hello World</h3>
<p>With all that out of the way, we can finally start working on a ActionScript project: Hello World. Create a folder on your system that will hold this project. Drag this folder to TextMate&#8217;s Project Drawer. Create two new folders named bin and src in your project folder. Then create a new file in the src folder and name it Main.as. It should look something like this:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family: Monaco,monospace;">package <span style="color: #66cc66;">&#123;</span>        
    <span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #006600;">Sprite</span>;
    <span style="color: #0066CC;">import</span> flash.<span style="color: #0066CC;">text</span>.<span style="color: #0066CC;">TextField</span>;
&nbsp;
    <span style="color: #66cc66;">&#91;</span>SWF<span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">backgroundColor</span>=<span style="color: #ff0000;">'0xFFFFFF'</span>, frameRate=<span style="color: #ff0000;">'30'</span>, <span style="color: #0066CC;">width</span>=<span style="color: #ff0000;">'200'</span>, <span style="color: #0066CC;">height</span>=<span style="color: #ff0000;">'200'</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#93;</span>
&nbsp;
    <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> Main <span style="color: #0066CC;">extends</span> Sprite <span style="color: #66cc66;">&#123;</span>
        <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">textField</span>: <span style="color: #0066CC;">TextField</span>;
&nbsp;
        <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> Main<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
            <span style="color: #0066CC;">textField</span> = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">TextField</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
            <span style="color: #0066CC;">textField</span>.<span style="color: #0066CC;">text</span> = <span style="color: #ff0000;">&quot;Hello World.&quot;</span>;
&nbsp;
            addChild<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">textField</span><span style="color: #66cc66;">&#41;</span>;
        <span style="color: #66cc66;">&#125;</span>        
    <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>Choose Bundles→ActionScript 3→Build to build your project. A terminal window pops up which runs the Flex SDK to build your project. You can find the resulting Main.swf file in your bin folder. Yay!</p>
<h3>Notes</h3>
<p>If you want to build Flash Player 10 specific stuff (like me) you have to let the Flex SDK know. Open /Developer/SDKs/flex_sdk_3/frameworks/flex-config.xml and set the target-player tag to 10.0.0</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family: Monaco,monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target-player<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>10.0.0<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target-player<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>The easiest way to work with libraries, the so called SWC files, in this setup is to drop them directly into /Developer/SDKs/flex_sdk_3/frameworks/libs folder. That way the Flex SDK has no problem finding them.</p>
]]></content:encoded>
			<wfw:commentRss>http://techblog.floorplanner.com/2009/09/05/build-actionscript3-projects-with-textmate-in-5-easy-steps/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
