<?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>Oops... I think I just blogged</title>
	<atom:link href="http://blog.trevorboyle.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.trevorboyle.com</link>
	<description>A window into the warped mind of Trevor Boyle</description>
	<lastBuildDate>Thu, 03 Jun 2010 22:57:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>Belfast City Marathon</title>
		<link>http://blog.trevorboyle.com/2010/06/03/belfast-city-marathon/</link>
		<comments>http://blog.trevorboyle.com/2010/06/03/belfast-city-marathon/#comments</comments>
		<pubDate>Thu, 03 Jun 2010 22:57:24 +0000</pubDate>
		<dc:creator>TrevorB</dc:creator>
				<category><![CDATA[Sport]]></category>
		<category><![CDATA[Belfast]]></category>
		<category><![CDATA[Marathon]]></category>
		<category><![CDATA[Trevor Boyle]]></category>

		<guid isPermaLink="false">http://blog.trevorboyle.com/?p=192</guid>
		<description><![CDATA[On the 3rd of May 2010, I ran the Belfast City Marathon. It was hard work, but I got there in the end and even had enough energy left-over for a little heel click.]]></description>
			<content:encoded><![CDATA[<p>On the 3rd of May 2010, I ran the Belfast City Marathon. It was hard work, but I got there in the end and even had enough energy left-over for a little heel click.</p>
<p><object width="480" height="288"><param name="movie" value="http://www.youtube.com/v/XJXJFfz3f1s&#038;hl=en_GB&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/XJXJFfz3f1s&#038;hl=en_GB&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="false" width="480" height="288"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.trevorboyle.com/2010/06/03/belfast-city-marathon/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>@Tweetrise: Exploring the Twitter API and the Sunrise</title>
		<link>http://blog.trevorboyle.com/2010/06/03/tweetrise-exploring-the-twitter-api-and-the-sunrise/</link>
		<comments>http://blog.trevorboyle.com/2010/06/03/tweetrise-exploring-the-twitter-api-and-the-sunrise/#comments</comments>
		<pubDate>Thu, 03 Jun 2010 22:13:15 +0000</pubDate>
		<dc:creator>TrevorB</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Twitter]]></category>
		<category><![CDATA[Cron Job]]></category>
		<category><![CDATA[Sunrise]]></category>
		<category><![CDATA[Sunset]]></category>
		<category><![CDATA[Tweetrise]]></category>
		<category><![CDATA[Twitter API]]></category>

		<guid isPermaLink="false">http://blog.trevorboyle.com/?p=182</guid>
		<description><![CDATA[Back in April I thought I would spend some time re-familiarising myself with Twitter and the Twitter API. The project I decided to wrap this investigation in was Tweetrise, a twitter account that daily tweets the time of the sunrise &#8230; <a href="http://blog.trevorboyle.com/2010/06/03/tweetrise-exploring-the-twitter-api-and-the-sunrise/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Back in April I thought I would spend some time re-familiarising myself with Twitter and the <a href="http://apiwiki.twitter.com/" target="_blank">Twitter API</a>. The project I decided to wrap this investigation in was <a href="http://twitter.com/Tweetrise" target="_blank">Tweetrise</a>, a twitter account that daily tweets the time of the sunrise and sunset for the following day.</p>
<p>Working with the <a href="http://apiwiki.twitter.com/" target="_blank">Twitter API</a> was as easy as I remembered it, and getting it to run on a Cron Job on <a href="http://mediatemple.net/" target="_blank">MediaTemple</a> was also very straightforward. The difficulty, for me, was calculating the sunrise and sunset times.</p>
<p>I wanted times that were accurate and went to seconds, so that I could compare the difference of sunlight between days. Using the formulas provided by <a href="http://www.moonstick.com/sunriseset.htm" target="_blank">Moonstick Co.</a> I created the PHP functions which would allow me to get accurate results through interpolation. In regards to these calculations, apart from it being an interesting learning experience, it was a waste of time&#8230; <a href="http://php.net/manual/en/function.date-sunrise.php" target="_blank">PHP 5 date_sunrise</a> :-P</p>
<p><a href="http://twitter.com/Tweetrise_LDN"  target="_blank"><img src="http://blog.trevorboyle.com/wp-content/uploads/tweetrise-twitter-profile.png" alt="tweetrise-twitter-profile" title="tweetrise-twitter-profile" width="553" height="447" class="size-full wp-image-183" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.trevorboyle.com/2010/06/03/tweetrise-exploring-the-twitter-api-and-the-sunrise/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>FOTB09 &#8211; Elevator Pitch</title>
		<link>http://blog.trevorboyle.com/2010/04/12/fotb09-elevator-pitch/</link>
		<comments>http://blog.trevorboyle.com/2010/04/12/fotb09-elevator-pitch/#comments</comments>
		<pubDate>Mon, 12 Apr 2010 21:30:58 +0000</pubDate>
		<dc:creator>TrevorB</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Twitter]]></category>

		<guid isPermaLink="false">http://blog.trevorboyle.com/?p=163</guid>
		<description><![CDATA[Calling for &#8216;Flash on the Beach&#8217; speakers&#8230; http://www.flashonthebeach.com/participate/ Last year I had the opportunity to speak at &#8216;Flash on the Beach&#8217;. It was a great experience and I would encourage anyone to give it a go for 2010 (26th-29th of &#8230; <a href="http://blog.trevorboyle.com/2010/04/12/fotb09-elevator-pitch/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Calling for &#8216;Flash on the Beach&#8217; speakers&#8230; http://www.flashonthebeach.com/participate/</p>
<p>Last year I had the opportunity to speak at &#8216;Flash on the Beach&#8217;. It was a great experience and I would encourage anyone to give it a go for 2010 (26th-29th of April)!</p>
<p><object width="400" height="225"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=7306311&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=0&amp;show_portrait=0&amp;color=ffffff&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=7306311&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=0&amp;show_portrait=0&amp;color=ffffff&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="225"></embed></object>
<p><a href="http://vimeo.com/7306311">FOTB09 &#8211; Elevator Pitch &#8211; Trevor Boyle</a> from <a href="http://vimeo.com/flashonthebeach">John Davey</a> on <a href="http://vimeo.com">Vimeo</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.trevorboyle.com/2010/04/12/fotb09-elevator-pitch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rickshaw Run &#8211; Winter 2010 &#8211; Rickshawshank Redemption</title>
		<link>http://blog.trevorboyle.com/2010/04/12/rickshaw-run-winter-2010-rickshawshank-redemption/</link>
		<comments>http://blog.trevorboyle.com/2010/04/12/rickshaw-run-winter-2010-rickshawshank-redemption/#comments</comments>
		<pubDate>Mon, 12 Apr 2010 21:30:39 +0000</pubDate>
		<dc:creator>TrevorB</dc:creator>
				<category><![CDATA[Travel]]></category>
		<category><![CDATA[Adventurists]]></category>
		<category><![CDATA[Cochin]]></category>
		<category><![CDATA[India]]></category>
		<category><![CDATA[Nepal]]></category>
		<category><![CDATA[Pokhara]]></category>
		<category><![CDATA[Rickshaw]]></category>
		<category><![CDATA[Rickshawshank Redemption]]></category>

		<guid isPermaLink="false">http://blog.trevorboyle.com/?p=172</guid>
		<description><![CDATA[In January this year Amy, Keith and I travelled over 3000km&#8217;s from Pokhara, Nepal to Cochin, India in an Auto-Rickshaw, in 14 days, as part of The League of Adventurists Winter 2010 Rickshaw Run. Here is a short video of &#8230; <a href="http://blog.trevorboyle.com/2010/04/12/rickshaw-run-winter-2010-rickshawshank-redemption/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>In January this year Amy, Keith and I travelled over 3000km&#8217;s from Pokhara, Nepal to Cochin, India in an Auto-Rickshaw, in 14 days, as part of The League of Adventurists Winter 2010 Rickshaw Run.</p>
<p>Here is a short video of our time on the road&#8230;</p>
<p><object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/GAOjORGcq9U&#038;hl=en_GB&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/GAOjORGcq9U&#038;hl=en_GB&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.trevorboyle.com/2010/04/12/rickshaw-run-winter-2010-rickshawshank-redemption/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Dynamically changing the palette of an image using Flash (AS3)</title>
		<link>http://blog.trevorboyle.com/2009/10/18/dynamically-changing-the-palette-of-an-image-in-as3/</link>
		<comments>http://blog.trevorboyle.com/2009/10/18/dynamically-changing-the-palette-of-an-image-in-as3/#comments</comments>
		<pubDate>Sun, 18 Oct 2009 20:58:08 +0000</pubDate>
		<dc:creator>TrevorB</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[BitmapData]]></category>
		<category><![CDATA[Equalisation]]></category>
		<category><![CDATA[Histogram]]></category>
		<category><![CDATA[Matrix]]></category>
		<category><![CDATA[palette]]></category>
		<category><![CDATA[paletteMap]]></category>
		<category><![CDATA[posterize]]></category>

		<guid isPermaLink="false">http://blog.trevorboyle.com/?p=111</guid>
		<description><![CDATA[For the generative art framework ARTionscript I wanted to be able to dynamically change the colours of an image using actionscript. This can easily be done using Photoshop (or similar), but what about the latest uploaded Flickr image? Having experimented &#8230; <a href="http://blog.trevorboyle.com/2009/10/18/dynamically-changing-the-palette-of-an-image-in-as3/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>For the generative art framework <a href="http://artionscript.com/" target="_blank">ARTionscript</a> I wanted to be able to dynamically change the colours of an image using actionscript. This can easily be done using Photoshop (or similar), but what about the latest uploaded Flickr image?</p>
<p>Having experimented with a few options, I settled on the following process:</p>
<ul>
<li>Load an external image</li>
<li>Convert the BitmapData of the image to grey scale</li>
<li>Perform a histogram equalisation on the BitmapData</li>
<li>Posterize / limit the BitmapData to the number of colours in the new palette</li>
<li>Swap the remaining colours in the BitmapData with the colours in the new palette</li>
<li>Create some effect using the new BitmapData</li>
</ul>
<p><img src="http://blog.trevorboyle.com/wp-content/uploads/artionscript/monalisa.jpg" alt="monalisa" title="monalisa" width="150" height="200" />&nbsp;<img src="http://blog.trevorboyle.com/wp-content/uploads/artionscript/monalisa-greyscale.jpg" alt="monalisa-greyscale" title="monalisa-greyscale" width="150" height="200" />&nbsp;<img src="http://blog.trevorboyle.com/wp-content/uploads/artionscript/monalisa-equalise-histogram.jpg" alt="monalisa-equalise-histogram" title="monalisa-equalise-histogram" width="150" height="200" /><br /><img src="http://blog.trevorboyle.com/wp-content/uploads/artionscript/monalisa-posterized.jpg" alt="monalisa-posterized" title="monalisa-posterized" width="150" height="200" />&nbsp;<img src="http://blog.trevorboyle.com/wp-content/uploads/artionscript/monalisa-colourised.jpg" alt="monalisa-colourised" title="monalisa-colourised" width="150" height="200" />&nbsp;<img src="http://blog.trevorboyle.com/wp-content/uploads/artionscript/monalisa-circles.jpg" alt="monalisa-circles" title="monalisa-circles" width="150" height="200" /></p>
<p>And here is the code which takes advantage of the <strong>BitmapData.histogram</strong>, <strong>BitmapData.paletteMap</strong> &#038; <strong>ColorMatrixFilter</strong> :</p>
<pre><code>package com.artionscript.assistants
{
	import com.artionscript.palettes.Palette;
	import flash.display.BitmapData;
	import flash.filters.ColorMatrixFilter;
	import flash.geom.Matrix;
	import flash.geom.Point;
	import flash.geom.Rectangle;
	/**
	 * ...
	 * @author Trevor Boyle
	 */
	public class ImageAssistant
	{
		public static function convertBDToGreyScale(sourceBD:BitmapData):BitmapData {
			//BT.709-5 luminance constants

			var tempBD:BitmapData = sourceBD.clone();

			var greyScaleCMF:ColorMatrixFilter = new ColorMatrixFilter();
			greyScaleCMF.matrix = new Array(
			0.2125, 0.7154, 0.0721, 0, 0,
			0.2125, 0.7154, 0.0721, 0, 0,
			0.2125, 0.7154, 0.0721, 0, 0,
			0, 0, 0, 1, 0);

			tempBD.applyFilter(tempBD, new Rectangle(0, 0, tempBD.width, tempBD.height), new Point(0, 0), greyScaleCMF);

			return tempBD;
		}

		public static function equaliseGreyScaleBDHistogram(sourceBD:BitmapData):BitmapData {
			//concept by http://www.generation5.org/content/2004/histogramEqualization.asp

			var tempBD:BitmapData = sourceBD.clone();

			var v:Vector.&lt;vector .&lt;Number&gt;&gt; = tempBD.histogram();

			var adjustmentMultiplier:Number = 255 / (tempBD.width * tempBD.height);
			var tempAdjustedFreq:int;
			var cumulativeFreq:Number = 0;
			var adjustedRedFreqArr:Array = new Array();
			var adjustedGreenFreqArr:Array = new Array();
			var adjustedBlueFreqArr:Array = new Array();
			for (var i:int=0; i &lt; 256; i++) {
				cumulativeFreq += v[0][i];

				tempAdjustedFreq = cumulativeFreq * adjustmentMultiplier;

				adjustedRedFreqArr[i] = tempAdjustedFreq &lt;&lt; 16
				adjustedGreenFreqArr[i] = tempAdjustedFreq &lt;&lt; 8
				adjustedBlueFreqArr[i] = tempAdjustedFreq
			}

			tempBD.paletteMap(tempBD, new Rectangle(0, 0, tempBD.width, tempBD.height), new Point(0, 0),
adjustedRedFreqArr, adjustedGreenFreqArr, adjustedBlueFreqArr, null);

			return tempBD;
		}
		<span id="more-111"></span>
		public static function posterizeGreyScaleBD(sourceBD:BitmapData, depth:int):BitmapData {
			//concept by http://www.axiomx.com/posterize.htm

			var tempBD:BitmapData = sourceBD.clone();

			depth = Math.max(0, Math.min(255, depth));

			var colours:Array = [0x004358, 0x1f8a70, 0xbedb39, 0xffe11a, 0xfd7400];

			var numAreas:Number = 256 / depth;
			var numValues:Number = 255 / (depth - 1);

			var tempArea:int;
			var tempAdjustedFreq:int;
			var tempColour:uint;
			var adjustedRedFreqArr:Array = new Array();
			var adjustedGreenFreqArr:Array = new Array();
			var adjustedBlueFreqArr:Array = new Array();
			for (var i:int = 0; i &lt; 256; i++) {
				tempArea =  Math.floor(i / numAreas);
				trace(colours[tempArea]);
				tempAdjustedFreq = Math.floor(numValues * tempArea);

				tempColour = colours[tempArea];

				adjustedRedFreqArr[i] = tempAdjustedFreq &lt;&lt; 16
				adjustedGreenFreqArr[i] = tempAdjustedFreq &lt;&lt; 8
				adjustedBlueFreqArr[i] = tempAdjustedFreq
			}

			tempBD.paletteMap(tempBD, new Rectangle(0, 0, tempBD.width, tempBD.height), new Point(0, 0),
adjustedRedFreqArr, adjustedGreenFreqArr, adjustedBlueFreqArr, null);

			return tempBD;
		}

		public static function posterizeGreyScaleBDToPalette(sourceBD:BitmapData, colours:Array):BitmapData {
			//concept by http://www.axiomx.com/posterize.htm

			var tempBD:BitmapData = sourceBD.clone();

			var depth:int = colours.length;

			depth = Math.max(0, Math.min(255, depth));

			trace(depth)

			var numAreas:Number = 256 / depth;
			var numValues:Number = 255 / (depth - 1);

			var tempArea:int;
			var tempAdjustedFreq:int;
			var tempColour:uint;
			var adjustedRedFreqArr:Array = new Array();
			var adjustedGreenFreqArr:Array = new Array();
			var adjustedBlueFreqArr:Array = new Array();
			for (var i:int = 0; i &lt; 256; i++) {
				tempArea =  Math.floor(i / numAreas);
				tempAdjustedFreq = Math.floor(numValues * tempArea);
				tempColour = colours[tempArea];

				adjustedRedFreqArr[i] = ((tempColour &gt;&gt; 16) &amp; 0xFF) &lt; &lt; 16;
				adjustedGreenFreqArr[i] = ((tempColour &gt;&gt; 8) &amp; 0xFF) &lt; &lt; 8;
				adjustedBlueFreqArr[i] = (tempColour &amp; 0xFF);
			}

			tempBD.paletteMap(tempBD, new Rectangle(0, 0, tempBD.width, tempBD.height), new Point(0, 0),
adjustedRedFreqArr, adjustedGreenFreqArr, adjustedBlueFreqArr, null);

			return tempBD;
		}

		public static function scaleBD(sourceBD:BitmapData, width:Number, height:Number, constrain:Boolean=true,
constrainToLargest:Boolean=false):BitmapData {

			var tempBD:BitmapData = sourceBD.clone();

			var scaleX:Number = width / tempBD.width;
			var scaleY:Number = height / tempBD.height;

			if (constrain) {
				if (constrainToLargest) {
					scaleX = scaleY = Math.max(scaleX, scaleY);
				}else{
					scaleX = scaleY = Math.min(scaleX, scaleY);
				}
			}
			var scaleMatrix:Matrix = new Matrix();
			scaleMatrix.scale(scaleX, scaleY);

			var scaledBD:BitmapData = new BitmapData(tempBD.width * scaleX, tempBD.height * scaleY, false, 0x000000);
			scaledBD.draw(tempBD, scaleMatrix);

			return scaledBD;
		}
	}
}</code></vector></code></pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.trevorboyle.com/2009/10/18/dynamically-changing-the-palette-of-an-image-in-as3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flash on the Beach &#8217;09</title>
		<link>http://blog.trevorboyle.com/2009/09/24/flash-on-the-beach-09/</link>
		<comments>http://blog.trevorboyle.com/2009/09/24/flash-on-the-beach-09/#comments</comments>
		<pubDate>Thu, 24 Sep 2009 23:00:55 +0000</pubDate>
		<dc:creator>TrevorB</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[Flash on the Beach]]></category>
		<category><![CDATA[FOTB]]></category>

		<guid isPermaLink="false">http://blog.trevorboyle.com/?p=102</guid>
		<description><![CDATA[I had a great time at &#8216;Flash on the beach&#8217; this year and, like everyone else who attended, I have been inspired again to create. This year was also more special, than the previous years that I have attended, because &#8230; <a href="http://blog.trevorboyle.com/2009/09/24/flash-on-the-beach-09/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I had a great time at &#8216;Flash on the beach&#8217; this year and, like everyone else who attended, I have been inspired again to create.</p>
<p>This year was also more special, than the previous years that I have attended, because I was fortunate enough to be able to speak on the main stage for 3 minutes as part of the &#8216;Elevator Pitch&#8217; session, along with 20 other people.</p>
<p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/75gAaUPRH58&#038;hl=en&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/75gAaUPRH58&#038;hl=en&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></p>
<p>I also promised during my speech to release the source code for my &#8217;3D Pixelated Video&#8217; project. So, here it is in all its uncommented, unoptimised glory. I have also included a glitchy perlin noise version, which I put together over the past hour, to get you thinking of what you could do with it. Other suggestions include converting it to Papervison and creating some installation art.</p>
<p><a href="http://blog.trevorboyle.com/wp-content/uploads/pixelated-video/pixelated_video.zip" target="_blank">3D Isometric Pixelated Video Source Code</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.trevorboyle.com/2009/09/24/flash-on-the-beach-09/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>NotWhileIAmEating.com</title>
		<link>http://blog.trevorboyle.com/2009/05/23/notwhileiameatingcom/</link>
		<comments>http://blog.trevorboyle.com/2009/05/23/notwhileiameatingcom/#comments</comments>
		<pubDate>Sat, 23 May 2009 21:20:58 +0000</pubDate>
		<dc:creator>TrevorB</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Disgusting]]></category>
		<category><![CDATA[Food]]></category>
		<category><![CDATA[Food Blog]]></category>
		<category><![CDATA[Mouldy]]></category>
		<category><![CDATA[Rotten]]></category>

		<guid isPermaLink="false">http://blog.trevorboyle.com/?p=85</guid>
		<description><![CDATA[For the past few weeks I have been working on a little &#8216;Web 2.0&#8242; hobby blog. I think that it&#8217;s now time to release it to the masses :-) It&#8217;s basically an image and video blog about all sorts of &#8230; <a href="http://blog.trevorboyle.com/2009/05/23/notwhileiameatingcom/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>For the past few weeks I have been working on a little &#8216;Web 2.0&#8242; hobby blog. I think that it&#8217;s now time to release it to the masses :-)</p>
<p>It&#8217;s basically an image and video blog about all sorts of yucky food.</p>
<p>A new post is added daily.</p>
<p>The idea sprang from a 16 month old sandwich that had been hidden under a desk where I was working.</p>
<p>Please rate, comment, dig, blog, share, contribute and suggest :-)</p>
<p><a href="http://notwhileiameating.com/2009/05/17/16-month-old-tesco-tuna-sweetcorn-sandwich/" target="_blank">http://notwhileiameating.com/</a></p>
<p><a href="http://notwhileiameating.com/2009/05/17/16-month-old-tesco-tuna-sweetcorn-sandwich/" target="_blank"><img src="http://notwhileiameating.com/wp-content/uploads/2009/05/tesco-sandwich.jpg" alt="Tesco Sandwich" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.trevorboyle.com/2009/05/23/notwhileiameatingcom/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>ActionScript 3.0 Client Library for Facebook Platform API &#8211; Flash Sample Code</title>
		<link>http://blog.trevorboyle.com/2009/05/02/actionscript-30-client-library-for-facebook-platform-api-flash-sample-code/</link>
		<comments>http://blog.trevorboyle.com/2009/05/02/actionscript-30-client-library-for-facebook-platform-api-flash-sample-code/#comments</comments>
		<pubDate>Sat, 02 May 2009 18:40:06 +0000</pubDate>
		<dc:creator>TrevorB</dc:creator>
				<category><![CDATA[Facebook]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[sample code]]></category>

		<guid isPermaLink="false">http://blog.trevorboyle.com/?p=73</guid>
		<description><![CDATA[The new ActionScript 3.0 Client Library for Facebook Platform API, fully supported by Facebook and Adobe, makes it easy to build applications that combine the strengths of the Flash Platform and Facebook Platform. I had a few problems trying to &#8230; <a href="http://blog.trevorboyle.com/2009/05/02/actionscript-30-client-library-for-facebook-platform-api-flash-sample-code/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<blockquote><p>The new ActionScript 3.0 Client Library for Facebook Platform API, fully supported by Facebook and Adobe, makes it easy to build applications that combine the strengths of the Flash Platform and Facebook Platform.</p></blockquote>
<p>I had a few problems trying to find some sample AS3 code, using the new &#8216;<a title="AS3 Facebook API" href="http://code.google.com/p/facebook-actionscript-api/" target="_blank">ActionScript 3.0 Client Library for Facebook Platform API</a>&#8216; which is supported both by <a title="Adobe.com" href="http://www.adobe.com/" target="_blank">Adobe</a>and by <a title="facebook.com" href="http://facebook.com" target="_blank">Facebook</a>, which wasn&#8217;t focused on Flex. So I took Adobe&#8217;s &#8216;<a title="Browse Album Flex Sample" href="http://www.adobe.com/devnet/facebook/samples/index.html#browsealbum" target="_blank">BROWSE THUMBNAILS OF FACEBOOK PHOTOS</a>&#8216; example and converted it into something you can use for Flash.</p>
<ol>
<li>Watch this video <a title="AS3 Facebook Quick Start" href="http://www.adobe.com/devnet/facebook/articles/video_facebook_quick_start.html" target="_blank">http://www.adobe.com/devnet/facebook/articles/video_facebook_quick_start.html</a></li>
<li>Download the ActionScript 3.0 Client Library for Facebook vX.X &#8211; Source from <a title="facebook-actionscript-api" href="http://code.google.com/p/facebook-actionscript-api/downloads/list" target="_blank">http://code.google.com/p/facebook-actionscript-api/downloads/list</a></li>
<li>Setup your facebook application as per the video instructions, making sure you select &#8216;Desktop&#8217; as your &#8216;Application Type&#8217; in the advanced tab</li>
<li>Create a new Flash AS3 file</li>
<li>Open the components panel (Window&gt;Components) and drag to your library the &#8216;Button&#8217;, &#8216;List&#8217;, &#8216;TileList&#8217; and &#8216;UILoader&#8217; components</li>
<li>Create a new &#8216;Document class&#8217;, named FacebookImageBrowser.as, and assign it to your newly created Flash file</li>
<li>Add the following code to your document class and include your own &#8216;API_KEY&#8217; and &#8216;SECRET_KEY&#8217;, which is listed on your Facebook application&#8217;s settings page</li>
<li>Publish your movie and step through the buttons as you get feedback</li>
</ol>
<pre><code>package {
	import flash.display.Sprite;
	import flash.text.TextField;
	import fl.controls.Button;

	import flash.events.Event;
	import flash.events.MouseEvent;
	import fl.events.ListEvent;

	import fl.controls.List;
	import fl.controls.TileList;
	import fl.controls.ScrollBarDirection;

	import fl.data.DataProvider;

	import fl.containers.UILoader;

	import com.facebook.data.photos.AlbumData;
	import com.facebook.data.photos.PhotoData;

	import com.facebook.Facebook;
	import com.facebook.events.FacebookEvent;
	import com.facebook.net.FacebookCall;
	import com.facebook.data.photos.GetAlbumsData;
	import com.facebook.data.photos.GetPhotosData;
	import com.facebook.commands.photos.GetAlbums;
	import com.facebook.commands.photos.GetPhotos;
	import com.facebook.utils.FacebookSessionUtil;

	/**
	* ...
	* @Flex Developer: Steven Shongrunden
	* @Flash Conversion: Trevor Boyle
	*/</code></pre>
<pre><code><span id="more-73"></span>
	public class FacebookImageBrowser extends Sprite {

		private var fbook:Facebook;
		private var session:FacebookSessionUtil;

		private var API_KEY:String = "XXXXX";
		private var SECRET_KEY:String = "XXXXX";

		private var facebookPhotoAlbums:DataProvider; 

		private var facebookPhotos:DataProvider;

		private var button1:Button
		private var button2:Button
		private var button3:Button

		private var status:TextField;

		private var albumsDataGrid:List;
		private var photosList:TileList;

		private var myUILoader:UILoader;

		function FacebookImageBrowser(){
			trace("FacebookImageBrowser Constructor")
			init()
		}

		private function init():void {
			trace("FacebookImageBrowser.init()")
			session=new FacebookSessionUtil(API_KEY, SECRET_KEY, loaderInfo);
			session.addEventListener(FacebookEvent.CONNECT, onConnect);
			fbook=session.facebook;

			button1 = new Button();
			button1.label = "1. Login to Facebook";
			button1.width = 120;
			button1.move(10, 10);
			button1.addEventListener(MouseEvent.CLICK, session.login)
			addChild(button1);

			button2 = new Button();
			button2.label = "2. Done logging in";
			button2.width = 120;
			button2.move(10, 40);
			button2.addEventListener(MouseEvent.CLICK, doneLoggingIn)
			addChild(button2);

			button3 = new Button();
			button3.label = "3. Browse Photos";
			button3.width = 120;
			button3.move(10, 70);
			button3.addEventListener(MouseEvent.CLICK, getPhotoAlbums)
			addChild(button3);

			status = new TextField();
			status.x = 10;
			status.y = 100;
			status.text = "Please log in"
			status.autoSize = "left"
			addChild(status)

			facebookPhotoAlbums = new DataProvider();

			albumsDataGrid = new List();
			albumsDataGrid.setSize(200,300);
			albumsDataGrid.dataProvider = facebookPhotoAlbums;
			albumsDataGrid.addEventListener(Event.CHANGE, showSelectedAlbum);
			albumsDataGrid.move(10,130)
			addChild(albumsDataGrid);

			facebookPhotos = new DataProvider();

			photosList = new TileList();
			photosList.direction = ScrollBarDirection.VERTICAL;
			photosList.dataProvider = facebookPhotos;
			photosList.sourceFunction = getPhotoDataSourceSmall
			photosList.addEventListener(Event.CHANGE, showSelectedPhoto);
			photosList.columnWidth = 75;
			photosList.rowHeight = 75;
			photosList.columnCount = 4;
			photosList.rowCount = 4;
			photosList.setSize(320,300);
			photosList.move(230,130)
			addChild(photosList);

			myUILoader = new UILoader();
			myUILoader.autoLoad = false;
			myUILoader.scaleContent = false;
			myUILoader.move(10, 440);
			addChild(myUILoader);
		}

		private function onConnect(e:FacebookEvent):void {
			trace("FacebookImageBrowser.onConnect()")
			status.text = "Facebook API Ready";
		}

		private function doneLoggingIn(e:MouseEvent=null):void {
			trace("FacebookImageBrowser.doneLoggingIn()")
			session.validateLogin();
		}

		private function getPhotoAlbums(e:MouseEvent=null):void {
			trace("FacebookImageBrowser.getPhotoAlbums()")
			var call:FacebookCall = fbook.post(new GetAlbums(fbook.uid));
			call.addEventListener(FacebookEvent.COMPLETE, handleGetAlbumsResponse);
		}

		private function handleGetAlbumsResponse(e:FacebookEvent):void {
			trace("FacebookImageBrowser.handleGetAlbumsResponse()")
			var albumsResponseData:GetAlbumsData = e.data as GetAlbumsData;

			if (!albumsResponseData || e.error){ // an error occurred
				status.text = "Error";
				return;
			}

			facebookPhotoAlbums.removeAll()

			var albumData:AlbumData;
			for(var i:int = 0; i &amp;lt; albumsResponseData.albumCollection.length; i++){
				albumData = albumsResponseData.albumCollection.getItemAt(i) as AlbumData
				facebookPhotoAlbums.addItem({label:albumData.name, aid:albumData.aid, cover_pid:albumData.cover_pid,
owner:albumData.owner, name:albumData.name, created:albumData.created, modified:albumData.modified,
description:albumData.description, location:albumData.location, link:albumData.link, size:albumData.size, visible:albumData.visible});
			}
		}

		private function handleGetPhotosResponse(e:FacebookEvent):void {
			trace("FacebookImageBrowser.handleGetPhotosResponse()")
			var photosResponseData:GetPhotosData = e.data as GetPhotosData;

			if (!photosResponseData || e.error){ // an error occurred
				status.text = "Error";
				return;
			}

			facebookPhotos.removeAll()

			var photoData:PhotoData;
			for(var i:int = 0; i &amp;lt; photosResponseData.photoCollection.length; i++){
				photoData = photosResponseData.photoCollection.getItemAt(i) as PhotoData
				facebookPhotos.addItem({label:photoData.caption, pid:photoData.pid, aid:photoData.aid,
owner:photoData.owner, src:photoData.src, src_big:photoData.src_big, src_small:photoData.src_small, link:photoData.link,
caption:photoData.caption, created:photoData.created});
			}
		}

		private function showSelectedAlbum(e:Event):void {
			trace("FacebookImageBrowser.showSelectedAlbum()")
			facebookPhotos.removeAll()

			var selectedAlbumID:String = albumsDataGrid.selectedItem.aid;

			var call:FacebookCall = fbook.post(new GetPhotos('', selectedAlbumID));
			call.addEventListener(FacebookEvent.COMPLETE, handleGetPhotosResponse);
		}

		private function showSelectedPhoto(e:Event):void {
			trace("FacebookImageBrowser.showSelectedPhoto()")
			var selectedPhoto:String = getPhotoDataSourceBig((photosList.selectedItem as Object));

			myUILoader.source = selectedPhoto
			myUILoader.load();
		}

		private function getPhotoDataSource(item:Object):String {
			return item.src;
		}

		private function getPhotoDataSourceSmall(item:Object):String {
			return item.src_small;
		}

		private function getPhotoDataSourceBig(item:Object):String {
			return item.src_big;
		}
	}
}</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.trevorboyle.com/2009/05/02/actionscript-30-client-library-for-facebook-platform-api-flash-sample-code/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Through the Twittersphere</title>
		<link>http://blog.trevorboyle.com/2009/04/13/through-the-twittersphere/</link>
		<comments>http://blog.trevorboyle.com/2009/04/13/through-the-twittersphere/#comments</comments>
		<pubDate>Mon, 13 Apr 2009 12:01:39 +0000</pubDate>
		<dc:creator>TrevorB</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Twitter]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[twitterscript]]></category>

		<guid isPermaLink="false">http://blog.trevorboyle.com/?p=63</guid>
		<description><![CDATA[http://blog.trevorboyle.com/wp-content/uploads/twittersphere/Twittersphere-Visualizer.html Having had a few days off from work over the Easter break, I decided to&#8230; work. Using the AS3 twitterscript library (http://code.google.com/p/twitterscript/) and a php proxy script by Woven Interactive (http://woveninteractive.net/?p=45) I have created a simple flash visualisation of Twitter&#8217;s &#8230; <a href="http://blog.trevorboyle.com/2009/04/13/through-the-twittersphere/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.trevorboyle.com/wp-content/uploads/twittersphere/Twittersphere-Visualizer.html">http://blog.trevorboyle.com/wp-content/uploads/twittersphere/Twittersphere-Visualizer.html</a></p>
<p>Having had a few days off from work over the Easter break, I decided to&#8230; work.</p>
<p>Using the AS3 twitterscript library (<a href="http://code.google.com/p/twitterscript/" target="_blank">http://code.google.com/p/twitterscript/</a>) and a php proxy script by Woven Interactive (<a href="http://woveninteractive.net/?p=45" target="_blank">http://woveninteractive.net/?p=45</a>) I have created a simple flash visualisation of <a href="http://blog.trevorboyle.com/wp-content/uploads/twittersphere/Twittersphere-Visualizer.html" target="_blank">Twitter&#8217;s Twittersphere</a>.</p>
<p>The flash application periodically requests the latest tweets from Twitter and then animates them in the sky.</p>
<p>I plan to add some search functionality to it at a later date, but it&#8217;s now time to go buy some cheap Easter eggs and drink some beer.</p>
<div class="wp-caption alignnone" style="width: 450px"><a href="http://blog.trevorboyle.com/wp-content/uploads/twittersphere/Twittersphere-Visualizer.html"><img title="Twittersphere Visualizer" src="http://blog.trevorboyle.com/wp-content/uploads/twittersphere/twittersphere-visualizer.jpg" alt="Twittersphere Visualizer" width="440" height="300" /></a><p class="wp-caption-text">Twittersphere Visualizer</p></div>
]]></content:encoded>
			<wfw:commentRss>http://blog.trevorboyle.com/2009/04/13/through-the-twittersphere/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Twitter and Flash (twitterscript)</title>
		<link>http://blog.trevorboyle.com/2009/04/10/twitter-and-flash-twitterscript/</link>
		<comments>http://blog.trevorboyle.com/2009/04/10/twitter-and-flash-twitterscript/#comments</comments>
		<pubDate>Fri, 10 Apr 2009 12:09:07 +0000</pubDate>
		<dc:creator>TrevorB</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Twitter]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[cs3]]></category>
		<category><![CDATA[tortoise svn]]></category>
		<category><![CDATA[twitterscript]]></category>

		<guid isPermaLink="false">http://blog.trevorboyle.com/?p=51</guid>
		<description><![CDATA[For those of you trying to create a twitter vs flash mash-up, hopefully this will help. Download an svn client, such as TortoiseSVN (http://tortoisesvn.net/downloads) Using your client, download the latest .as (AS3) files from http://twitterscript.googlecode.com/svn/trunk Create a new Flash AS3 &#8230; <a href="http://blog.trevorboyle.com/2009/04/10/twitter-and-flash-twitterscript/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>For those of you trying to create a twitter vs flash mash-up, hopefully this will help.</p>
<ol>
<li>Download an svn client, such as TortoiseSVN (<a href="http://tortoisesvn.net/downloads" target="_blank">http://tortoisesvn.net/downloads</a>)</li>
<li>Using your client, download the latest .as (AS3) files from <a title="http://twitterscript.googlecode.com/svn/trunk" href="http://twitterscript.googlecode.com/svn/trunk" target="_blank">http://twitterscript.googlecode.com/svn/trunk</a></li>
<li>Create a new Flash AS3 file</li>
<li>Create a new &#8216;Document class&#8217;, named TwitterUserFeed.as, and assign it to your newly created Flash file</li>
<li>Add the following code to your document class (updating your package name and TWITTER_USER accordingly)</li>
<li>Publish the movie and watch the &#8216;output&#8217; panel</li>
<li>View the Twitter.as file to help you extend this example</li>
</ol>
<pre><code>package com.trevorboyle.twitter
{
	import flash.display.Sprite;
	import twitter.api.data.TwitterStatus;
	import twitter.api.Twitter;
	import twitter.api.TwitterSearch;
	import twitter.api.events.TwitterEvent;

	/**
	 * ...
	 * @author Trevor Boyle
	 */
	public class TwitterUserFeed extends Sprite
	{
		private static const TWITTER_USER:String = "stephenfry";

		private var _twitter:Twitter;
		private var _twitterSearch:TwitterSearch;

		public function TwitterUserFeed()
		{
			_twitter = new Twitter();
			_twitterSearch = new TwitterSearch();

			_twitter.loadUserTimeline(TWITTER_USER)
			_twitter.addEventListener(TwitterEvent.ON_USER_TIMELINE_RESULT, userTimelineResult)
		}

		private function userTimelineResult(e:TwitterEvent):void {
			var twitterStatus:TwitterStatus;
			for (var i in e.data) {
				twitterStatus = e.data[i]
				trace(twitterStatus.text)
			}
		}
	}
}</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.trevorboyle.com/2009/04/10/twitter-and-flash-twitterscript/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
	</channel>
</rss>
