<?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>alwaysinbeta.org - Ian McGregor, Creative Developer &#187; Source code</title>
	<atom:link href="http://alwaysinbeta.org/category/source-code/feed" rel="self" type="application/rss+xml" />
	<link>http://alwaysinbeta.org</link>
	<description>Blogfolio of Ian McGregor</description>
	<lastBuildDate>Mon, 09 Jan 2012 21:34:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.4</generator>
		<item>
		<title>Magic Music Player</title>
		<link>http://alwaysinbeta.org/magic-music-player</link>
		<comments>http://alwaysinbeta.org/magic-music-player#comments</comments>
		<pubDate>Tue, 20 Dec 2011 23:06:48 +0000</pubDate>
		<dc:creator>}i{</dc:creator>
				<category><![CDATA[Experiments]]></category>
		<category><![CDATA[Source code]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://alwaysinbeta.org/?p=790</guid>
		<description><![CDATA[I finally decided to learn Python after hearing good things for years. After a day getting started and playing around with the language I spent another day building a breakable toy app. The language itself is easy to pick up and produces pleasingly minimal, readable source code. Being dynamically typed I did have to rely [...]]]></description>
			<content:encoded><![CDATA[<p><iframe width="493" height="340" src="http://magicmusicplayer.appspot.com/"><br />
</iframe></p>
<p>I finally decided to learn Python after hearing good things for years. After a day getting started and playing around with the language I spent another day building a breakable toy app.</p>
<p>The language itself is easy to pick up and produces pleasingly minimal, readable source code. Being dynamically typed I did have to rely quite heavily on both reference docs and runtime errors! I used <a href="http://pydev.org/" target="_blank">pydev</a> in Eclipse as an IDE, so was easy to get up and running. <a href="http://code.google.com/appengine/" target="_blank">App Engine</a> seemed an easy noob option for testing and deploying.</p>
<p>The resulting app is in the iFrame above or here <a href="http://magicmusicplayer.appspot.com/" target="_blank">magicmusicplayer.appspot.com</a> with source on <a href="https://github.com/alwaysinbeta/magic-music-player" target="_blank">github</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://alwaysinbeta.org/magic-music-player/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>BBC One Life</title>
		<link>http://alwaysinbeta.org/bbc-one-life</link>
		<comments>http://alwaysinbeta.org/bbc-one-life#comments</comments>
		<pubDate>Fri, 29 Jul 2011 02:32:33 +0000</pubDate>
		<dc:creator>}i{</dc:creator>
				<category><![CDATA[Awarded]]></category>
		<category><![CDATA[Sites]]></category>
		<category><![CDATA[Source code]]></category>
		<category><![CDATA[BrightCove]]></category>
		<category><![CDATA[RobotLegs]]></category>

		<guid isPermaLink="false">http://alwaysinbeta.org/?p=663</guid>
		<description><![CDATA[This is an interactive film trailer for the BBC&#8217;s One Life film. Users can drag up at any time during the trailer to get additional content related to the shot currently on screen. Dragging down accesses global content such as audience reactions and interviews. www.one-life.com FWA SOTD September 12 2011 Commarts Webpick of the Week [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://alwaysinbeta.org/wp-content/uploads/2011/07/bbc-one-life.jpg" alt="" title="bbc-one-life" width="493" height="279" class="alignnone size-full wp-image-781" /></p>
<p>This is an interactive film trailer for the BBC&#8217;s One Life film. Users can drag up at any time during the trailer to get additional content related to the shot currently on screen. Dragging down accesses global content such as audience reactions and interviews.</p>
<p><a href="http://www.one-life.com" target="_blank">www.one-life.com</a></p>
<p><a href="http://www.thefwa.com/site/bbc-one-life" target="_blank">FWA SOTD September 12 2011</a><br />
<a href="http://www.commarts.com/web-sites/bbc-one-life.html" target="_blank">Commarts Webpick of the Week</a></p>
<p>The UI is enriched by sampling the colours from the video. I used BitmapData.merge to gradually step through the colour changes, creating a smooth, fluid effect. Here&#8217;s the code:</p>


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="actionscript"><ol><li class="li1"><pre class="de1"><span class="kw3">private</span> <span class="kw2">var</span> _multiplier:uint = <span class="nu0">32</span>;</pre></li><li class="li1"><pre class="de1">&nbsp;</pre></li><li class="li1"><pre class="de1"><span class="kw3">public</span> <span class="kw2">function</span> <span class="kw3">set</span> videoFrame<span class="br0">&#40;</span>bitmapData: BitmapData<span class="br0">&#41;</span>: <span class="kw3">void</span> <span class="br0">&#123;</span></pre></li><li class="li1"><pre class="de1">	bitmapData.<span class="me1">lock</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;</pre></li><li class="li1"><pre class="de1">&nbsp;</pre></li><li class="li1"><pre class="de1">	bitmapData.<span class="me1">applyFilter</span><span class="br0">&#40;</span>bitmapData, _rect, _point, _colorMatrixFilter<span class="br0">&#41;</span>; <span class="co1">// saturation and contrast</span></pre></li><li class="li1"><pre class="de1">	bitmapData.<span class="me1">applyFilter</span><span class="br0">&#40;</span>bitmapData, _rect, _point, _blurFilter<span class="br0">&#41;</span>;</pre></li><li class="li1"><pre class="de1">&nbsp;</pre></li><li class="li1"><pre class="de1">	_bitmapData.<span class="me1">merge</span><span class="br0">&#40;</span>bitmapData, _rect, _point, _multiplier, _multiplier, _multiplier, <span class="nu0">0</span><span class="br0">&#41;</span>;</pre></li><li class="li1"><pre class="de1">&nbsp;</pre></li><li class="li1"><pre class="de1">	bitmapData.<span class="me1">unlock</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;</pre></li><li class="li1"><pre class="de1"><span class="br0">&#125;</span></pre></li></ol></div></div></div></div></div></div></div>


]]></content:encoded>
			<wfw:commentRss>http://alwaysinbeta.org/bbc-one-life/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Handling &#8216;Load Never Completed&#8217; IOErrorEvent</title>
		<link>http://alwaysinbeta.org/quick-flash-tips-2-handling-load-never-completed-ioerrorevent</link>
		<comments>http://alwaysinbeta.org/quick-flash-tips-2-handling-load-never-completed-ioerrorevent#comments</comments>
		<pubDate>Mon, 14 Jun 2010 19:14:50 +0000</pubDate>
		<dc:creator>}i{</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Other]]></category>
		<category><![CDATA[Source code]]></category>

		<guid isPermaLink="false">http://alwaysinbeta.org/?p=557</guid>
		<description><![CDATA[This is a potentially annoying error that occurs in Safari/Chrome when you hit refresh or close a tab containing Flash content. If you have the debug player you see: Error #2044: Unhandled IOErrorEvent:. text=Error #2036: Load Never Completed. It can crash Safari or, in the case of Chrome, show a &#8216;broken plugin&#8217; screen, shutting down [...]]]></description>
			<content:encoded><![CDATA[<p>This is a potentially annoying error that occurs in Safari/Chrome when you hit refresh or close a tab containing Flash content. If you have the debug player you see:</p>
<p><code>Error #2044: Unhandled IOErrorEvent:. text=Error #2036: Load Never Completed.</code></p>
<p>It can crash Safari or, in the case of Chrome, show a &#8216;broken plugin&#8217; screen, shutting down every instance of Flash Player in the process.</p>
<p>Fortunately the fix is easy. To handle it you must add an IOErrorEvent listener to every Loader instance in your project, including the &#8216;root&#8217; Loader (i.e. the class that is the base of your main SWF).</p>
<p>To handle the main SWF simply add the following code to your base class. In &#8216;onIOError&#8217; you can handle the error silently should you wish.</p>
<p><code>root.loaderInfo.addEventListener(IOErrorEvent.IO_ERROR, onIOError);</code></p>
]]></content:encoded>
			<wfw:commentRss>http://alwaysinbeta.org/quick-flash-tips-2-handling-load-never-completed-ioerrorevent/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>New open source code repo. First commit: YouTube API Player</title>
		<link>http://alwaysinbeta.org/new-open-source-code-repo-first-commit-youtube-api-player</link>
		<comments>http://alwaysinbeta.org/new-open-source-code-repo-first-commit-youtube-api-player#comments</comments>
		<pubDate>Sat, 30 Jan 2010 13:42:02 +0000</pubDate>
		<dc:creator>}i{</dc:creator>
				<category><![CDATA[Source code]]></category>
		<category><![CDATA[Video]]></category>
		<category><![CDATA[YouTubeAPI]]></category>

		<guid isPermaLink="false">http://alwaysinbeta.org/?p=540</guid>
		<description><![CDATA[I&#8217;ve set up a Google code repository at http://code.google.com/p/stinkdigital-flash/ with the idea of releasing some the work I do to the community. The plan is to add simple, encapsulated, useful (hopefully) chunks of code such as utilities and APIs. The first commit is a wrapper for the YouTube ActionScript Player API. This was created for [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://alwaysinbeta.org/wp-content/uploads/2010/01/diesel.gif" alt="diesel" title="diesel" width="493" height="286" class="alignnone size-full wp-image-544" /></p>
<p>I&#8217;ve set up a Google code repository at <a href="http://code.google.com/p/stinkdigital-flash/" target="_blank">http://code.google.com/p/stinkdigital-flash/</a> with the idea of releasing some the work I do to the community. The plan is to add simple, encapsulated, useful (hopefully) chunks of code such as utilities and APIs.</p>
<p>The first commit is a wrapper for the YouTube ActionScript Player API. This was created for the first phase of a project we&#8217;re working on for Diesel and it basically simplifies working with YouTube within Flash.</p>
<p><span id="more-540"></span></p>
<p>The YouTube ActionScript Player API allows you to play videos hosted on YouTube in your own custom player or as part of a larger Flash site. We’re currently working on a project for Diesel which involves a recruitment phase to source participants for a music video slash online experience. This utilises a video hosted on YouTube and the API presented a great option to avoid duplicating the video resource, while also being able to customise the player design to match brand guidelines.</p>
<p>The API is pleasingly simple, yet no classes or interfaces are provided. This essentially means that you have to cast the loaded player to the dynamic Object class and access methods and properties as dynamic members. This is not particularly nice or easy to work with, as you have to rely heavily on documentation and your code will be highly vulnerable to runtime errors. As the player API looked like something we’d be likely to use again I coded a reusable wrapper to manage it and stored values for states, event types and video quality as constants.</p>
<p>Feel free to reuse the code. Download the source on our new Google code repository at http://code.google.com/p/stinkdigital-flash/. For usage example see http://code.google.com/p/stinkdigital-flash/wiki/YouTubePlayer.</p>
<p>You can see the player in action on diesel.com at http://recruit.diesel.com/.</p>
<p>Usage example:</p>
<p><code>var player:YouTubePlayer = new YouTubePlayer();<br />
player.autoPlay = false;<br />
player.source = "lQ3D4CqHbJM";<br />
addChild( player );</code></p>
]]></content:encoded>
			<wfw:commentRss>http://alwaysinbeta.org/new-open-source-code-repo-first-commit-youtube-api-player/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Dead Weather / Nokia</title>
		<link>http://alwaysinbeta.org/the-dead-weather</link>
		<comments>http://alwaysinbeta.org/the-dead-weather#comments</comments>
		<pubDate>Fri, 03 Jul 2009 12:02:58 +0000</pubDate>
		<dc:creator>}i{</dc:creator>
				<category><![CDATA[Sites]]></category>
		<category><![CDATA[Source code]]></category>
		<category><![CDATA[Akamai]]></category>
		<category><![CDATA[PureMVC]]></category>

		<guid isPermaLink="false">http://alwaysinbeta.org/?p=328</guid>
		<description><![CDATA[Along with W+K, we&#8217;ve been helping Jack White&#8217;s new band The Dead Weather build interest in and broadcast a live concert over the www, sponsored by Nokia. My task was primarily to build a custom video player to be used to brooadcast the Akamai stream on the site, various blogs and on screens in record [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.fromthebasement.tv/live" target="_blank"><img src="http://alwaysinbeta.org/wp-content/uploads/2009/07/deadweather.jpg" alt="deadweather" title="deadweather" width="493" height="277" class="alignnone size-full wp-image-423" /></a></p>
<p>Along with W+K, we&#8217;ve been helping Jack White&#8217;s new band The Dead Weather build interest in and broadcast a live concert over the www, sponsored by Nokia. My task was primarily to build a custom video player to be used to brooadcast the Akamai stream on the site, various blogs and on screens in record stores. It needed to be very lightweight and work at pretty much any size. I took the opportunity to create some nice reusable PureMVC classes for the streaming and player build. The player is also in use on the Stink Digital website.</p>
<p>View the live set here: <a href="http://www.fromthebasement.tv/live" target="_blank">www.fromthebasement.tv/live<br />
</a></p>
<p>Here are the source files for the Model side of things: <a href='http://alwaysinbeta.org/wp-content/uploads/2009/07/VideoStreamProxies.zip'>VideoStreamProxies.zip</a></p>
<p>They are dependent on PureMVC and, in the case of the AkamaiConnectionProxy, on the Akamai connection package.</p>
]]></content:encoded>
			<wfw:commentRss>http://alwaysinbeta.org/the-dead-weather/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

