<?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/"
	>

<channel>
	<title>AaronHardy.com :: For all your Aaron Hardy needs.</title>
	<atom:link href="http://aaronhardy.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://aaronhardy.com</link>
	<description>For all your Aaron Hardy needs.</description>
	<pubDate>Wed, 10 Mar 2010 19:44:58 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Greener Pastures</title>
		<link>http://aaronhardy.com/life-in-general/greener-pastures/</link>
		<comments>http://aaronhardy.com/life-in-general/greener-pastures/#comments</comments>
		<pubDate>Wed, 10 Mar 2010 19:41:01 +0000</pubDate>
		<dc:creator>Aaron Hardy</dc:creator>
		
		<category><![CDATA[Life in General]]></category>

		<category><![CDATA[best dance you have ever personally witnessed]]></category>

		<category><![CDATA[cup dancer]]></category>

		<category><![CDATA[Flex]]></category>

		<category><![CDATA[quiznos]]></category>

		<category><![CDATA[quiznos cup]]></category>

		<guid isPermaLink="false">http://aaronhardy.com/?p=515</guid>
		<description><![CDATA[You may have already figured out that Flex development is my primary skill these days.  I would say I develop, talk, dream, or think about Flex a large majority of each living day.  Today, I&#8217;ve decided to branch out into other skills.
Effective immediately, I&#8217;m extending an invitation to all Quiznos franchisees to contact [...]]]></description>
			<content:encoded><![CDATA[<p>You may have already figured out that Flex development is my primary skill these days.  I would say I develop, talk, dream, or think about Flex a large majority of each living day.  Today, I&#8217;ve decided to branch out into other skills.</p>
<p>Effective immediately, I&#8217;m extending an invitation to all Quiznos franchisees to <a href="/contact-me" target="_blank">contact me</a> for employment as a Quiznos Cup Dancer.  But here are my demands:</p>
<ul>
<li>I must wear the Quiznos cup (<a href="http://aaronhardy.com/wp-content/uploads/2010/03/quiznos_cup.jpg" target="_blank">illustrated here</a>).</li>
<li>I must wear it for a single hour, after which I may and will terminate my employment.</li>
<li>I must pay you, Quiznos, the hourly wage you would normally pay a Quiznos Cup Dancer.</li>
<li>I must promise to commit my full efforts to provide the best Quiznos Cup Dance you have ever personally witnessed.</li>
</ul>
<p><a href="/contact-me" target="_blank">Contact me.</a>  I&#8217;m waiting.  Little Caesars franchisees need not apply.</p>
]]></content:encoded>
			<wfw:commentRss>http://aaronhardy.com/life-in-general/greener-pastures/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Queue N Cache</title>
		<link>http://aaronhardy.com/flex/queue-n-cache/</link>
		<comments>http://aaronhardy.com/flex/queue-n-cache/#comments</comments>
		<pubDate>Wed, 10 Mar 2010 00:18:36 +0000</pubDate>
		<dc:creator>Aaron Hardy</dc:creator>
		
		<category><![CDATA[Flex]]></category>

		<category><![CDATA[360|Flex]]></category>

		<category><![CDATA[cache]]></category>

		<category><![CDATA[cacheAsBitmap]]></category>

		<category><![CDATA[queue]]></category>

		<guid isPermaLink="false">http://aaronhardy.com/?p=415</guid>
		<description><![CDATA[As promised, below you can find the source code and slides from my Queue N Cache presentation from the 360&#124;Flex conference.  For those who were there, thanks for coming.  I really enjoy learning with you all and being able to share when I can.
First, the sample application for queuing and caching.  Keep [...]]]></description>
			<content:encoded><![CDATA[<p>As promised, below you can find the source code and slides from my Queue N Cache presentation from the <a href="http://www.360flex.com/" target="_blank">360|Flex conference</a>.  For those who were there, thanks for coming.  I really enjoy learning with you all and being able to share when I can.</p>
<p>First, the <a href="/samples/queuencache/queuencache/QueueNCache.html" target="_blank">sample application</a> for queuing and caching.  Keep in mind that images loaded into the application will be cached in the browser, so depending on what you&#8217;re wanting to test you may need to clear your browser cache between tests.  Right-click the application to access the source.</p>
<p>Second, the presentation slides.  Here they are as a &#8220;slidecast&#8221; but they&#8217;re a little different than the live ones.  I think the live video will be made available shortly so if you&#8217;re looking for that check back later.  Also, this slidecast was made through SlideShare and their audio-syncing tool is a little limiting so the audio might get unsynced for a moment.  In any case, enjoy!</p>
<div id="__ss_3331486" style="width: 100%;"><object width="100%" height="470" data="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=presoforweb-100303223327-phpapp01&amp;rel=0&amp;stripped_title=queue-n-cache-3331486" type="application/x-shockwave-flash"><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="src" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=presoforweb-100303223327-phpapp01&amp;rel=0&amp;stripped_title=queue-n-cache-3331486" /><param name="allowfullscreen" value="true" /></object></div>
]]></content:encoded>
			<wfw:commentRss>http://aaronhardy.com/flex/queue-n-cache/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Sneak Peek: Queue N Cache</title>
		<link>http://aaronhardy.com/flex/sneak-peek-queue-n-cache/</link>
		<comments>http://aaronhardy.com/flex/sneak-peek-queue-n-cache/#comments</comments>
		<pubDate>Thu, 11 Feb 2010 03:33:29 +0000</pubDate>
		<dc:creator>Aaron Hardy</dc:creator>
		
		<category><![CDATA[Flex]]></category>

		<category><![CDATA[360|Flex]]></category>

		<category><![CDATA[cache]]></category>

		<category><![CDATA[queue]]></category>

		<guid isPermaLink="false">http://aaronhardy.com/?p=413</guid>
		<description><![CDATA[The 360&#124;Flex conference is nigh upon us.  Don&#8217;t miss out on an excellent opportunity to be one with your species and discuss all things Flex.  If you haven&#8217;t yet picked up your ticket, you best get on it!  The conference starts on the 7th of March and runs through the 10th in [...]]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://www.360flex.com/" target="_blank">360|Flex conference</a> is nigh upon us.  Don&#8217;t miss out on an excellent opportunity to be one with your species and discuss all things Flex.  If you haven&#8217;t yet picked up your ticket, you best <a href="http://360flex-aaronh.eventbrite.com/" target="_blank">get on it</a>!  The conference starts on the 7th of March and runs through the 10th in sunny San Jose, CA.</p>
<p>This year, yours truly will be presenting the topic Queue N Cache.  With a name like that, I&#8217;m sure flexers worldwide will be scrambling for a seat.  I know I know, you&#8217;re thinking, &#8220;Queuing and caching?  That oughtta be a party.&#8221;  No.  It&#8217;s Queue <strong>*N*</strong> Cache and that&#8217;s one party that runs year-round.  Oh sure, we&#8217;ll talk a little about the ho-hum of your grandma&#8217;s queues and caches, but this is where rubber meets the road with real-world projects and situations where queuing and caching can achieve greatness.  Have you ever sat back and wondered:</p>
<ul>
<li>How could I improve user experience by paying more attention to the user&#8217;s focus?</li>
<li>How could I have greater control over my service calls and asset loaders?  Timeouts and retries?  Call me crazy.</li>
<li>How could I decrease memory usage and processing load by sharing image data?</li>
<li>How could I increase responsiveness through improved data management?</li>
<li>How could I show progress of shared image data in multiple locations?</li>
</ul>
<p>If you can&#8217;t make it (Tuesday @ 2:30) or just can&#8217;t get enough, I&#8217;ll post my slides and code after the preso and you can dig in to your heart&#8217;s content.  See you there!</p>
]]></content:encoded>
			<wfw:commentRss>http://aaronhardy.com/flex/sneak-peek-queue-n-cache/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Flex 4 with a Hint of AIR 2</title>
		<link>http://aaronhardy.com/flex/flex-4-with-a-hint-of-air-2/</link>
		<comments>http://aaronhardy.com/flex/flex-4-with-a-hint-of-air-2/#comments</comments>
		<pubDate>Fri, 05 Feb 2010 04:57:12 +0000</pubDate>
		<dc:creator>Aaron Hardy</dc:creator>
		
		<category><![CDATA[Flex]]></category>

		<category><![CDATA[air 2]]></category>

		<category><![CDATA[flex 4]]></category>

		<category><![CDATA[gumbo]]></category>

		<category><![CDATA[presentation]]></category>

		<guid isPermaLink="false">http://aaronhardy.com/?p=409</guid>
		<description><![CDATA[Here&#8217;s my presentation from today&#8217;s training at Rain entitled Flex 4 with a Hint of AIR 2.  Enjoy!
]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s my presentation from today&#8217;s training at <a href="http://mediarain.com" target="_blank">Rain</a> entitled <a href="http://docs.google.com/present/edit?id=0AQVjhnbUC6Z1ZGZ2dDl0NG5fMGRwc3JwNWc0&#038;hl=en" target="_blank">Flex 4 with a Hint of AIR 2</a>.  Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://aaronhardy.com/flex/flex-4-with-a-hint-of-air-2/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Finding nodes with a namespaced attribute using e4x</title>
		<link>http://aaronhardy.com/flex/finding-nodes-with-a-namespaced-attribute-using-e4x/</link>
		<comments>http://aaronhardy.com/flex/finding-nodes-with-a-namespaced-attribute-using-e4x/#comments</comments>
		<pubDate>Sun, 20 Dec 2009 04:05:24 +0000</pubDate>
		<dc:creator>Aaron Hardy</dc:creator>
		
		<category><![CDATA[Flex]]></category>

		<category><![CDATA[General Programming]]></category>

		<category><![CDATA[e4x namespace attribute hasOwnProperty XML]]></category>

		<guid isPermaLink="false">http://aaronhardy.com/?p=395</guid>
		<description><![CDATA[When digging through XML, e4x is definitely your friend but it can be tricky sometimes.  I recently came across a situation where I needed to find all nodes with a certain namespaced attribute.  I didn&#8217;t care what the attribute&#8217;s value was; I just needed to know which nodes had the attribute.
Take the following [...]]]></description>
			<content:encoded><![CDATA[<p>When digging through XML, e4x is definitely your friend but it can be tricky sometimes.  I recently came across a situation where I needed to find all nodes with a certain namespaced attribute.  I didn&#8217;t care what the attribute&#8217;s value was; I just needed to know which nodes had the attribute.<span id="more-395"></span></p>
<p>Take the following XML:</p>

<div class="wp_syntax"><div class="code"><pre class="xml xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;catalog</span> <span style="color: #000066;">xmlns:ah</span>=<span style="color: #ff0000;">&quot;http://aaronhardy.com/music&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;cd<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;title<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Empire Burlesque<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/title<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> <span style="color: #000066;">ah:verified</span>=<span style="color: #ff0000;">&quot;false&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>Bob Dylan<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;country<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>USA<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/country<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;company<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Columbia<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/company<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;price<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>10.90<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/price<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>1985<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;/cd<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;cd<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;title<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Hide your heart<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/title<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>Bonnie Tyler<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;country<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>UK<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/country<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;company<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>CBS Records<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/company<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;price<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>9.90<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/price<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>1988<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;/cd<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;cd<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;title</span> <span style="color: #000066;">ah:verified</span>=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>Greatest Hits<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/title<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>Dolly Parton<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;country<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>USA<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/country<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;company<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>RCA<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/company<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;price<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>9.90<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/price<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>1982<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;/cd<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;cd</span> <span style="color: #000066;">ah:verified</span>=<span style="color: #ff0000;">&quot;false&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;title</span> <span style="color: #000066;">ah:verified</span>=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>Still got the blues<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/title<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>Gary Moore<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;country<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>UK<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/country<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;company<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Virgin records<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/company<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;price<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>10.20<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/price<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>1990<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;/cd<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;cd<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;title<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Eros<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/title<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>Eros Ramazzotti<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;country</span> <span style="color: #000066;">ah:verified</span>=<span style="color: #ff0000;">&quot;false&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>EU<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/country<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;company<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>BMG<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/company<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;price<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>9.90<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/price<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>1997<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;/cd<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/catalog<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>In this case I&#8217;m trying to find all nodes that have a &#8220;verified&#8221; attribute.  Again, I don&#8217;t care if the attribute&#8217;s value is true or false.  If the attribute weren&#8217;t in the &#8220;ah&#8221; namespace I would use this line of code:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript actionscript" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">var</span> nodes:XMLList = myXML..<span style="color: #66cc66;">*</span>.<span style="color: #66cc66;">&#40;</span>hasOwnProperty<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'@verified'</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>However, when the attribute is in a namespace, it&#8217;s my understanding that hasOwnProperty() is no longer effective.  At least those are my finding based on trial-and-error and online research.  Instead, you can try this workaround:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript actionscript" style="font-family:monospace;"><span style="color: #66cc66;">&lt;</span>?<span style="color: #0066CC;">xml</span> <span style="color: #0066CC;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #66cc66;">&gt;</span>
<span style="color: #66cc66;">&lt;</span>mx:Application xmlns:mx=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span> layout=<span style="color: #ff0000;">&quot;absolute&quot;</span> creationComplete=<span style="color: #ff0000;">&quot;cc()&quot;</span><span style="color: #66cc66;">&gt;</span>
	<span style="color: #66cc66;">&lt;</span>mx:Script<span style="color: #66cc66;">&gt;</span>
		<span style="color: #66cc66;">&lt;!</span><span style="color: #66cc66;">&#91;</span>CDATA<span style="color: #66cc66;">&#91;</span>
			protected <span style="color: #000000; font-weight: bold;">function</span> cc<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
			<span style="color: #66cc66;">&#123;</span>
				<span style="color: #000000; font-weight: bold;">var</span> myXML:<span style="color: #0066CC;">XML</span> = 
					<span style="color: #66cc66;">&lt;</span>catalog xmlns:ah=<span style="color: #ff0000;">&quot;http://aaronhardy.com/music&quot;</span><span style="color: #66cc66;">&gt;</span>
						<span style="color: #66cc66;">&lt;</span>cd<span style="color: #66cc66;">&gt;</span>
							<span style="color: #66cc66;">&lt;</span>title<span style="color: #66cc66;">&gt;</span>Empire Burlesque<span style="color: #66cc66;">&lt;/</span>title<span style="color: #66cc66;">&gt;</span>
							<span style="color: #66cc66;">&lt;</span>artist ah:verified=<span style="color: #ff0000;">&quot;false&quot;</span><span style="color: #66cc66;">&gt;</span>Bob Dylan<span style="color: #66cc66;">&lt;/</span>artist<span style="color: #66cc66;">&gt;</span>
							<span style="color: #66cc66;">&lt;</span>country<span style="color: #66cc66;">&gt;</span>USA<span style="color: #66cc66;">&lt;/</span>country<span style="color: #66cc66;">&gt;</span>
							<span style="color: #66cc66;">&lt;</span>company<span style="color: #66cc66;">&gt;</span>Columbia<span style="color: #66cc66;">&lt;/</span>company<span style="color: #66cc66;">&gt;</span>
							<span style="color: #66cc66;">&lt;</span>price<span style="color: #66cc66;">&gt;</span><span style="color: #cc66cc;">10.90</span><span style="color: #66cc66;">&lt;/</span>price<span style="color: #66cc66;">&gt;</span>
							<span style="color: #66cc66;">&lt;</span>year<span style="color: #66cc66;">&gt;</span><span style="color: #cc66cc;">1985</span><span style="color: #66cc66;">&lt;/</span>year<span style="color: #66cc66;">&gt;</span>
						<span style="color: #66cc66;">&lt;/</span>cd<span style="color: #66cc66;">&gt;</span>
						<span style="color: #66cc66;">&lt;</span>cd<span style="color: #66cc66;">&gt;</span>
							<span style="color: #66cc66;">&lt;</span>title<span style="color: #66cc66;">&gt;</span>Hide your heart<span style="color: #66cc66;">&lt;/</span>title<span style="color: #66cc66;">&gt;</span>
							<span style="color: #66cc66;">&lt;</span>artist<span style="color: #66cc66;">&gt;</span>Bonnie Tyler<span style="color: #66cc66;">&lt;/</span>artist<span style="color: #66cc66;">&gt;</span>
							<span style="color: #66cc66;">&lt;</span>country<span style="color: #66cc66;">&gt;</span>UK<span style="color: #66cc66;">&lt;/</span>country<span style="color: #66cc66;">&gt;</span>
							<span style="color: #66cc66;">&lt;</span>company<span style="color: #66cc66;">&gt;</span>CBS Records<span style="color: #66cc66;">&lt;/</span>company<span style="color: #66cc66;">&gt;</span>
							<span style="color: #66cc66;">&lt;</span>price<span style="color: #66cc66;">&gt;</span><span style="color: #cc66cc;">9.90</span><span style="color: #66cc66;">&lt;/</span>price<span style="color: #66cc66;">&gt;</span>
							<span style="color: #66cc66;">&lt;</span>year<span style="color: #66cc66;">&gt;</span><span style="color: #cc66cc;">1988</span><span style="color: #66cc66;">&lt;/</span>year<span style="color: #66cc66;">&gt;</span>
						<span style="color: #66cc66;">&lt;/</span>cd<span style="color: #66cc66;">&gt;</span>
						<span style="color: #66cc66;">&lt;</span>cd<span style="color: #66cc66;">&gt;</span>
							<span style="color: #66cc66;">&lt;</span>title ah:verified=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #66cc66;">&gt;</span>Greatest Hits<span style="color: #66cc66;">&lt;/</span>title<span style="color: #66cc66;">&gt;</span>
							<span style="color: #66cc66;">&lt;</span>artist<span style="color: #66cc66;">&gt;</span>Dolly Parton<span style="color: #66cc66;">&lt;/</span>artist<span style="color: #66cc66;">&gt;</span>
							<span style="color: #66cc66;">&lt;</span>country<span style="color: #66cc66;">&gt;</span>USA<span style="color: #66cc66;">&lt;/</span>country<span style="color: #66cc66;">&gt;</span>
							<span style="color: #66cc66;">&lt;</span>company<span style="color: #66cc66;">&gt;</span>RCA<span style="color: #66cc66;">&lt;/</span>company<span style="color: #66cc66;">&gt;</span>
							<span style="color: #66cc66;">&lt;</span>price<span style="color: #66cc66;">&gt;</span><span style="color: #cc66cc;">9.90</span><span style="color: #66cc66;">&lt;/</span>price<span style="color: #66cc66;">&gt;</span>
							<span style="color: #66cc66;">&lt;</span>year<span style="color: #66cc66;">&gt;</span><span style="color: #cc66cc;">1982</span><span style="color: #66cc66;">&lt;/</span>year<span style="color: #66cc66;">&gt;</span>
						<span style="color: #66cc66;">&lt;/</span>cd<span style="color: #66cc66;">&gt;</span>
						<span style="color: #66cc66;">&lt;</span>cd ah:verified=<span style="color: #ff0000;">&quot;false&quot;</span><span style="color: #66cc66;">&gt;</span>
							<span style="color: #66cc66;">&lt;</span>title ah:verified=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #66cc66;">&gt;</span>Still got the blues<span style="color: #66cc66;">&lt;/</span>title<span style="color: #66cc66;">&gt;</span>
							<span style="color: #66cc66;">&lt;</span>artist<span style="color: #66cc66;">&gt;</span>Gary Moore<span style="color: #66cc66;">&lt;/</span>artist<span style="color: #66cc66;">&gt;</span>
							<span style="color: #66cc66;">&lt;</span>country<span style="color: #66cc66;">&gt;</span>UK<span style="color: #66cc66;">&lt;/</span>country<span style="color: #66cc66;">&gt;</span>
							<span style="color: #66cc66;">&lt;</span>company<span style="color: #66cc66;">&gt;</span>Virgin records<span style="color: #66cc66;">&lt;/</span>company<span style="color: #66cc66;">&gt;</span>
							<span style="color: #66cc66;">&lt;</span>price<span style="color: #66cc66;">&gt;</span><span style="color: #cc66cc;">10.20</span><span style="color: #66cc66;">&lt;/</span>price<span style="color: #66cc66;">&gt;</span>
							<span style="color: #66cc66;">&lt;</span>year<span style="color: #66cc66;">&gt;</span><span style="color: #cc66cc;">1990</span><span style="color: #66cc66;">&lt;/</span>year<span style="color: #66cc66;">&gt;</span>
						<span style="color: #66cc66;">&lt;/</span>cd<span style="color: #66cc66;">&gt;</span>
						<span style="color: #66cc66;">&lt;</span>cd<span style="color: #66cc66;">&gt;</span>
							<span style="color: #66cc66;">&lt;</span>title<span style="color: #66cc66;">&gt;</span>Eros<span style="color: #66cc66;">&lt;/</span>title<span style="color: #66cc66;">&gt;</span>
							<span style="color: #66cc66;">&lt;</span>artist<span style="color: #66cc66;">&gt;</span>Eros Ramazzotti<span style="color: #66cc66;">&lt;/</span>artist<span style="color: #66cc66;">&gt;</span>
							<span style="color: #66cc66;">&lt;</span>country ah:verified=<span style="color: #ff0000;">&quot;false&quot;</span><span style="color: #66cc66;">&gt;</span>EU<span style="color: #66cc66;">&lt;/</span>country<span style="color: #66cc66;">&gt;</span>
							<span style="color: #66cc66;">&lt;</span>company<span style="color: #66cc66;">&gt;</span>BMG<span style="color: #66cc66;">&lt;/</span>company<span style="color: #66cc66;">&gt;</span>
							<span style="color: #66cc66;">&lt;</span>price<span style="color: #66cc66;">&gt;</span><span style="color: #cc66cc;">9.90</span><span style="color: #66cc66;">&lt;/</span>price<span style="color: #66cc66;">&gt;</span>
							<span style="color: #66cc66;">&lt;</span>year<span style="color: #66cc66;">&gt;</span><span style="color: #cc66cc;">1997</span><span style="color: #66cc66;">&lt;/</span>year<span style="color: #66cc66;">&gt;</span>
						<span style="color: #66cc66;">&lt;/</span>cd<span style="color: #66cc66;">&gt;</span>
					<span style="color: #66cc66;">&lt;/</span>catalog<span style="color: #66cc66;">&gt;</span>;
&nbsp;
				<span style="color: #000000; font-weight: bold;">var</span> ns_ah:Namespace = <span style="color: #000000; font-weight: bold;">new</span> Namespace<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'http://aaronhardy.com/music'</span><span style="color: #66cc66;">&#41;</span>;
				<span style="color: #000000; font-weight: bold;">var</span> verified:QName = <span style="color: #000000; font-weight: bold;">new</span> QName<span style="color: #66cc66;">&#40;</span>ns_ah, <span style="color: #ff0000;">'verified'</span><span style="color: #66cc66;">&#41;</span>;
				<span style="color: #000000; font-weight: bold;">var</span> nodes:XMLList = myXML..<span style="color: #66cc66;">*</span>.<span style="color: #66cc66;">&#40;</span>attribute<span style="color: #66cc66;">&#40;</span>verified<span style="color: #66cc66;">&#41;</span>.<span style="color: #0066CC;">length</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&gt;</span> 0<span style="color: #66cc66;">&#41;</span>;
				<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span>nodes.<span style="color: #006600;">toXMLString</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #66cc66;">&#125;</span>
		<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&gt;</span>
	<span style="color: #66cc66;">&lt;/</span>mx:Script<span style="color: #66cc66;">&gt;</span>
<span style="color: #66cc66;">&lt;/</span>mx:Application<span style="color: #66cc66;">&gt;</span></pre></div></div>

<p>Hope that helps someone!</p>
]]></content:encoded>
			<wfw:commentRss>http://aaronhardy.com/flex/finding-nodes-with-a-namespaced-attribute-using-e4x/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Insurance and Pre-existing Conditions</title>
		<link>http://aaronhardy.com/politics/insurance-and-pre-existing-conditions/</link>
		<comments>http://aaronhardy.com/politics/insurance-and-pre-existing-conditions/#comments</comments>
		<pubDate>Sun, 08 Nov 2009 23:30:41 +0000</pubDate>
		<dc:creator>Aaron Hardy</dc:creator>
		
		<category><![CDATA[Politics]]></category>

		<category><![CDATA[group insurance]]></category>

		<category><![CDATA[health insurance]]></category>

		<category><![CDATA[individual insurance]]></category>

		<category><![CDATA[insurance]]></category>

		<category><![CDATA[pre-existing condition]]></category>

		<guid isPermaLink="false">http://aaronhardy.com/?p=373</guid>
		<description><![CDATA[Ah, &#8220;pre-existing conditions.&#8221;  A couple words that bring us all together in peace and harmony and close the gap amongst parties, races, and economic classes.  Uniting words for all of us to use as joint artillery against the evil insurance companies that stand behind their faceless discriminatory practices.  A concept that the [...]]]></description>
			<content:encoded><![CDATA[<p>Ah, &#8220;pre-existing conditions.&#8221;  A couple words that bring us all together in peace and harmony and close the gap amongst parties, races, and economic classes.  Uniting words for all of us to use as joint artillery against the evil insurance companies that stand behind their faceless discriminatory practices.  A concept that the most inhumane of inhumane would indisputably agree is inhumane.</p>
<p>Except me.  Wikipedia defines insurance as &#8220;a form of <strong>risk management</strong> primarily used to <strong>hedge</strong> against the <strong>risk</strong> of a <strong>contingent</strong> loss. Insurance is defined as the equitable transfer of the <strong>risk</strong> of a loss, from one entity to another, in exchange for a premium, and can be thought of as a guaranteed and known small loss to <strong>prevent</strong> a large, possibly devastating loss.&#8221;</p>
<p>In other words, insurance is basically a big group of people that are willing to pay a little now to prevent the possibility of paying a large amount later due to some unfortunate, unforeseen occurrence.  Insurance can exist because only a relatively small portion of insured are going to become critically injured or sick.  From another perspective, this means that a majority of the insured are putting in more than they are taking out.  But they keep putting money in because they know they may someday be one of the lucky losers.  Not all the insured will or can be lucky losers; not enough money would exist to pay for the expenses.  Insurance would cease to exist.<span id="more-373"></span></p>
<p>Some people, politicians or otherwise, feel it&#8217;s a discriminatory act to deny someone coverage because of a pre-existing condition.  After all, someone with a disease has even greater need for insurance than someone who does not.  While I agree, I do not agree they reserve the right to be granted insurance after having being diagnosed.  Insurance is not a charity nor is it welfare.  It is a hedge against risk and those who have been hedging for years should not be required to pay for someone who has failed to do so.</p>
<p>Let&#8217;s imagine this hypothetical scenario.  One day the government drafts a program to help subsidize cars and has decided to fund it with approximately <a href="http://www.dot.gov/affairs/2009/dot13309.htm" target="_blank">$3 billion</a>.  I know, I know, it&#8217;s a crazy stupid idea but stick with me.  To make it sound a little more legitimate and family friendly we&#8217;ll call it something like Cash for Junkers.  Since there are approximately 300 million citizens, the government has decided to pay for the program by randomly selecting one out of everyone 1,000 people to pay $10,000.</p>
<p>&#8220;Wow,&#8221; you say, &#8220;What if I&#8217;m the the lucky loser?  I can&#8217;t afford a sudden $10,000 fee!&#8221;  So you get together with some of your friends, family, and neighbors and find 999 other people that would like to spread out the risk.  You figure that odds are one of you is going to be a lucky loser, so you each agree to put in $10.  The lottery day comes and sure enough, one of your peeps is chosen to be a lucky loser.  Lucky him&#8211;he&#8217;s only out $10!  Soon after the lottery some of your other neighbors that decided not to put $10 into the pot come knocking on your door and say, &#8220;Hey, you know that &#8217;spread the risk&#8217; thing you were talking about doing?  Can we join now?&#8221;</p>
<p>Hellz no!  Does that seem &#8220;fair&#8221; to you?  Does it seem &#8220;fair&#8221; to the other 999 that decided to hedge their risk?  Regardless of your reason to not throw a Hamilton into the pot, you didn&#8217;t.  And you&#8217;re not going to make other people pay because of it.</p>
<p>This is insurance.  Why can people complain to no end about insurance companies not allowing pre-existing conditions?  Because they can blame insurance companies, the facade, not the people who are already paying their dues.  Can you find a big group of people that want to allow pre-existing conditions into their pot and pay more because of it?  Then <em>you</em> start an insurance company.</p>
<p>Before you determine I&#8217;m a purely heartless soul, let me give you some background.  My own family has sought a health insurance plan when going from a government-sponsored health plan (my wife was a teacher) to an individual plan (I was working for a start-up that didn&#8217;t have group insurance).  And I was planning on knocking my wife up soon (which, by the way, qualifies as a pre-existing condition if I were to have knocked her up within one year of signing onto the new plan).  For several years we were also only on the giving end of insurance&#8211;dumping money into the pot and hardly ever taking any out.  On the other hand, over the last three months we&#8217;ve been the lucky losers and have taken out several times more from the pot than we&#8217;ve ever put in.</p>
<p>More than anything, I&#8217;m as frustrated as you are that changing jobs means changing health insurance plans and dealing with pre-existing conditions.  But let&#8217;s not fight the wrong battle.  Pre-existing conditions are not the problem, third-party pay systems are.  Why can&#8217;t you stay in the same insurance pot when you change employers?  Why do employers have anything to do with it anyway?  If I never have a lapse in <em>my</em> health insurance plan, then I don&#8217;t have to worry about pre-existing conditions in the first place.  Stay focused on the real problems, not the latest political cusswords.</p>
]]></content:encoded>
			<wfw:commentRss>http://aaronhardy.com/politics/insurance-and-pre-existing-conditions/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Showing Progress for Multiple Loaders</title>
		<link>http://aaronhardy.com/flex/showing-progress-for-multiple-loaders/</link>
		<comments>http://aaronhardy.com/flex/showing-progress-for-multiple-loaders/#comments</comments>
		<pubDate>Sun, 18 Oct 2009 04:28:00 +0000</pubDate>
		<dc:creator>Aaron Hardy</dc:creator>
		
		<category><![CDATA[Flex]]></category>

		<category><![CDATA[bytesLoaded]]></category>

		<category><![CDATA[bytesTotal]]></category>

		<category><![CDATA[Loader]]></category>

		<category><![CDATA[LoaderInfo]]></category>

		<category><![CDATA[overall progress]]></category>

		<category><![CDATA[progress indicator]]></category>

		<category><![CDATA[URLLoader]]></category>

		<guid isPermaLink="false">http://aaronhardy.com/?p=365</guid>
		<description><![CDATA[A common thing to do in most any rich application is to show progress while loading remote assets.  In ActionScript, the bytesLoaded and bytesTotal properties of classes such as LoaderInfo and URLLoader provide the needed information to show a fancy percentage-based progress indicator.  The bytesLoaded property is updated as more and more of [...]]]></description>
			<content:encoded><![CDATA[<p>A common thing to do in most any rich application is to show progress while loading remote assets.  In ActionScript, the bytesLoaded and bytesTotal properties of classes such as <a href="http://livedocs.adobe.com/flex/3/langref/flash/display/LoaderInfo.html" target="_blank">LoaderInfo</a> and <a href="http://livedocs.adobe.com/flex/3/langref/flash/net/URLLoader.html" target="_blank">URLLoader</a> provide the needed information to show a fancy percentage-based progress indicator.  The bytesLoaded property is updated as more and more of the asset is loaded in.  Divide that by the bytesTotal and you have the percentage loaded.</p>
<p>Easy enough.  How about multiple loaders?  Lets say you have a group of 10 images and you&#8217;d like to show progress for all the images collectively.  Because you have 10 different images you also have 10 different URLLoader instances (or Loader instances, whatever suits your fancy)&#8211;one for each image.  Math would say that you divide the sum of bytesLoaded by the sum of bytesTotal and that gives you the percentage complete.  Two issues arise:<span id="more-365"></span></p>
<p>(1) The progress indicator really shouldn&#8217;t be involved with handling all these loaders and tallying their numbers.  Its purpose is to display the percentage loaded and it should stick to what it does best.</p>
<p>(2) One important thing to know about ActionScript classes that expose progress information is that the bytesTotal property is not populated until the server responds to the request (until the HTTP headers are received).  This makes things a little more complex.  Let&#8217;s say the first loader begins loading an image and it gets a few bytes loaded in.  At this point we for sure know how many total bytes the loader eventually will have loaded, but the other loaders may still be waiting for a response from the server and therefore their bytesTotal properties are still hanging out at 0.  What&#8217;s your denominator to determine overall percentage?  One option is to know the total number of bytes for each image before the loading process begins.  This information would need to be available beforehand through some sort of service call.  The more simple and usually sufficient approach is to take the number of completed loaders divided by the total number of loaders to determine the percentage loaded.  It&#8217;s not as granular as dealing with bytes, but it can be a good alternative for showing overall progress.</p>
<p>Below is a class I use to simplify this process and consolidate different objects that provide progress information.  Instances of information-providing classes such as LoaderInfo and URLLoader are registered using the register() method.  As the loaders progress, the percentLoaded property is updated and progress events are dispatched.  If only a single loader is registered, percentLoaded will reflect bytesLoaded/bytesTotal.  If multiple loaders are registered, percentLoaded will reflect loaders complete/loaders total.  When all loaders have completed loading, a complete event is dispatched.  Enjoy!</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript actionscript" style="font-family:monospace;">package com.<span style="color: #006600;">aaronhardy</span>.<span style="color: #006600;">utils</span>
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">events</span>.<span style="color: #006600;">Event</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">events</span>.<span style="color: #006600;">EventDispatcher</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">events</span>.<span style="color: #006600;">IEventDispatcher</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">events</span>.<span style="color: #006600;">IOErrorEvent</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">events</span>.<span style="color: #006600;">ProgressEvent</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">utils</span>.<span style="color: #006600;">setTimeout</span>;
&nbsp;
	<span style="color: #66cc66;">&#91;</span>Event<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">name</span>=<span style="color: #ff0000;">&quot;progress&quot;</span>, <span style="color: #0066CC;">type</span>=<span style="color: #ff0000;">&quot;flash.events.ProgressEvent&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#93;</span>
	<span style="color: #66cc66;">&#91;</span>Event<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">name</span>=<span style="color: #ff0000;">&quot;complete&quot;</span>, <span style="color: #0066CC;">type</span>=<span style="color: #ff0000;">&quot;flash.events.Event&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#93;</span>
	<span style="color: #808080; font-style: italic;">/**
	 * A object which consolidates a group of objects that provide progress information.  Types
	 * of objects include UrlLoader and LoaderInfo objects. This allows a simple way for displaying
	 * overall progress for multiple loaders.
	 * 
	 * When a single loader is registered, the percentLoaded is simply the bytes loaded divided by
	 * the bytes total for the loader.  When there are multiple loaders registered, percentLoaded
	 * reflects the number of loaders completed divided by the total number of registered loaders.
	 * The reason why using multiple loaders is less accurate is because a loader does not know
	 * how many bytes it will be loading until the first response from the server.
	 * This means that we can't determine the total number of bytes to be loaded
	 * for all registered loaders up front.
	 */</span>
	<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> BatchLoaderInfo <span style="color: #0066CC;">extends</span> EventDispatcher
	<span style="color: #66cc66;">&#123;</span>
		<span style="color: #66cc66;">&#91;</span>Bindable<span style="color: #66cc66;">&#93;</span>
		<span style="color: #808080; font-style: italic;">/**
		 * The percentage of all registered loaders which are loaded.
		 * When there is a single loader, this is simply the bytes loaded divided by the bytes total
		 * for the loader.  When there are multiple loaders, this is the number of loaders
		 * which have completed their loading process divided by the total number of registered
		 * loaders.  This value is between 0 and 1.
		 * @see doUpdateStats
		 */</span>
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> percentLoaded:<span style="color: #0066CC;">Number</span>;
&nbsp;
		<span style="color: #808080; font-style: italic;">/**
		 * @private
		 * Registered loaders.
		 */</span>
		protected <span style="color: #000000; font-weight: bold;">var</span> loaders:<span style="color: #0066CC;">Array</span> = <span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span>;
&nbsp;
		<span style="color: #808080; font-style: italic;">/**
		 * Registers a loader with the registry.
		 * @param loader Any object that dispatches ProgressEvent.PROGRESS, Event.COMPLETE, and
		 * IOErrorEvent.IO_ERROR events as well as provides bytesLoaded and bytesTotal properties.
		 * Examples include UrlLoader or LoaderInfo objects.
		 */</span>
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> register<span style="color: #66cc66;">&#40;</span>loader:IEventDispatcher<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
		<span style="color: #66cc66;">&#123;</span>
			<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>loaders.<span style="color: #0066CC;">indexOf</span><span style="color: #66cc66;">&#40;</span>loader<span style="color: #66cc66;">&#41;</span> == -<span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>
			<span style="color: #66cc66;">&#123;</span>
				loaders.<span style="color: #0066CC;">push</span><span style="color: #66cc66;">&#40;</span>loader<span style="color: #66cc66;">&#41;</span>;
				loader.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>ProgressEvent.<span style="color: #006600;">PROGRESS</span>, loaderProgressHandler<span style="color: #66cc66;">&#41;</span>;
				loader.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">COMPLETE</span>, loaderCompleteHandler<span style="color: #66cc66;">&#41;</span>;
				loader.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>IOErrorEvent.<span style="color: #006600;">IO_ERROR</span>, loaderErrorHandler<span style="color: #66cc66;">&#41;</span>;
				updateStats<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #66cc66;">&#125;</span>
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #808080; font-style: italic;">/**
		 * Unregisters a loader from the registry.
		 * @param loader Any object that dispatches ProgressEvent.PROGRESS, Event.COMPLETE, and
		 * IOErrorEvent.IO_ERROR events as well as provides bytesLoaded and bytesTotal properties.
		 * Examples include UrlLoader or LoaderInfo objects.
		 */</span>
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> unregister<span style="color: #66cc66;">&#40;</span>loader:IEventDispatcher<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
		<span style="color: #66cc66;">&#123;</span>
			<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>loaders.<span style="color: #0066CC;">indexOf</span><span style="color: #66cc66;">&#40;</span>loader<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&gt;</span> -<span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>
			<span style="color: #66cc66;">&#123;</span>
				loaders.<span style="color: #0066CC;">splice</span><span style="color: #66cc66;">&#40;</span>loaders.<span style="color: #0066CC;">indexOf</span><span style="color: #66cc66;">&#40;</span>loader<span style="color: #66cc66;">&#41;</span>, <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>;
				loader.<span style="color: #006600;">removeEventListener</span><span style="color: #66cc66;">&#40;</span>ProgressEvent.<span style="color: #006600;">PROGRESS</span>, loaderProgressHandler<span style="color: #66cc66;">&#41;</span>;
				loader.<span style="color: #006600;">removeEventListener</span><span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">COMPLETE</span>, loaderCompleteHandler<span style="color: #66cc66;">&#41;</span>;
				loader.<span style="color: #006600;">removeEventListener</span><span style="color: #66cc66;">&#40;</span>IOErrorEvent.<span style="color: #006600;">IO_ERROR</span>, loaderErrorHandler<span style="color: #66cc66;">&#41;</span>;
				updateStats<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #66cc66;">&#125;</span>
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #808080; font-style: italic;">/**
		 * Unregisters all the currently registered loaders.
		 */</span>
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> unregisterAll<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
		<span style="color: #66cc66;">&#123;</span>
			<span style="color: #808080; font-style: italic;">// Use a copy of the loaders array because the original loaders array will be</span>
			<span style="color: #808080; font-style: italic;">// manipulated as we loop through removing loaders.</span>
			<span style="color: #000000; font-weight: bold;">var</span> loaders:<span style="color: #0066CC;">Array</span> = loaders.<span style="color: #0066CC;">slice</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #b1b100;">for</span> each <span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> loader:IEventDispatcher <span style="color: #b1b100;">in</span> loaders<span style="color: #66cc66;">&#41;</span>
			<span style="color: #66cc66;">&#123;</span>
				unregister<span style="color: #66cc66;">&#40;</span>loader<span style="color: #66cc66;">&#41;</span>;
			<span style="color: #66cc66;">&#125;</span>
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #808080; font-style: italic;">/**
		 * Updates stats when progress events are dispatched.
		 */</span>
		protected <span style="color: #000000; font-weight: bold;">function</span> loaderProgressHandler<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>
			updateStats<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #808080; font-style: italic;">/**
		 * Updates stats when complete events are dispatched.
		 */</span>
		protected <span style="color: #000000; font-weight: bold;">function</span> loaderCompleteHandler<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>
			updateStats<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #808080; font-style: italic;">/**
		 * Updates stats when error events are dispatched.
		 */</span>
		protected <span style="color: #000000; font-weight: bold;">function</span> loaderErrorHandler<span style="color: #66cc66;">&#40;</span>event:IOErrorEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
		<span style="color: #66cc66;">&#123;</span>
			<span style="color: #808080; font-style: italic;">// Because the loader will never reach a complete state because of the error,</span>
			<span style="color: #808080; font-style: italic;">// we'll unregister the loader now.</span>
			unregister<span style="color: #66cc66;">&#40;</span>IEventDispatcher<span style="color: #66cc66;">&#40;</span>event.<span style="color: #0066CC;">target</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
			updateStats<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #808080; font-style: italic;">/**
		 * Whether stats are flagged to be updated.
		 */</span>
		protected <span style="color: #000000; font-weight: bold;">var</span> statsNeedUpdating:<span style="color: #0066CC;">Boolean</span> = <span style="color: #000000; font-weight: bold;">false</span>;
&nbsp;
		<span style="color: #808080; font-style: italic;">/**
		 * Marks that we need to update stats.  We delay the actual updating of the stats
		 * until the next frame as a type of invalidation/validation cycle like the Flex components
		 * go through.  This is to avoid duplicate calls to the stat updating logic within a
		 * single render.
		 */</span>
		protected <span style="color: #000000; font-weight: bold;">function</span> updateStats<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
		<span style="color: #66cc66;">&#123;</span>
			<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">!</span>statsNeedUpdating<span style="color: #66cc66;">&#41;</span>
			<span style="color: #66cc66;">&#123;</span>
				statsNeedUpdating = <span style="color: #000000; font-weight: bold;">true</span>;
				setTimeout<span style="color: #66cc66;">&#40;</span>doUpdateStats, 0<span style="color: #66cc66;">&#41;</span>;
			<span style="color: #66cc66;">&#125;</span>
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #808080; font-style: italic;">/**
		 * Updates percentLoaded stats.  When there is a single loader, this is simply the bytes 
		 * loaded divided by the bytes total for the loader.  When there are multiple loaders, this 
		 * is the number of loaders which have completed their loading process divided by the total 
		 * number of registered loaders.  The reason we can't go off bytes when there are multiple
		 * loaders is because a loader's totalBytes is only populated once it has made its initial
		 * request to the server.  This means the third loader might  not make its initial request 
		 * until the first request has returned. This means we don't know our grand total number 
		 * of bytes at the beginning, which is imperative to have to make an accurate 
		 * bytesLoaded/bytesTotal calculation.
		 */</span>
		protected <span style="color: #000000; font-weight: bold;">function</span> doUpdateStats<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
		<span style="color: #66cc66;">&#123;</span>
			<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>statsNeedUpdating<span style="color: #66cc66;">&#41;</span>
			<span style="color: #66cc66;">&#123;</span>
				<span style="color: #808080; font-style: italic;">// See the asdoc for this function to understand why we have these different cases.</span>
				<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>loaders.<span style="color: #0066CC;">length</span> <span style="color: #66cc66;">&gt;</span> <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>
				<span style="color: #66cc66;">&#123;</span>
					<span style="color: #000000; font-weight: bold;">var</span> loadersComplete:uint = 0;
&nbsp;
					<span style="color: #b1b100;">for</span> each <span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> loader:<span style="color: #0066CC;">Object</span> <span style="color: #b1b100;">in</span> loaders<span style="color: #66cc66;">&#41;</span>
					<span style="color: #66cc66;">&#123;</span>
						<span style="color: #808080; font-style: italic;">// bytesTotal is only populated (greater than 0) once the loader has made </span>
						<span style="color: #808080; font-style: italic;">// its request to the server.</span>
						<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>loader.<span style="color: #0066CC;">bytesTotal</span> <span style="color: #66cc66;">&gt;</span> 0 <span style="color: #66cc66;">&amp;&amp;</span> loader.<span style="color: #0066CC;">bytesLoaded</span> == loader.<span style="color: #0066CC;">bytesTotal</span><span style="color: #66cc66;">&#41;</span>
						<span style="color: #66cc66;">&#123;</span>
							loadersComplete++;
						<span style="color: #66cc66;">&#125;</span>
					<span style="color: #66cc66;">&#125;</span>
&nbsp;
					<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>loaders.<span style="color: #0066CC;">length</span> == 0<span style="color: #66cc66;">&#41;</span>
					<span style="color: #66cc66;">&#123;</span>
						percentLoaded = <span style="color: #cc66cc;">1</span>;
					<span style="color: #66cc66;">&#125;</span>
					<span style="color: #b1b100;">else</span>
					<span style="color: #66cc66;">&#123;</span>
						percentLoaded = loadersComplete <span style="color: #66cc66;">/</span> loaders.<span style="color: #0066CC;">length</span>;
					<span style="color: #66cc66;">&#125;</span>
				<span style="color: #66cc66;">&#125;</span>
				<span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>loaders.<span style="color: #0066CC;">length</span> == <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>
				<span style="color: #66cc66;">&#123;</span>
					<span style="color: #808080; font-style: italic;">// bytesTotal is only populated (greater than 0) once the loader has made </span>
					<span style="color: #808080; font-style: italic;">// its request to the server.</span>
					<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>loaders<span style="color: #66cc66;">&#91;</span>0<span style="color: #66cc66;">&#93;</span>.<span style="color: #0066CC;">bytesTotal</span> <span style="color: #66cc66;">&gt;</span> 0<span style="color: #66cc66;">&#41;</span>
					<span style="color: #66cc66;">&#123;</span>
						percentLoaded = loaders<span style="color: #66cc66;">&#91;</span>0<span style="color: #66cc66;">&#93;</span>.<span style="color: #0066CC;">bytesLoaded</span> <span style="color: #66cc66;">/</span> loaders<span style="color: #66cc66;">&#91;</span>0<span style="color: #66cc66;">&#93;</span>.<span style="color: #0066CC;">bytesTotal</span>; 
					<span style="color: #66cc66;">&#125;</span>
					<span style="color: #b1b100;">else</span>
					<span style="color: #66cc66;">&#123;</span>
						percentLoaded = 0;
					<span style="color: #66cc66;">&#125;</span>
				<span style="color: #66cc66;">&#125;</span>
				<span style="color: #b1b100;">else</span>
				<span style="color: #66cc66;">&#123;</span>
					percentLoaded = <span style="color: #cc66cc;">1</span>;
				<span style="color: #66cc66;">&#125;</span>
&nbsp;
				dispatchEvent<span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> ProgressEvent<span style="color: #66cc66;">&#40;</span>ProgressEvent.<span style="color: #006600;">PROGRESS</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
				<span style="color: #808080; font-style: italic;">// If all the loaders we have registered have completed loading, we'll</span>
				<span style="color: #808080; font-style: italic;">// unregister all of them and dispatch a complete event.</span>
				<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>percentLoaded == <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>
				<span style="color: #66cc66;">&#123;</span>
					unregisterAll<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
					dispatchEvent<span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> Event<span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">COMPLETE</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
				<span style="color: #66cc66;">&#125;</span>
&nbsp;
				<span style="color: #808080; font-style: italic;">// Reset the flag.</span>
				statsNeedUpdating = <span style="color: #000000; font-weight: bold;">false</span>
			<span style="color: #66cc66;">&#125;</span>
		<span style="color: #66cc66;">&#125;</span>
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://aaronhardy.com/flex/showing-progress-for-multiple-loaders/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Piano Marvel: Interactive Piano Lessons</title>
		<link>http://aaronhardy.com/flex/piano-marvel-interactive-piano-lessons/</link>
		<comments>http://aaronhardy.com/flex/piano-marvel-interactive-piano-lessons/#comments</comments>
		<pubDate>Thu, 03 Sep 2009 03:48:23 +0000</pubDate>
		<dc:creator>Aaron Hardy</dc:creator>
		
		<category><![CDATA[Flex]]></category>

		<category><![CDATA[General Programming]]></category>

		<category><![CDATA[adobe max award]]></category>

		<category><![CDATA[air]]></category>

		<category><![CDATA[java]]></category>

		<category><![CDATA[merapi]]></category>

		<category><![CDATA[musicXML]]></category>

		<category><![CDATA[piano lessons]]></category>

		<category><![CDATA[piano marvel]]></category>

		<category><![CDATA[pianomarvel]]></category>

		<guid isPermaLink="false">http://aaronhardy.com/?p=341</guid>
		<description><![CDATA[Rain, where I work, has released yet another super-duper app.  It&#8217;s called Piano Marvel and it&#8217;s set to revolutionize how people learn how to play the piano.  I&#8217;m not a piano player myself, but I do remember taking piano lessons as a kid.  I hated it.  It was monotonous, inconvenient, and [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://mediarain.com" target="_blank">Rain</a>, where I work, has released yet another super-duper app.  It&#8217;s called <a href="http://pianomarvel.com" target="_blank">Piano Marvel</a> and it&#8217;s set to revolutionize how people learn how to play the piano.  I&#8217;m not a piano player myself, but I do remember taking piano lessons as a kid.  I hated it.  It was monotonous, inconvenient, and felt like a chore.  I wasn&#8217;t intrigued and I don&#8217;t believe I was the only kid that felt this way.</p>
<p>A while back, <a href="http://hub.guitarhero.com/" target="_blank">Guitar Hero</a> hit the gaming industry by storm and <a href="http://www.youtube.com/watch?v=-XjaImfQK6U" target="_blank">kids flocked to learning the guitar</a>.  Sure, it wasn&#8217;t a real guitar, but it was still an instrument of sorts and kids were still learning hand-eye-ear coordination, rhythm, and other music essentials.  The game was a huge success, bringing in over $1 billion in sales in the first 26 months and set an industry record.</p>
<p>Why such a difference in my experience learning how to play the piano years ago and kids learning the pseudo-guitar with Guitar Hero?  Guitar Hero provides objectivity, benchmarking, competition, and addiction.  You can play with your friends in a fun atmosphere.  Piano Marvel takes these concepts and applies them to learning the piano.  Students play along to accompaniment, see exactly which notes they hit and when they hit them, and earn trophies as they complete increasingly difficult exercises.  They can practice whenever they choose and can even battle it out with their piano-playing comrades.<span id="more-341"></span></p>
<p><object width="560" height="340" data="http://www.youtube.com/v/QotI0BLTGNE&amp;hl=en&amp;fs=1&amp;" type="application/x-shockwave-flash"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/QotI0BLTGNE&amp;hl=en&amp;fs=1&amp;" /><param name="allowfullscreen" value="true" /></object></p>
<p>Now to the gushy technical stuff.</p>
<p>First, Piano Marvel is built using <a href="http://www.adobe.com/products/air/" target="_blank">Adobe AIR</a> and <a href="http://www.java.com" target="_blank">Java</a>.  Adobe AIR provides the high level of interactivity needed for such an application.  Java provides the ability to communicate with a MIDI keyboard.  Both are bridged using <a href="http://www.merapiproject.net/" target="_blank">Merapi</a>&#8211;AIR talks to Java, Java talks to AIR.  All are deployed onto the user&#8217;s desktop with a single installer.  Both Windows and Mac are supported.</p>
<p>Second, all the exercise content can be easily managed by the administrator.  Let&#8217;s say the administrator wants to add an exercise.  He plays a little ditty in <a href="http://www.finalemusic.com/" target="_blank">Finale</a> using his keyboard, saves the musical notation as a <a href="http://www.recordare.com/xml.html" target="_blank">MusicXML</a> file, saves the accompaniment in <a href="http://en.wikipedia.org/wiki/Musical_Instrument_Digital_Interface" target="_blank">MIDI</a> format, and uploads both files using an online admin panel.  The next time students log in, they have a new exercise to conquer.</p>
<p>Third, all music notation is dynamic.  In other words, an exercise is not just a big graphic of sheet music.  Instead, MusicXML is loaded from the server at runtime.  The XML is immediately parsed and notes, accidentals, lines, dots, and all notation the user sees is drawn to the screen at that moment.  Resize the window and the music is redrawn, not simply scaled, to fit into the available space in the most elegant and readable way possible.  Because the MusicXML is very comprehensive in describing a musical piece, we can also use the XML to determine pitch and timing for evaluating a user&#8217;s performance.</p>
<p>Fourth, the user can tweak the tempo, only play a portion of an exercise, toggle accompaniment and metronome sounds, get note hints, watch tutorial videos, and more.</p>
<p>Fifth, the application was recently nominated as an <a href="http://max.adobe.com/awards/" target="_blank">Adobe Max 2009 Awards</a> finalist in the education category.  Yeah, we&#8217;re kind of a big deal.</p>
<p>If that isn&#8217;t enough, you can watch my ugly cakehole yack about Piano Marvel below:</p>
<p><object width="560" height="315" data="http://vimeo.com/moogaloop.swf?clip_id=5012163&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=0&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" type="application/x-shockwave-flash"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://vimeo.com/moogaloop.swf?clip_id=5012163&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=0&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" /></object></p>
<p>You can use a free demo account to get hooked then pay a low monthly fee after your trial period is over.  If you check it out using <a href="http://www.pianomarvel.com/users/free-trial/9CAEF13F" target="_blank">this link</a> you&#8217;ll only pay $12/month if you choose to sign up.  That&#8217;s less than the gas you&#8217;d pay to visit a piano teacher.  All you need is a MIDI keyboard and a MIDI-to-USB adapter to get started.</p>
<p>Here are several screenshots of the app and its features.  Props go out to <a href="http://natescodevault.com/?p=241" target="_blank">Nate Ross</a> for letting me steal his screenshots and captions.</p>
<hr />
<div id="attachment_351" class="wp-caption aligncenter" style="width: 510px"><img class="size-full wp-image-351" title="pianomarvel_tooltip" src="http://aaronhardy.com/wp-content/uploads/2009/09/pianomarvel_tooltip.png" alt="Create a rich interactive music notation engine." width="500" height="379" /><p class="wp-caption-text">Create a rich interactive music notation engine.</p></div>
<hr />
<div id="attachment_353" class="wp-caption aligncenter" style="width: 510px"><img class="size-full wp-image-353" title="pianomarvel_scoring" src="http://aaronhardy.com/wp-content/uploads/2009/09/pianomarvel_scoring.png" alt="Display immediate feedback on all correct and incorrect notes that were played." width="500" height="209" /><p class="wp-caption-text">Display immediate feedback on all correct and incorrect notes that were played.</p></div>
<hr />
<div id="attachment_354" class="wp-caption aligncenter" style="width: 510px"><img class="size-full wp-image-354" title="pianomarvel_controls" src="http://aaronhardy.com/wp-content/uploads/2009/09/pianomarvel_controls.png" alt="Have the ability to specify tempo, make music selections, and toggle fun accompaniment and metronome playback." width="500" height="124" /><p class="wp-caption-text">Have the ability to specify tempo, make music selections, and toggle fun accompaniment and metronome playback.</p></div>
<hr />
<div id="attachment_355" class="wp-caption aligncenter" style="width: 510px"><img class="size-full wp-image-355" title="pianomarvel_lessons" src="http://aaronhardy.com/wp-content/uploads/2009/09/pianomarvel_lessons.png" alt="Create an environment that makes playing the piano addictive and entertaining." width="500" height="343" /><p class="wp-caption-text">Create an environment that makes playing the piano addictive and entertaining</p></div>
]]></content:encoded>
			<wfw:commentRss>http://aaronhardy.com/flex/piano-marvel-interactive-piano-lessons/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Kelly Clarkson iPhone App</title>
		<link>http://aaronhardy.com/general-programming/kelly-clarkson-iphone-app/</link>
		<comments>http://aaronhardy.com/general-programming/kelly-clarkson-iphone-app/#comments</comments>
		<pubDate>Sun, 30 Aug 2009 18:18:28 +0000</pubDate>
		<dc:creator>Aaron Hardy</dc:creator>
		
		<category><![CDATA[General Programming]]></category>

		<category><![CDATA[iphone]]></category>

		<category><![CDATA[karaoke]]></category>

		<category><![CDATA[kelly clarkson]]></category>

		<category><![CDATA[open mic]]></category>

		<guid isPermaLink="false">http://aaronhardy.com/?p=330</guid>
		<description><![CDATA[The company I work at, Rain, has officially entered the iPhone development arena.  This week we released an application for Kelly Clarkson (i.e., Sony BMG) called Kelly Clarkson: Open Mic.  While I didn&#8217;t personally work on this application, I am proud of my co-workers and their serious skills at taking the app from [...]]]></description>
			<content:encoded><![CDATA[<p>The company I work at, <a href="http://mediarain.com" target="_blank">Rain</a>, has officially entered the iPhone development arena.  This week we released an application for Kelly Clarkson (i.e., Sony BMG) called <a href="http://click.linksynergy.com/fs-bin/click?id=K7DZFeWGdbQ&#038;subid=&#038;offerid=146261.1&#038;type=10&#038;tmpid=3909&#038;RD_PARM1=http%3A%2F%2Fitunes.apple.com%2FWebObjects%2FMZStore.woa%2Fwa%2FviewSoftware%3Fid%3D326868892%2526mt%3D8" target="_blank">Kelly Clarkson: Open Mic</a>.  While I didn&#8217;t personally work on this application, I am proud of my co-workers and their serious skills at taking the app from scratch to the big show.<span id="more-330"></span></p>
<p>As a primer, the app challenges your singing abilities by allowing you to sing along with Kelly karaoke style.  You&#8217;re able to sing songs from her latest album, <a href="http://click.linksynergy.com/fs-bin/click?id=K7DZFeWGdbQ&#038;subid=&#038;offerid=146261.1&#038;type=10&#038;tmpid=3909&#038;RD_PARM1=http%3A%2F%2Fitunes.apple.com%2FWebObjects%2FMZStore.woa%2Fwa%2FviewAlbum%3Fid%3D305149890%2526s%3D143441" target="_blank">All I Ever Wanted</a>, and then be scored based on pitch and timing.  If you&#8217;ve got singing skillz with a z then you might just win a chance to sing at Kelly Clarkson&#8217;s soundcheck, win tickets to the show, and go to a meet &#038; greet event.</p>
<p>Props back to <a href="http://www.ghostradio.net/2009/08/your-life-would-suck-without-this-app/">Josh Buhler</a> for gracing me with his singing abilities while testing the app.  Or so he says it was for testing anyway&#8230;</p>
<p>So there you go.  Buy it and try out your singing abilities.  Then send me a message from your iPhone telling me how exhilarating it was and make sure it says &#8220;sent from my iPhone&#8221; so I become increasingly more jealous.  Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://aaronhardy.com/general-programming/kelly-clarkson-iphone-app/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Skinnable Knob Component</title>
		<link>http://aaronhardy.com/flex/skinnable-knob-component/</link>
		<comments>http://aaronhardy.com/flex/skinnable-knob-component/#comments</comments>
		<pubDate>Mon, 24 Aug 2009 03:31:44 +0000</pubDate>
		<dc:creator>Aaron Hardy</dc:creator>
		
		<category><![CDATA[Flex]]></category>

		<category><![CDATA[component]]></category>

		<category><![CDATA[dial]]></category>

		<category><![CDATA[knob]]></category>

		<category><![CDATA[skinnable]]></category>

		<guid isPermaLink="false">http://aaronhardy.com/?p=310</guid>
		<description><![CDATA[Recently I went searching for Flex knob components on the web and found they either weren&#8217;t equipped for my needs or closed source.  So, I cooked up my own knob (or dial) component that hopefully someone out there can use.  Go do something cool with it.
Available Properties
value - The number value represented by [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I went searching for Flex knob components on the web and found they either weren&#8217;t equipped for my needs or closed source.  So, I cooked up my own knob (or dial) component that hopefully someone out there can use.  Go do something cool with it.<span id="more-310"></span></p>
<p><strong>Available Properties</strong><br />
value - The number value represented by the current knob rotation.<br />
minimum - The value if the knob were turned counter-clockwise as far as possible.<br />
maximum - The value if the knob were turned clockwise as far as possible.<br />
zeroAngle - The angle, in degrees, representing the minimum value (-180 to 180).<br />
maxRotation - The number of degrees from the zero angle the knob is allowed to rotate clockwise (0 to 360).<br />
snapToCursor - If true, the knob will rotate to the cursor as soon as the user mouses down.<br />
allowLooping - If true, this allows the user to continue rotating the knob clockwise past the max angle, eventually forcing the knob to cross over to the minimum angle.  Likewise the user can continue rotating the knob counter-clockwise past the min angle and the knob will eventually cross over to the maximum angle.  This can be particularly useful when maxRotation is 360 degrees and the user should be able to go around and around.</p>
<p><strong>Skin Parts</strong><br />
backgroundSkin - This is anything around or behind the knob which does not rotate (e.g., tick marks, labels, etc.)<br />
thumbSkin - This is the part of the knob which the user manipulates.  In the real world, this would be &#8220;the knob&#8221; itself&#8211;the tactile part you would turn with your hand.</p>
<p><strong>Exhibit A</strong><br />
Have at it!  Right-click to view the source.  Post a comment if you have a question.</p>

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_Main_46751110"
			class="flashmovie"
			width="100%"
			height="300">
	<param name="movie" value="/samples/knob/Main.swf" />
	<param name="base" value="/samples/knob/" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="/samples/knob/Main.swf"
			name="fm_Main_46751110"
			width="100%"
			height="300">
		<param name="base" value="/samples/knob/" />
	<!--<![endif]-->
		
<p><a href="http://adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>

	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
]]></content:encoded>
			<wfw:commentRss>http://aaronhardy.com/flex/skinnable-knob-component/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
