<?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>Kris Range</title>
	<atom:link href="http://blog.krisrange.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.krisrange.com</link>
	<description>Web development</description>
	<lastBuildDate>Fri, 16 Sep 2011 15:23:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>MVC experiment in JS</title>
		<link>http://blog.krisrange.com/2011/09/mvc-experiment-in-js/</link>
		<comments>http://blog.krisrange.com/2011/09/mvc-experiment-in-js/#comments</comments>
		<pubDate>Tue, 13 Sep 2011 17:38:12 +0000</pubDate>
		<dc:creator>krange</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[experiment]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[mvc]]></category>
		<category><![CDATA[puremvc]]></category>

		<guid isPermaLink="false">http://blog.krisrange.com/?p=139</guid>
		<description><![CDATA[The past 3 years I&#8217;ve been using PureMVC pretty consistently in both my ActionScript and Objective-C projects. I&#8217;ve really enjoyed it&#8217;s workflow but when looking into the JavaScript port, was not interested in the dependencies required by the different JS ports (mootools, extjs or prototype). So, this weekend I spent some time in a local [...]]]></description>
			<content:encoded><![CDATA[<p>The past 3 years I&#8217;ve been using PureMVC pretty consistently in both my ActionScript and Objective-C projects. I&#8217;ve really enjoyed it&#8217;s workflow but when looking into the JavaScript port, was not interested in the dependencies required by the different JS ports (mootools, extjs or prototype). So, this weekend I spent some time in a local cafe here in Stockholm experimenting with creating a small MVC framework of my own in JavaScript.</p>
<p>I set out a few goals for myself:</p>
<ol>
<li>A similar workflow to my usual process. In AS3, for example, I use a quality plug-in called <a title="Fabrication" href="http://code.google.com/p/fabrication/" target="_blank">Fabrication</a>, which simplifies a few of the more medial tasks which occur in PureMVC.</li>
<li>As few or no dependencies required</li>
<li>Minimal size impact</li>
</ol>
<p>What came out of this with was <a title="&quot;JS-MVC&quot;" href="https://github.com/krange/JS-MVC" target="_blank">JS-MVC</a>. Since it is only an experiment, the naming is quite generic <img src='http://blog.krisrange.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  but I think the outcome was quite successful. I put up some quick documentation on github if you are interested in reading more.</p>
<p>The successes from the experiment were the following:</p>
<ul>
<li>It&#8217;s format is very similar to PureMVC. There exists a Facade, Commands, Models and Mediators. I renamed Notifications to Messages. Much easier to type.</li>
<li>I also included some of the features provided by Fabrication. Two examples were the mediator message interest function shortcuts &#8220;respondTo + {MSG_NAME}&#8221; and sugar methods for registering, removing, and retrieving other framework actors.</li>
<li>Total file size compressed and minimized was 5.7kb, which is a good chunk less than PureMVC + mootools minimized.</li>
<li>I ended up with only 1 dependency, which was John Resig&#8217;s <a href="http://ejohn.org/blog/simple-javascript-inheritance" target="_blank">Simple JavaScript Inheritence</a> class. It looked like the best choice for the experiment.</li>
</ul>
<p>The things I really ended up not happy with were:</p>
<ul>
<li>Not being able to fit in multi-core and module functionality into the experiement, but eventually continuing this further could lead to those additions.</li>
<li>No unit-testing. Not really in the scope of the experiment but would have been a real nice addition.</li>
<li>Not doing these sort of experiments before!</li>
</ul>
<div>Link to the github repository: <a href="https://github.com/krange/JS-MVC" target="_blank">https://github.com/krange/JS-MVC</a></div>
]]></content:encoded>
			<wfw:commentRss>http://blog.krisrange.com/2011/09/mvc-experiment-in-js/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Three20 iOS ad-hoc distribution issues</title>
		<link>http://blog.krisrange.com/2010/11/three20-ios-ad-hoc-distribution-issues/</link>
		<comments>http://blog.krisrange.com/2010/11/three20-ios-ad-hoc-distribution-issues/#comments</comments>
		<pubDate>Thu, 04 Nov 2010 07:27:15 +0000</pubDate>
		<dc:creator>krange</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[ios]]></category>
		<category><![CDATA[objectivec]]></category>
		<category><![CDATA[three20]]></category>

		<guid isPermaLink="false">http://blog.krisrange.com/?p=111</guid>
		<description><![CDATA[There are a few important things to remember when deploying an ad-hoc distribution application with the Three20 library to an iDevice. This took me a few hours to figure out so hopefully it saves time for someone else! If you get &#8220;Three20.h No such file or directory error.&#8221; errors during your build, make sure you [...]]]></description>
			<content:encoded><![CDATA[<p>There are a few important things to remember when deploying an ad-hoc distribution application with the Three20 library to an iDevice. This took me a few hours to figure out so hopefully it saves time for someone else!</p>
<ol>
<li>If you get &#8220;Three20.h No such file or directory error.&#8221; errors during your build, make sure you go to your Three20 library on your local machine and copy the &#8220;Build/Products/Release-iphoneos&#8221; folder and rename it to &#8220;Distribution-iphoneos&#8221;. This folder doesn&#8217;t seem to be included when you download the library and should solve this issue.</li>
<li>If your application is crashing on an iDevice in sections where Three20 is used but works fine in Debug mode, take a look at your distribution build configuration and make sure the following values are set in &#8220;Other Linker Flags&#8221; section. The values were missing from my Release configuration and your application will build completely fine without these values but will crash hard when running it on an iDevice.
<pre>
-all_load
-ObjC
</pre>
</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://blog.krisrange.com/2010/11/three20-ios-ad-hoc-distribution-issues/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Facebook Graph API library for ActionScript 3</title>
		<link>http://blog.krisrange.com/2010/09/facebook-graph-library-for-actionscript-3/</link>
		<comments>http://blog.krisrange.com/2010/09/facebook-graph-library-for-actionscript-3/#comments</comments>
		<pubDate>Sat, 04 Sep 2010 09:03:37 +0000</pubDate>
		<dc:creator>krange</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[graph]]></category>

		<guid isPermaLink="false">http://blog.krisrange.com/?p=101</guid>
		<description><![CDATA[The company I work for just released an open-source ActionScript 3 library for the Facebook Graph APIs! This library simplifies the creation and acquisition of data from the Facebook Graph API, as well as the expectation of returned data in a consistent and strongly-typed format. This includes, but not limited to, retrieving and posting on [...]]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://www.dareville.com/">company</a> I work for just released an open-source <a href="http://github.com/Dareville/Facebook-Graph">ActionScript 3 library for the Facebook Graph APIs</a>!</p>
<p>This <a href="http://github.com/Dareville/Facebook-Graph">library</a> simplifies the creation and acquisition of data from the Facebook Graph API, as well as the expectation of returned data in a consistent and strongly-typed format. This includes, but not limited to, retrieving and posting on users’ wall feeds, creating and retrieving events and event statuses, posting comments, searching content and much more!</p>
<p>It does not provide login authentication as there are many other libraries available for this purpose and really…why re-invent the wheel? Some great examples are from <a href="http://www.bigspaceship.com/blog/labs/bss-classes-flash-and-the-fb-graph/">Big Spaceship</a> and <a href="http://blog.yoz.sk/2010/05/facebook-graph-api-and-oauth-2-and-flash/">Jozef Chúťka</a>.</p>
<p>There is some functionality that has not yet been implemented (places, inbox, send email, etc) but our intent is to include them as soon as possible. If you are interested in contributing, please do so with our repository on <a href="http://github.com/Dareville/Facebook-Graph">Github</a>!</p>
<h3>Syntax</h3>
<p>Once you have acquired your <code>access_token</code> from Facebook, you can call any one of the services provided by the API. Keep in mind that you may need to have already prompted the user with specific permissions during the authentication step in order for methods to return data properly. <a href="http://developers.facebook.com/docs/authentication/permissions">See more on Facebook extended permissions</a>.</p>
<p>Almost every method that you can call with these services, dispatches a <a href="http://github.com/robertpenner/as3-signals">Signal</a> upon completion or failure. For full documentation and more information on the signals dispatched, please visit our <a href="http://labs.dareville.com/api/facebookgraph/asdoc/">ASDoc</a></p>
<p>Executing a service is as simple as the following:</p>
<pre>
var service : FacebookUserService = new FacebookUserService();
service.getNewsFeed( access_token );
</pre>
<p>Listening for the response is just as easy, especially if you are familiar with Signals. Add a listener to the signal and create your responder method. Each method is documented in our <a href="http://labs.dareville.com/api/facebookgraph/asdoc/">ASDocs</a> with the provided parameter reteurned.</p>
<pre>service.newsFeedLoaded.addOnce( onNewsFeedLoaded );
function onNewsFeedLoaded( vo : FacebookFeedCollectionData ):void
{
}
</pre>
<h3>Examples</h3>
<h4>Post on current logged in users’ wall</h4>
<pre>var post : FacebookFeedCreatePostData = new FacebookFeedCreatePostData( msg, link, icon );

var service : FacebookUserService = new FacebookUserService();
service.wallPostCreated.addOnce( onWallPostCreated );
service.createWallPost( access_token, FacebookConstants.CONNECTION_ME, post );

function onWallPostCreated( post_id : String ):void
{
}
</pre>
<h4>Get wall post comments</h4>
<pre>var service : FacebookCommentService = new FacebookCommentService();
service.commentsLoaded.addOnce( onCommentsLoad );
service.getComments( access_token, post_id );

function onCommentsLoad( vo : FacebookCommentCollectionData ) : void
{
}
</pre>
<h4>Upload a photo</h4>
<pre>var source : ByteArray = jpg.encode( bmd );
var photo : FacebookPhotoCreateData = new FacebookPhotoCreateData(
&amp;quot;Photo caption&amp;quot;, source );

var service : FacebookPhotoService = new FacebookPhotoService();
service.photoCreated.addOnce( onPhotoCreated );
service.createPhoto( access_token, photo, FacebookConstants.CONNECTION_ME );

function onPhotoCreated( id : String ):void
{
}
</pre>
<p>Check out our blog post as well as our Github and ADDocs:</p>
<p><a href="http://www.dareville.com/post/facebook-graph-as3-api-give-that-baby-a-spin/">Dareville library for Facebook Graph APIs</a><br />
<a href="http://github.com/Dareville/Facebook-Graph">Github library</a><br />
<a href="http://labs.dareville.com/api/facebookgraph/asdoc/">ASDocs</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.krisrange.com/2010/09/facebook-graph-library-for-actionscript-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Throttle RTMP connections</title>
		<link>http://blog.krisrange.com/2010/08/throttle-rtmp-connections/</link>
		<comments>http://blog.krisrange.com/2010/08/throttle-rtmp-connections/#comments</comments>
		<pubDate>Mon, 02 Aug 2010 17:46:38 +0000</pubDate>
		<dc:creator>krange</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[flash video]]></category>
		<category><![CDATA[ipfw]]></category>
		<category><![CDATA[rtmp]]></category>
		<category><![CDATA[throttle]]></category>

		<guid isPermaLink="false">http://blog.krisrange.com/?p=94</guid>
		<description><![CDATA[At work, we use Charles to throttle our connections while working locally to help test real life connections. Charles is an amazing program but the one thing that it doesn&#8217;t do is throttle RTMP connections (Flash streaming). If you ever need to throttle RTMP connections while debugging your Flash/Flex applications, here is nice code snippet [...]]]></description>
			<content:encoded><![CDATA[<p>At work, we use <a href="http://www.charlesproxy.com/">Charles</a> to throttle our connections while working locally to help test real life connections. Charles is an amazing program but the one thing that it doesn&#8217;t do is throttle RTMP connections (Flash streaming). If you ever need to throttle RTMP connections while debugging your Flash/Flex applications, here is nice code snippet that one of my coworkers found to do so. I&#8217;ve also converted here to a quick BASH script for OS X terminal. </p>
<p>It takes 2 parameters: First is the speed in kbytes; Second is the port to throttle (I usually just use 80)</p>
<pre>
throttle()
{
	sudo ipfw pipe 1 config bw $1KByte/s &amp;&amp;
	sudo ipfw add 1 pipe 1 src-port $2
}

rmthrottle()
{
	sudo ipfw delete 1
}
</pre>
<p>Example terminal output:</p>
<pre>
...$ throttle 150 80
Password:
00001 pipe 1 ip from any 80 to any
...$ rmthrottle
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.krisrange.com/2010/08/throttle-rtmp-connections/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Inserting keywords/variables in Subversion with auto-props</title>
		<link>http://blog.krisrange.com/2010/07/inserting-keywordsvariables-in-subversion-with-auto_props/</link>
		<comments>http://blog.krisrange.com/2010/07/inserting-keywordsvariables-in-subversion-with-auto_props/#comments</comments>
		<pubDate>Sat, 10 Jul 2010 07:18:17 +0000</pubDate>
		<dc:creator>krange</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[auto_props]]></category>
		<category><![CDATA[subversion]]></category>

		<guid isPermaLink="false">http://blog.krisrange.com/?p=56</guid>
		<description><![CDATA[Spent a little time this week investing how to get keyword variables related to our Subversion repositories (version, last modified by, date, etc) automatically inserted into our code when we commit. My end goal was to have our code looking like the sample below with an initial comment header including our SVN information: /** * [...]]]></description>
			<content:encoded><![CDATA[<p>Spent a little time this week investing how to get keyword variables related to our Subversion repositories (version, last modified by, date, etc) automatically inserted into our code when we commit. My end goal was to have our code looking like the sample below with an initial comment header including our SVN information:</p>
<pre>

/**
 * ------------------------------------------------------------
 * Copyright (c) 2010 Some Company.
 * This software is the proprietary information of Some Company
 * All Right Reserved.
 * ------------------------------------------------------------
 *
 * SVN revision information:
 * @version $Revision: 82 $:
 * @author	$Author: kris $:
 * @date	$Date: 2010-07-10 08:36:02 +0200 (Sat, 10 Jul 2010) $:
 */
package com.somecompany.common.somepackage
{
	import flash.display.MovieClip;

	/**
	 * SomeClass description
	 *
	 * @author krisrange
	 */
	public function SomeClass
		extends MovieClip
	{
		/**
		 * Constructor
		 */
		public function SomeClass()
		{
			super();
		}
	}
}
</pre>
<p>As you can see, the SVN revision version, last modified author and last modified date show up in our headers. This is really important as a developer can look at the header and quickly know who last modified the file and who to talk to in case the initial author of the file may not be the developer who last updated functionality.</p>
<p>I will be writing this from the perspective of working on MacOS but most of this information is transferrable directly to a Windows machine except a few things like directory structures.</p>
<p>We need to make sure that files are setup to have their properties changed. The best thing to do is to change this globally for new files/repositories and then go back into any previous projects you have worked on and recursively loop through and add this functionality. </p>
<h3>Modifying the Global Setting:</h3>
<p>On MacOS, go into your home directory and open the &#8220;Config&#8221; file that lives in the hidden folder &#8220;.subversion&#8221;. Once you have this text file opened, uncomment the &#8220;enable_auto_props&#8221; variable in the &#8220;[miscellany]&#8221; section and set it&#8217;s value to &#8220;yes&#8221;. Then add the file types you would like include in the &#8220;[auto-props]&#8221; section with the value of &#8220;svn:keywords=Date Revision Author Id&#8221;. See sample below where I&#8217;ve set auto_props to modify all *.as and *.mxml files:</p>
<pre>
[miscellany]
### Automatic properties are defined in the section 'auto-props'.
enable-auto-props = yes

### Section for configuring automatic properties.
[auto-props]
*.as = svn:keywords=Date Revision Author Id
*.mxml = svn:keywords=Date Revision Author Id
</pre>
<h3>Modifying Previous Projects</h3>
<p>In order for previous projects to gain access to this information, we need to set the properties on all the files we have already committed to set the properties on themselves when they are committed into our repositories. To do this, just type the following command for every file type that you want to have auto_props enabled for.</p>
<pre>
find * -type f -name '*.as' -exec svn propset svn:keywords &quot;Date Revision Author Id&quot; {}  \;
</pre>
<h3>Getting the Values to Show Up</h3>
<p>After that is all setup, just insert the values in your document based on the corresponding ID. So for example, if you wanted to insert the Last Modified Author, insert it like below and SVN will replace the content inbetween the word &#8220;Author&#8221; and &#8220;$:&#8221; with the actual value:</p>
<pre>
$Author: $:
</pre>
<p>For more information on what keywords/properties are available, there is good <a href="http://svnbook.red-bean.com/en/1.4/svn.advanced.props.special.keywords.html">documentation from Subversion</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.krisrange.com/2010/07/inserting-keywordsvariables-in-subversion-with-auto_props/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Spotify url validation</title>
		<link>http://blog.krisrange.com/2010/05/spotify-url-validation/</link>
		<comments>http://blog.krisrange.com/2010/05/spotify-url-validation/#comments</comments>
		<pubDate>Mon, 31 May 2010 06:28:13 +0000</pubDate>
		<dc:creator>krange</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[spotify]]></category>
		<category><![CDATA[validation]]></category>

		<guid isPermaLink="false">http://blog.krisrange.com/?p=43</guid>
		<description><![CDATA[I created this class for a project I am working on where I need to validate Spotify playlist and track URLs. I hope someone will get some use out of it or maybe improve it. It provides two static methods for validating and allows you to specify the return type which currently is a HTTP [...]]]></description>
			<content:encoded><![CDATA[<p>I created this class for a project I am working on where I need to validate Spotify playlist and track URLs. I hope someone will get some use out of it or maybe improve it. It provides two static methods for validating and allows you to specify the return type which currently is a HTTP or Spotify URL format.</p>
<p><a href="http://www.krisrange.com/code/SpotifyUtil.as">SpotifyUtil</a></p>
<p>Here is an example of how to use the method which will convert the link variable below to &#8220;spotify:user:user_name:playlist:3WbWswJtOPIdKBQmZs9pGr&#8221;:</p>
<pre>
var link : String = &quot;http://open.spotify.com/user/user_name/playlist/3WbWswJtOPIdKBQmZs9pGr&quot;;

var validUrl : String = SpotifyUtil.validatePlaylist( link, SpotifyUtil.URL_FORMAT_SPOTIFY );

if( validUrl )
{
	trace( link );
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.krisrange.com/2010/05/spotify-url-validation/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>ANT with JavaScript</title>
		<link>http://blog.krisrange.com/2010/05/ant-with-javascript/</link>
		<comments>http://blog.krisrange.com/2010/05/ant-with-javascript/#comments</comments>
		<pubDate>Thu, 20 May 2010 16:55:49 +0000</pubDate>
		<dc:creator>krange</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[ant]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://blog.krisrange.com/?p=26</guid>
		<description><![CDATA[Recently at work we had the need to build an application that could both be run over the network and on the local filesystem. Well, this doesn&#8217;t work with the Flash security setup as SWF files can only be run on one or the other. Like many other developers, we use ANT to build our [...]]]></description>
			<content:encoded><![CDATA[<p>Recently at work we had the need to build an application that could both be run over the network and on the local filesystem. Well, this doesn&#8217;t work with the Flash security setup as SWF files can only be run on one or the other. Like many other developers, we use ANT to build our projects and would like setting this property to be built into our build files. The SDK compiler has a nice property called &#8220;use-network&#8221; which can easily be set to true or false depending on your need which solves this situation nicely. The problem we ran into was with ANT and dealing with IF/ELSE target statements.</p>
<p>What we wanted to do was to use the same build SWF targets but for both situations without having to modify our process. Our solution was a nifty trick that used JavaScript inside ANT. I had never seen this technique before but some searching for a solution led us in this direction.</p>
<p>As you can see below, we have two initial targets, one which builds for local file system and one which builds for network use. We can then run either target first, which sets a property in our ANT file and then run our normal SWF build targets as normal, with this property set to the &#8220;use-network&#8221; property. Really looking forward to exploring some more complexities with JavaScript integration (as well as other languages from what I&#8217;ve read).</p>
<pre>
&lt;target name=&quot;compile_local&quot;&gt;
	&lt;script language=&quot;javascript&quot;&gt;
	&lt;![CDATA[
		presenter.setProperty( &quot;use-network&quot;, &quot;false&quot; );
	]]&gt;
	&lt;/script&gt;
&lt;/target&gt;
&lt;target name=&quot;compile_network&quot;&gt;
	&lt;script language=&quot;javascript&quot;&gt;
	&lt;![CDATA[
		presenter.setProperty( &quot;use-network&quot;, &quot;true&quot; );
	]]&gt;
	&lt;/script&gt;
&lt;/target&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.krisrange.com/2010/05/ant-with-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Just launched SNOOP420.COM</title>
		<link>http://blog.krisrange.com/2010/04/just-launched-snoop420-com/</link>
		<comments>http://blog.krisrange.com/2010/04/just-launched-snoop420-com/#comments</comments>
		<pubDate>Tue, 20 Apr 2010 21:28:23 +0000</pubDate>
		<dc:creator>krange</dc:creator>
				<category><![CDATA[launch]]></category>
		<category><![CDATA[420]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[snoop]]></category>

		<guid isPermaLink="false">http://blog.krisrange.com/?p=20</guid>
		<description><![CDATA[Check it out! Props go out to our team for all the work that went into it! SNOOP 4:20]]></description>
			<content:encoded><![CDATA[<p>Check it out! Props go out to our team for all the work that went into it!</p>
<p><a href="http://www.snoop420.com/">SNOOP 4:20</a></p>
<p><img src="http://media.tumblr.com/tumblr_l172aeLbmD1qa1ofo.jpg" alt="" /></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.krisrange.com/2010/04/just-launched-snoop420-com/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bay Area: See you in less than 24 hours!</title>
		<link>http://blog.krisrange.com/2010/04/bay-area-see-you-in-less-than-24-hours/</link>
		<comments>http://blog.krisrange.com/2010/04/bay-area-see-you-in-less-than-24-hours/#comments</comments>
		<pubDate>Fri, 02 Apr 2010 21:30:17 +0000</pubDate>
		<dc:creator>krange</dc:creator>
				<category><![CDATA[travel]]></category>
		<category><![CDATA[los angeles]]></category>
		<category><![CDATA[san francisco]]></category>
		<category><![CDATA[snoop]]></category>
		<category><![CDATA[stockholm]]></category>

		<guid isPermaLink="false">http://blog.krisrange.com/?p=22</guid>
		<description><![CDATA[Taking a quick break from Stockholm these next few days to do some work in San Francisco and Los Angeles.]]></description>
			<content:encoded><![CDATA[<p>Taking a quick break from Stockholm these next few days to do some work in San Francisco and Los Angeles.</p>
<p><img src="http://media.tumblr.com/tumblr_l09egrmYrC1qa1ofo.jpg" alt="" /></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.krisrange.com/2010/04/bay-area-see-you-in-less-than-24-hours/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Inserting build version numbers into Flash and Flex Applications</title>
		<link>http://blog.krisrange.com/2010/04/inserting-build-version-numbers-into-flash-and-flex-applications/</link>
		<comments>http://blog.krisrange.com/2010/04/inserting-build-version-numbers-into-flash-and-flex-applications/#comments</comments>
		<pubDate>Thu, 01 Apr 2010 09:16:12 +0000</pubDate>
		<dc:creator>krange</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[ant]]></category>
		<category><![CDATA[flex]]></category>

		<guid isPermaLink="false">http://blog.krisrange.com/?p=12</guid>
		<description><![CDATA[For an ActionScript project I am currently working on (and for future projects), we wanted to be able to include the ANT build number into our applications when we do development and production quality releases to clients. The added value in this is that it is extremely helpful if you are constently pushing releases. It [...]]]></description>
			<content:encoded><![CDATA[<p>For an ActionScript project I am currently working on (and for future projects), we wanted to be able to include the ANT build number into our applications when we do development and production quality releases to clients. The added value in this is that it is extremely helpful if you are constently pushing releases. It saves time so that we can easily tell what version our clients are running on their development and production servers. This helps avoid unneeded debugging time making sure that the versions are correct. We also wanted this to happen automatically, or as much as possible, without the need for us to modify text files or add compiler variables.</p>
<p>Ok, lets get started! First, all of these instructions assumes you have a good knowledge in how ANT works. It also assumes you will be building an ActionScript or Flex project. In this case, we are going to be creating a custom ContextMenu but you can really do this for anything. This will allow anyone us to see the version numbers when they right click on our application.</p>
<p>Ok, so how is this done? Open up your build.properties file for the project and add the following lines:</p>
<pre>
project.major	  = 1
project.minor     = 0
project.revision  = 0
project.version   = ${project.major}.${project.minor}.${project.revision}
</pre>
<p>The projet will act as our properties for figuring out the project major, minor and revision. These could probably be automated in some way but for now I am ok with manually setting these values since I will know when these versions change. We will also need to include a build number into our build so just add the following before anything else into your build file. Also note that if this file does not exist, ANT will create it for you so no need to concern yourself with what the contents are. Let ANT do the dirty work!</p>
<pre>
&lt;buildnumber file=&quot;${basedir}/build/build.number&quot; /&gt;
</pre>
<p>Next, we are going to want to copy our classes to a temporary directory so that we can modify them without harming the source. As you can see I have some temp.outdir and classes.dir properties</p>
<pre>

&lt;target name=&quot;copyClasses&quot; description=&quot;Creates a temporary directory where the code will be duplicated so we can modify and build without harming the original files&quot;&gt;
	&lt;mkdir dir=&quot;${temp.outdir}&quot; /&gt;
	&lt;copy todir=&quot;${temp.outdir}&quot;&gt;
		&lt;fileset dir=&quot;${classes.dir}&quot;/&gt;
	&lt;/copy&gt;
&lt;/target&gt;
</pre>
<p>Now that our classes are copied, we need to do a search on them for particular strings that we will end up replacing with the project version. In my case, I have a ContextMenu class which has a string value defined as &#8220;[PROJECT_VERSION_NUMBER]&#8221; so I do a regular expression replace in ANT to find that value and replace it.</p>
<pre>

&lt;target name=&quot;projectversion&quot; description=&quot;&quot;&gt;
	&lt;replaceregexp match=&quot;[PROJECT_VERSION_NUMBER]&quot; replace=&quot;${project.fullname} : ${project.version}.${build.number}&quot; flags=&quot;gs&quot;&gt;
		&lt;fileset dir=&quot;${temp.outdir}&quot; includes=&quot;**/*.as&quot;/&gt;
	&lt;/replaceregexp&gt;
&lt;/target&gt;
</pre>
<p>And that is it. Now we have our build number plus project version automatically showing up in our application.</p>
<div style="text-align: center;"><img src="http://media.tumblr.com/tumblr_l0792hZFA61qa1ofo.png" alt="" /></div>
]]></content:encoded>
			<wfw:commentRss>http://blog.krisrange.com/2010/04/inserting-build-version-numbers-into-flash-and-flex-applications/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

