<?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>devote.your.life &#187; Projects</title>
	<atom:link href="http://www.auricom.com/devote/category/projects/feed" rel="self" type="application/rss+xml" />
	<link>http://www.auricom.com/devote</link>
	<description>A developers journal by Ian McLean</description>
	<lastBuildDate>Thu, 17 Dec 2009 21:59:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>Some nerd humor</title>
		<link>http://www.auricom.com/devote/some-nerd-humor</link>
		<comments>http://www.auricom.com/devote/some-nerd-humor#comments</comments>
		<pubDate>Tue, 07 Apr 2009 20:42:38 +0000</pubDate>
		<dc:creator>ian</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://www.auricom.com/devote/?p=107</guid>
		<description><![CDATA[I wrote this lovely bit of code today whilst confused and frustrated working on a particularly messy command&#8230;and its just plain funny. for&#40;var i:int = 0; i &#60; localSubSwfArray.length; i++&#41;&#123; &#160; if&#40; localSubSwfArray&#91;i&#93; is LocalFile&#41;&#123; getDetailsArray.push&#40;LocalFile&#40;localSubSwfArray&#91;i&#93;&#41;.uri&#41;; &#160; localFileArray.push&#40;localSubSwfArray&#91;i&#93;&#41;; &#160; localSubSwfArray.removeItemAt&#40;i&#41;; i--; &#125; else panelForTransport.SubSWFs.addItem&#40;localSubSwfArray&#91;i&#93;&#41;; &#125; I needed to push items into a one array if [...]]]></description>
			<content:encoded><![CDATA[<p>I wrote this lovely bit of code today whilst confused and frustrated working on a particularly messy command&#8230;and its just plain funny.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #b1b100;">for</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> i:<span style="color: #0066CC;">int</span> = <span style="color: #cc66cc;">0</span>; i <span style="color: #66cc66;">&lt;</span> localSubSwfArray.<span style="color: #0066CC;">length</span>; i++<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
&nbsp;
		<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span> localSubSwfArray<span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span> is LocalFile<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
			getDetailsArray.<span style="color: #0066CC;">push</span><span style="color: #66cc66;">&#40;</span>LocalFile<span style="color: #66cc66;">&#40;</span>localSubSwfArray<span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">uri</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
			 localFileArray.<span style="color: #0066CC;">push</span><span style="color: #66cc66;">&#40;</span>localSubSwfArray<span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
			 localSubSwfArray.<span style="color: #006600;">removeItemAt</span><span style="color: #66cc66;">&#40;</span>i<span style="color: #66cc66;">&#41;</span>;
			 i--;
		<span style="color: #66cc66;">&#125;</span>
               <span style="color: #b1b100;">else</span> panelForTransport.<span style="color: #006600;">SubSWFs</span>.<span style="color: #006600;">addItem</span><span style="color: #66cc66;">&#40;</span>localSubSwfArray<span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>I needed to push items into a one array if they were of a particular type, otherwise add them to another array. Thing is I somehow saw it necessary to remove the item from the original array (with no real purpose), which screwed up the positions for the next iteration of the for loop. My fix? Throw a decrement in there to offset it! This actually works despite how unnecessarily confusing it is, it just wasn&#8217;t the right solution.</p>
<p>For all you project managers out there, this is a perfect example of why Agile suggest developers never code more than 6 hours a day. Fat chance that any of us will ever see that implemented, but I still like to mention it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.auricom.com/devote/some-nerd-humor/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Import your iTunes Playlist into AS3 and Flex!</title>
		<link>http://www.auricom.com/devote/import-your-itunes-playlist-into-as3-and-flex</link>
		<comments>http://www.auricom.com/devote/import-your-itunes-playlist-into-as3-and-flex#comments</comments>
		<pubDate>Fri, 03 Aug 2007 02:47:38 +0000</pubDate>
		<dc:creator>ian</dc:creator>
				<category><![CDATA[AS3.0]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://devote.your.life.auricom.com/?p=36</guid>
		<description><![CDATA[Ok, so first off let me say that the iTunes playlist XML structure looks like it was designed by someone who doesn&#8217;t even know XML. Take a look at this entry for a single song: &#60;dict&#62; &#60;key&#62;Track ID&#60;/key&#62;&#60;integer&#62;64&#60;/integer&#62; &#60;key&#62;Name&#60;/key&#62;&#60;string&#62;Episode 14&#60;/string&#62; &#60;key&#62;Artist&#60;/key&#62;&#60;string&#62;Gareth Emery&#60;/string&#62; &#60;key&#62;Album&#60;/key&#62;&#60;string&#62;The Gareth Emery Podcast&#60;/string&#62; &#60;key&#62;Genre&#60;/key&#62;&#60;string&#62;Podcast&#60;/string&#62; &#60;key&#62;Kind&#60;/key&#62;&#60;string&#62;MPEG audio file&#60;/string&#62; &#60;key&#62;Size&#60;/key&#62;&#60;integer&#62;64803919&#60;/integer&#62; &#60;key&#62;Total Time&#60;/key&#62;&#60;integer&#62;2700068&#60;/integer&#62; &#60;key&#62;Year&#60;/key&#62;&#60;integer&#62;2006&#60;/integer&#62; &#60;key&#62;Date [...]]]></description>
			<content:encoded><![CDATA[<p><img src='http://devote.your.life.auricom.com/wp-content/uploads/2007/08/itunes_dg1.jpg' alt='itunes_dg1.jpg' /></p>
<p>Ok, so first off let me say that the iTunes playlist XML structure looks like it was designed by someone who doesn&#8217;t even know XML. </p>
<p>Take a look at this entry for a single song:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;dict<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Track ID<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/key<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;integer<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>64<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/integer<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Name<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/key<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Episode 14<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Artist<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/key<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Gareth Emery<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Album<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/key<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>The Gareth Emery Podcast<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Genre<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/key<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Podcast<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Kind<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/key<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>MPEG audio file<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Size<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/key<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;integer<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>64803919<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/integer<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Total Time<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/key<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;integer<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>2700068<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/integer<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Year<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/key<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;integer<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>2006<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/integer<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Date Modified<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/key<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;date<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>2006-09-21T15:14:43Z<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/date<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Date Added<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/key<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;date<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>2006-09-21T15:14:43Z<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/date<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Bit Rate<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/key<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;integer<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>192<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/integer<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Sample Rate<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/key<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;integer<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>44100<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/integer<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Play Count<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/key<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;integer<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>22<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/integer<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Play Date<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/key<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;integer<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>3264149297<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/integer<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Play Date UTC<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/key<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;date<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>2007-06-08T16:08:17Z<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/date<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Release Date<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/key<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;date<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>2006-09-21T11:00:00Z<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/date<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Sort Album<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/key<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Gareth Emery Podcast<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Persistent ID<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/key<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>FE2067001E4F2C00<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Track Type<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/key<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>File<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Podcast<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/key<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;true</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Location<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>The%20Gareth%20Emery%20Podcast/Episode%2014.mp3<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>File Folder Count<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/key<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;integer<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>4<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/integer<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Library Folder Count<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/key<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;integer<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>1<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/integer<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/dict<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>The way they have this structured makes it impossible to do any E4X based XML processing of the playlist and consequently prevents your from using it in Flex or any other MVC based framework that allows you to easily hook an XML data source into components on the view layer.</p>
<p>So, as if you couldn&#8217;t guess, I wrote a class so that you can. You can use it to load in an iTunes XML playlist and turn it into something use-able that adheres to XML best practice where the structure is concerned. </p>
<p>Heres a sample of what it outputs:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;song<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Track_ID<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>511<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Track_ID<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Episode 34<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Artist<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Gareth Emery<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Artist<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Album<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>The Gareth Emery Podcast<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Album<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Genre<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Podcast<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Genre<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Kind<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>MPEG audio file<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Kind<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Size<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>64804016<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Size<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Total_Time<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>2700068<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Total_Time<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Year<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>2007<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Year<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Date_Modified<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>2007-07-24T16:29:57Z<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Date_Modified<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Date_Added<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>2007-07-24T16:29:57Z<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Date_Added<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Bit_Rate<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>192<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Bit_Rate<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Sample_Rate<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>44100<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Sample_Rate<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Release_Date<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>2007-07-19T22:00:00Z<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Release_Date<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Sort_Album<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Gareth Emery Podcast<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Sort_Album<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Sort_Name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Gareth Emery Podcast - Episode 34<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Sort_Name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Persistent_ID<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>DFA5DE7CE96B0316<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Persistent_ID<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Track_Type<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>File<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Track_Type<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Podcast</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Unplayed</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Location<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>The%20Gareth%20Emery%20Podcast/Episode%2034.mp3<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Location<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;File_Folder_Count<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>4<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/File_Folder_Count<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Library_Folder_Count<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>1<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Library_Folder_Count<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/song<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Much better, huh? Heres an example of how you can use it in your Flex/AS3.0 project.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">var</span> libraryPath:URLRequest = <span style="color: #000000; font-weight: bold;">new</span> URLRequest<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;testlibrary.xml&quot;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
	iTunesLibrary = <span style="color: #000000; font-weight: bold;">new</span> itunesXMLParser<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
	iTunesLibrary.<span style="color: #0066CC;">load</span><span style="color: #66cc66;">&#40;</span>libraryPath<span style="color: #66cc66;">&#41;</span>;
&nbsp;
	iTunesLibrary.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">COMPLETE</span>, loadHandler<span style="color: #66cc66;">&#41;</span>;
	iTunesLibrary.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>ProgressEvent.<span style="color: #006600;">PROGRESS</span>, progressHandler<span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> loadHandler<span style="color: #66cc66;">&#40;</span>event:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><span style="color: #66cc66;">&#123;</span>
	<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Library is done loading, lets do something cool with it&quot;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
	<span style="color: #808080; font-style: italic;">//trace(iTunesLibrary.playlistXML);</span>
&nbsp;
	<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;songs: &quot;</span>  + iTunesLibrary.<span style="color: #006600;">playlistXML</span>.<span style="color: #006600;">song</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
	<span style="color: #000000; font-weight: bold;">var</span> songList:XMLList = iTunesLibrary.<span style="color: #006600;">playlistXML</span>.<span style="color: #006600;">song</span>;
&nbsp;
	<span style="color: #808080; font-style: italic;">//trace(songList);</span>
&nbsp;
	dg_mx.<span style="color: #006600;">dataProvider</span> = songList;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> progressHandler<span style="color: #66cc66;">&#40;</span>event:ProgressEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><span style="color: #66cc66;">&#123;</span>
	<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;progressHandler loaded:&quot;</span> 
        + event.<span style="color: #0066CC;">bytesLoaded</span> + <span style="color: #ff0000;">&quot; total: &quot;</span> + event.<span style="color: #0066CC;">bytesTotal</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&lt;/</span>code<span style="color: #66cc66;">&gt;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>Note that it listens on all the same events as the normal XML class. In the loadHandler function above theres an example of how to hook this into a datagrid component in flex.</p>
<p>Thats it. Right now it only grabs songs, I&#8217;ll be adding support for multiple playlists later.</p>
<p>Download the class file <a href="http://ianmclean.name/itunesXMLParser/itunesXMLParser.zip" onclick="javascript:pageTracker._trackPageview('/outbound/article/ianmclean.name');">here</a></p>
<p>Download the example flex project <a href="http://ianmclean.name/itunesXMLParser/itunesXMLParserExample.zip" onclick="javascript:pageTracker._trackPageview('/outbound/article/ianmclean.name');">here</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.auricom.com/devote/import-your-itunes-playlist-into-as3-and-flex/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FLVinspector</title>
		<link>http://www.auricom.com/devote/flvinspector</link>
		<comments>http://www.auricom.com/devote/flvinspector#comments</comments>
		<pubDate>Sun, 29 Jul 2007 18:45:44 +0000</pubDate>
		<dc:creator>ian</dc:creator>
				<category><![CDATA[Air]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://devote.your.life.auricom.com/?p=33</guid>
		<description><![CDATA[One of things that I&#8217;ve always found a bit odd is that you can&#8217;t double click on an .flv video file and have it open up in the Flash player like a .swf would. Instead you have to wrap it in a .swf and open that, which is a big hassle. Some FLV compressors like [...]]]></description>
			<content:encoded><![CDATA[<p><img src='http://devote.your.life.auricom.com/wp-content/uploads/2007/07/flvinspector.jpg' alt='flvinspector.jpg' /></p>
<p>One of things that I&#8217;ve always found a bit odd is that you can&#8217;t double click on an .flv video file and have it open up in the Flash player like a .swf would. Instead you have to wrap it in a .swf and open that, which is a big hassle. Some FLV compressors like Sorenson Squeeze automatically generate the wrapper .swf for you, but lack playback controls. A better option is to use one of the many FLV players out there.  Unfortunately I&#8217;ve found that where most them have playback controls they don&#8217;t really give any of the juicy information about the video file that us developer types really need to get anything done.</p>
<p>Ideally when I&#8217;m working with FLV&#8217;s I&#8217;d like to be able to see what the position and duration is at all times so that I can easily determine timing for cue points I want to create. I also want to know the display dimensions and the file size, and for all of it I want the option to see the units in a number of different conversions. I also want to be able to drag and drop FLV files so I can very quickly preview them without having to dig 10 directories deep for a folder I already have open.</p>
<p>So, you guessed it, I went ahead and made an AIR application to do just this. Its called FLVinspector.  Heres a summary of the features:</p>
<ul>
<li>Drag and drop FLV videos onto the application window</li>
<li>Browse and load FLV videos from the local filesystem</li>
<li>Reports display size, file size, position and duration</li>
<li>Change the time and size units settings in the preferences (ms, s, m, B, KB, MB)</li>
</ul>
<p><a href="http://ianmclean.name/FLVinspector/FLVinspector.air" onclick="javascript:pageTracker._trackPageview('/outbound/article/ianmclean.name');">Click here to Install FLVinspector 1.0Beta2</a></p>
<p><em>*update: currently there is a bug with getting the filesize on FLV&#8217;s that have been dragged in. I&#8217;ll post an updated version when I get the chance.</em> <font color="red">(FIXED, version is now 1.0Beta2)</font></p>
]]></content:encoded>
			<wfw:commentRss>http://www.auricom.com/devote/flvinspector/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Showcast</title>
		<link>http://www.auricom.com/devote/showcast</link>
		<comments>http://www.auricom.com/devote/showcast#comments</comments>
		<pubDate>Wed, 31 Jan 2007 22:14:40 +0000</pubDate>
		<dc:creator>ian</dc:creator>
				<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://auricom.com/devote/?p=5</guid>
		<description><![CDATA[Showcast is a tool for performers to broadcast their shows live over the internet. It makes use of Flash and Flash Media Server. Perhaps the most desireable thing about Showcast is that it is entirely web-based, meaning that anyone with an internet connection and a camera can broadcast with absolutely no setup. This project is [...]]]></description>
			<content:encoded><![CDATA[<p>Showcast is a tool for performers to broadcast their shows live over the internet. It makes use of Flash and Flash Media Server. Perhaps the most desireable thing about Showcast is that it is entirely web-based, meaning that anyone with an internet connection and a camera can broadcast with absolutely no setup.</p>
<p>This project is currently under development. Still not certain if this will be open source or not.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.auricom.com/devote/showcast/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
