<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Enigmatic Thought</title>
	
	<link>http://enigmaticthought.com</link>
	<description>import com.enigmaticThought.blog;</description>
	<lastBuildDate>Fri, 16 Oct 2009 20:28:29 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/EnigmaticThought" type="application/rss+xml" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
		<title>The Flex Component Lifecycle</title>
		<link>http://feedproxy.google.com/~r/EnigmaticThought/~3/e10Prx8bpR0/</link>
		<comments>http://enigmaticthought.com/2009/10/the-flex-component-lifecycle/#comments</comments>
		<pubDate>Fri, 16 Oct 2009 20:28:29 +0000</pubDate>
		<dc:creator>Matt C</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Component Lifecycle]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://enigmaticthought.com/?p=239</guid>
		<description><![CDATA[Next week I am going to be explaining the Flex Component Lifecycle to another group where I work.  I think understanding the cycle is a major step in understanding the Flex framework and how to utilize it.  I created a spiffy presentation to keep me on topic. I think it should to stand [...]]]></description>
			<content:encoded><![CDATA[<p>Next week I am going to be explaining the Flex Component Lifecycle to another group where I work.  I think understanding the cycle is a major step in understanding the Flex framework and how to utilize it.  I created a spiffy presentation to keep me on topic. I think it should to stand on its own, and would appreciate any feedback.  I purposefully avoided switching to Flex/Flash Builder so that I wouldn&#8217;t be tempted to try and explain everything as I typed.</p>
<p>I used sliderocket for the first time and have been very impressed.  Once my trial is over and I&#8217;m relegated to the free version I&#8217;ll pass judgment.  If you get to click happy it freaks out about transitions though, so may sure text has completely faded in/appeared before clicking or it&#8217;ll start acting odd.  No sound to worry about, it&#8217;s all slides.</p>
<p><center><embed src="http://data.sliderocket.com/SlideRocketPlayer.swf" flashvars="id=AF907F42-30F9-DFC4-8CBE-537441527256" width="400" height="300" allowFullScreen="true" type="application/x-shockwave-flash"></embed></center></p>
<p>My biggest source was <a href="http://weblog.mrinalwadhwa.com/2009/06/21/flex-4-component-lifecycle/">Mrinal Wadhwa&#8217;s similar presentation</a> which provided a lot of inspiration and some things I could steal to make myself seem smarter than I am.  I based my Elastic Racetrack and Marshal explanations on <a href="http://www.craftymind.com/2008/04/18/updated-elastic-racetrack-for-flash-9-and-avm2/">a great post on Craftymind</a>.<br />
<h3 class='related_post_title'>Related Posts:</h3>
<ul class='related_post'>
<li><a href='http://enigmaticthought.com/2009/09/flash-builders-new-menu/' title='Altering Flash Builder&#8217;s new menu'>Altering Flash Builder&#8217;s new menu</a></li>
<li><a href='http://enigmaticthought.com/2009/08/how-to-flex-the-twitter-api/' title='How to Flex the Twitter API'>How to Flex the Twitter API</a></li>
<li><a href='http://enigmaticthought.com/2009/08/flex-open-iteration-meeting-2/' title='Flex OIM review'>Flex OIM review</a></li>
<li><a href='http://enigmaticthought.com/2009/08/flex-open-iteration-meeting/' title='Flex Open Iteration Meeting'>Flex Open Iteration Meeting</a></li>
<li><a href='http://enigmaticthought.com/2009/08/sdk-16241/' title='Let&#8217;s patch: Fun with Scientific Notation!'>Let&#8217;s patch: Fun with Scientific Notation!</a></li>
</ul>

<p><a href="http://feedads.g.doubleclick.net/~a/vFyRJZNR73_5J3gYH1iKghTJBrY/0/da"><img src="http://feedads.g.doubleclick.net/~a/vFyRJZNR73_5J3gYH1iKghTJBrY/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/vFyRJZNR73_5J3gYH1iKghTJBrY/1/da"><img src="http://feedads.g.doubleclick.net/~a/vFyRJZNR73_5J3gYH1iKghTJBrY/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/EnigmaticThought?a=e10Prx8bpR0:TKqSGs0TUNs:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/EnigmaticThought?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/EnigmaticThought/~4/e10Prx8bpR0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://enigmaticthought.com/2009/10/the-flex-component-lifecycle/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://enigmaticthought.com/2009/10/the-flex-component-lifecycle/</feedburner:origLink></item>
		<item>
		<title>Altering Flash Builder’s new menu</title>
		<link>http://feedproxy.google.com/~r/EnigmaticThought/~3/ynFADsQ9ZQE/</link>
		<comments>http://enigmaticthought.com/2009/09/flash-builders-new-menu/#comments</comments>
		<pubDate>Wed, 23 Sep 2009 16:41:20 +0000</pubDate>
		<dc:creator>Matt C</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Builder]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[Gumbo]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://enigmaticthought.com/?p=236</guid>
		<description><![CDATA[One of the great things about Flex/Flash Builder is the wizards and templates that are used to create Actionscript and MXML files.  When you&#8217;re about to create a file you have a plethora of options to choose from.  Unfortunately, if you&#8217;re like me, you always seem to hit &#8220;MXML Module&#8221; rather than &#8216;MXML [...]]]></description>
			<content:encoded><![CDATA[<p>One of the great things about Flex/Flash Builder is the wizards and templates that are used to create Actionscript and MXML files.  When you&#8217;re about to create a file you have a plethora of options to choose from.  Unfortunately, if you&#8217;re like me, you always seem to hit &#8220;MXML Module&#8221; rather than &#8216;MXML Component&#8221; and have to cancel and re-click.  Fortunately, there&#8217;s a quick fix.  Just right click on the perspective you wish to change (in Flash Builder it&#8217;s Flash) and choose &#8220;Customize&#8221;.  You&#8217;ll get a nice list of options to show on submenus, including the new menu.  Just uncheck everything you don&#8217;t want to see and check any additional options you do want to see.<br />
<h3 class='related_post_title'>Related Posts:</h3>
<ul class='related_post'>
<li><a href='http://enigmaticthought.com/2009/08/how-to-flex-the-twitter-api/' title='How to Flex the Twitter API'>How to Flex the Twitter API</a></li>
<li><a href='http://enigmaticthought.com/2009/08/flex-open-iteration-meeting-2/' title='Flex OIM review'>Flex OIM review</a></li>
<li><a href='http://enigmaticthought.com/2009/08/flex-open-iteration-meeting/' title='Flex Open Iteration Meeting'>Flex Open Iteration Meeting</a></li>
<li><a href='http://enigmaticthought.com/2009/02/flex-in-eclipse-tips/' title='Flex in Eclipse tips'>Flex in Eclipse tips</a></li>
<li><a href='http://enigmaticthought.com/2009/08/sdk-16241/' title='Let&#8217;s patch: Fun with Scientific Notation!'>Let&#8217;s patch: Fun with Scientific Notation!</a></li>
</ul>

<p><a href="http://feedads.g.doubleclick.net/~a/PUr7ykdPGNXpwtM4PhAYhHYHuPs/0/da"><img src="http://feedads.g.doubleclick.net/~a/PUr7ykdPGNXpwtM4PhAYhHYHuPs/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/PUr7ykdPGNXpwtM4PhAYhHYHuPs/1/da"><img src="http://feedads.g.doubleclick.net/~a/PUr7ykdPGNXpwtM4PhAYhHYHuPs/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/EnigmaticThought?a=ynFADsQ9ZQE:gd79svPteIk:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/EnigmaticThought?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/EnigmaticThought/~4/ynFADsQ9ZQE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://enigmaticthought.com/2009/09/flash-builders-new-menu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://enigmaticthought.com/2009/09/flash-builders-new-menu/</feedburner:origLink></item>
		<item>
		<title>HTTPService bug crushed in 3.x branch</title>
		<link>http://feedproxy.google.com/~r/EnigmaticThought/~3/j6MimcoFP1I/</link>
		<comments>http://enigmaticthought.com/2009/09/httpservice-bug-crushed/#comments</comments>
		<pubDate>Thu, 10 Sep 2009 14:05:50 +0000</pubDate>
		<dc:creator>Matt C</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[BugQuash]]></category>
		<category><![CDATA[FlexSDK]]></category>
		<category><![CDATA[patch]]></category>

		<guid isPermaLink="false">http://enigmaticthought.com/?p=232</guid>
		<description><![CDATA[Since I yelled about the HTTPService Bug I figure I might as well applaud Adobe for getting it fixed.  The 3.x branch was updated Tuesday afternoon and the bug (SDK-22883) was closed yesterday.  So, if you&#8217;re wondering what the fix is, Open up your HTTPService.as file and replace the dispatchRpcEvent method in the [...]]]></description>
			<content:encoded><![CDATA[<p>Since I yelled about the <a href="http://enigmaticthought.com/2009/09/sdk-2233-flex3-4-httpservice-bug/">HTTPService Bug</a> I figure I might as well applaud Adobe for getting it fixed.  The 3.x branch was updated Tuesday afternoon and the bug (<a href="http://bugs.adobe.com/jira/browse/SDK-22883">SDK-22883</a>) was closed yesterday.  So, if you&#8217;re wondering what the fix is, Open up your HTTPService.as file and replace the dispatchRpcEvent method in the HTTPOperation with this:</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?">?</a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p232code2'); return false;">View Code</a> ACTIONSCRIPT3</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p2322"><td class="code" id="p232code2"><pre class="actionscript3" style="font-family:monospace;">    override mx_internal <span style="color: #339966; font-weight: bold;">function</span> dispatchRpcEvent<span style="color: #000000;">&#40;</span>event<span style="color: #000000; font-weight: bold;">:</span>AbstractEvent<span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
    <span style="color: #000000;">&#123;</span>
        <span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #004993;">hasEventListener</span><span style="color: #000000;">&#40;</span>event.<span style="color: #004993;">type</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#123;</span>
            event.mx_internal<span style="color: #000000; font-weight: bold;">::</span>callTokenResponders<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
            <span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight: bold;">!</span>event.<span style="color: #004993;">isDefaultPrevented</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>
                <span style="color: #004993;">dispatchEvent</span><span style="color: #000000;">&#40;</span>event<span style="color: #000000;">&#41;</span>;
        <span style="color: #000000;">&#125;</span>
        <span style="color: #0033ff; font-weight: bold;">else</span>
        <span style="color: #000000;">&#123;</span>
            <span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>httpService <span style="color: #000000; font-weight: bold;">!</span>= <span style="color: #0033ff; font-weight: bold;">null</span><span style="color: #000000;">&#41;</span>
                httpService.mx_internal<span style="color: #000000; font-weight: bold;">::</span>dispatchRpcEvent<span style="color: #000000;">&#40;</span>event<span style="color: #000000;">&#41;</span>;
            <span style="color: #0033ff; font-weight: bold;">else</span>
                event.mx_internal<span style="color: #000000; font-weight: bold;">::</span>callTokenResponders<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
        <span style="color: #000000;">&#125;</span>            
    <span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<p> (or monkey patch it in).  3.5 is obviously coming, and you can see the targeted fix list <a href="http://bugs.adobe.com/jira/secure/IssueNavigator.jspa?reset=true&#038;mode=hide&#038;sorter/order=ASC&#038;sorter/field=priority&#038;pid=10012&#038;customfield_10090=10931">here</a><br />
<h3 class='related_post_title'>Related Posts:</h3>
<ul class='related_post'>
<li><a href='http://enigmaticthought.com/2009/08/sdk-16241/' title='Let&#8217;s patch: Fun with Scientific Notation!'>Let&#8217;s patch: Fun with Scientific Notation!</a></li>
<li><a href='http://enigmaticthought.com/2009/08/objectutil-compare-patch-3-with-feeling/' title='ObjectUtil.compare() Patch 3 (with feeling!)'>ObjectUtil.compare() Patch 3 (with feeling!)</a></li>
<li><a href='http://enigmaticthought.com/2009/08/objectutil-compare-patch-attempt-number-2/' title='ObjectUtil.compare() Patch attempt number 2'>ObjectUtil.compare() Patch attempt number 2</a></li>
<li><a href='http://enigmaticthought.com/2009/09/sdk-2233-flex3-4-httpservice-bug/' title='Hold the HTTPService: Flex 3.4 gets a showstopper'>Hold the HTTPService: Flex 3.4 gets a showstopper</a></li>
<li><a href='http://enigmaticthought.com/2009/07/bug-hunting-fx-3/' title='Bug hunting in the Flex SDK (part 3)'>Bug hunting in the Flex SDK (part 3)</a></li>
</ul>

<p><a href="http://feedads.g.doubleclick.net/~a/nJVTI09KnG4lCOwSROCEZbqZPlc/0/da"><img src="http://feedads.g.doubleclick.net/~a/nJVTI09KnG4lCOwSROCEZbqZPlc/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/nJVTI09KnG4lCOwSROCEZbqZPlc/1/da"><img src="http://feedads.g.doubleclick.net/~a/nJVTI09KnG4lCOwSROCEZbqZPlc/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/EnigmaticThought?a=j6MimcoFP1I:RzGBlnSmMo0:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/EnigmaticThought?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/EnigmaticThought/~4/j6MimcoFP1I" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://enigmaticthought.com/2009/09/httpservice-bug-crushed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://enigmaticthought.com/2009/09/httpservice-bug-crushed/</feedburner:origLink></item>
		<item>
		<title>Hold the HTTPService: Flex 3.4 gets a showstopper</title>
		<link>http://feedproxy.google.com/~r/EnigmaticThought/~3/QNVTZdxnsc4/</link>
		<comments>http://enigmaticthought.com/2009/09/sdk-2233-flex3-4-httpservice-bug/#comments</comments>
		<pubDate>Thu, 03 Sep 2009 14:54:54 +0000</pubDate>
		<dc:creator>Matt C</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[BugQuash]]></category>
		<category><![CDATA[FlexSDK]]></category>
		<category><![CDATA[JIRA]]></category>

		<guid isPermaLink="false">http://enigmaticthought.com/?p=228</guid>
		<description><![CDATA[It turns out that Flex 3.4 may not have been ready for the spotlight.  Sure, I&#8217;m as eager as anyone to get a hold on it, especially since I had a part in its creation.  However, there&#8217;s a horrible bug in the HTTPService world.
If you add a responder to a token created by [...]]]></description>
			<content:encoded><![CDATA[<p>It turns out that Flex 3.4 may not have been ready for the spotlight.  Sure, I&#8217;m as eager as anyone to get a hold on it, especially since I <a href="http://enigmaticthought.com/2009/05/bug-quash/">had a part</a> in its creation.  However, there&#8217;s a <a href="http://bugs.adobe.com/jira/browse/SDK-22883">horrible bug</a> in the HTTPService world.</p>
<p>If you add a responder to a token created by the send() method, you&#8217;ll end up with two calls to the responder for every return by the server.  The workaround is use event listeners rather than responders, but a lot of people (myself included) aren&#8217;t interested in rewriting legacy code to work around something that worked in a prior version.<br />
<h3 class='related_post_title'>Related Posts:</h3>
<ul class='related_post'>
<li><a href='http://enigmaticthought.com/2009/08/sdk-16241/' title='Let&#8217;s patch: Fun with Scientific Notation!'>Let&#8217;s patch: Fun with Scientific Notation!</a></li>
<li><a href='http://enigmaticthought.com/2009/08/objectutil-compare-patch-attempt-number-2/' title='ObjectUtil.compare() Patch attempt number 2'>ObjectUtil.compare() Patch attempt number 2</a></li>
<li><a href='http://enigmaticthought.com/2009/07/bug-hunting-fx-3/' title='Bug hunting in the Flex SDK (part 3)'>Bug hunting in the Flex SDK (part 3)</a></li>
<li><a href='http://enigmaticthought.com/2009/07/bug-hunting-fx-2/' title='Bug hunting in the Flex SDK (part 2)'>Bug hunting in the Flex SDK (part 2)</a></li>
<li><a href='http://enigmaticthought.com/2009/08/objectutil-compare-patch-3-with-feeling/' title='ObjectUtil.compare() Patch 3 (with feeling!)'>ObjectUtil.compare() Patch 3 (with feeling!)</a></li>
</ul>

<p><a href="http://feedads.g.doubleclick.net/~a/ZYSYpX4bRWP1gPAg2FRtgn5SLd0/0/da"><img src="http://feedads.g.doubleclick.net/~a/ZYSYpX4bRWP1gPAg2FRtgn5SLd0/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/ZYSYpX4bRWP1gPAg2FRtgn5SLd0/1/da"><img src="http://feedads.g.doubleclick.net/~a/ZYSYpX4bRWP1gPAg2FRtgn5SLd0/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/EnigmaticThought?a=QNVTZdxnsc4:7eJqNhacEvA:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/EnigmaticThought?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/EnigmaticThought/~4/QNVTZdxnsc4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://enigmaticthought.com/2009/09/sdk-2233-flex3-4-httpservice-bug/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://enigmaticthought.com/2009/09/sdk-2233-flex3-4-httpservice-bug/</feedburner:origLink></item>
		<item>
		<title>How to Flex the Twitter API</title>
		<link>http://feedproxy.google.com/~r/EnigmaticThought/~3/vFB44gsf6SA/</link>
		<comments>http://enigmaticthought.com/2009/08/how-to-flex-the-twitter-api/#comments</comments>
		<pubDate>Fri, 21 Aug 2009 14:54:04 +0000</pubDate>
		<dc:creator>Matt C</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Gumbo]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[Twitter]]></category>

		<guid isPermaLink="false">http://enigmaticthought.com/?p=166</guid>
		<description><![CDATA[While sitting in #flex on Freenode a while back, someone asked how to use Twitter within Flex.  Since I&#8217;ve meddled with other APIs I offered some advice, but I&#8217;d never personally dealt with Twitter.  Douglas Knudsen pointed out at his 360&#124;Indy session that no true web mashup is complete without using twitter so [...]]]></description>
			<content:encoded><![CDATA[<p>While sitting in #flex on <a href="http://freenode.net/">Freenode</a> a while back, someone asked how to use Twitter within Flex.  Since I&#8217;ve meddled with other APIs I offered some advice, but I&#8217;d never personally dealt with Twitter.  <a href="http://www.cubicleman.com/">Douglas Knudsen</a> pointed out at <a href="http://www.cubicleman.com/2009/05/18/360flex-indy-the-great-mashup/">his 360|Indy session</a> that no true web mashup is complete without using twitter so here is how to &#8220;complete&#8221; your own project.</p>
<p>With that in mind (and a fresh Flash Builder 4 Beta install) I figured what better way to learn a little about Spark than to create a Twitter Flex app?  Since I was intending on posting it as a how-to, I kept it simple and sweet.  Of course, it should be easy to take the code snippets and move them to your own mega-app.</p>
<p>I thought the first step was to learn the Twitter API, until I discovered there already existed projects out there that already took care of that.  Thanks to the open source library <a href="http://code.google.com/p/tweetr/">tweetr</a>, I just have to have a vague idea about twitter and let tweetr do the heavy lifting.  No worrying about value objects or dealing with XML, just a simple event listener.  So, with that I got to focus on Spark, which I&#8217;d never dealt with before.  </p>
<p>If you want to see the final output (and view source) I&#8217;ve posted it <a href="http://flex.enigmaticthought.com/TwitterSearch/TwitterSearch.html">here</a>.</p>
<p>The search code to work with Tweetr is very simple.  I simply add an eventListener for the COMPLETE event and shove the results into a bindable ArrayCollection.  I&#8217;ve bound the search function to the enter &#038; click events of a Spark TextInput and Button, but since they operate just like their MX components, it&#8217;s not really interesting to look at.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?">?</a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p166code7'); return false;">View Code</a> ACTIONSCRIPT3</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p1667"><td class="code" id="p166code7"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #000000;">&#91;</span>Bindable<span style="color: #000000;">&#93;</span>
<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _searchResults<span style="color: #000000; font-weight: bold;">:</span>ArrayCollection = <span style="color: #0033ff; font-weight: bold;">new</span> ArrayCollection<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> <span style="color: #004993;">search</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
	<span style="color: #6699cc; font-weight: bold;">var</span> tweetr<span style="color: #000000; font-weight: bold;">:</span>Tweetr = <span style="color: #0033ff; font-weight: bold;">new</span> Tweetr;
&nbsp;
	tweetr.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span>TweetEvent.<span style="color: #004993;">COMPLETE</span>, searchResults, <span style="color: #0033ff; font-weight: bold;">false</span>, <span style="color: #000000; font-weight:bold;">0</span>, <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000000;">&#41;</span>;
	tweetr.<span style="color: #004993;">search</span><span style="color: #000000;">&#40;</span>searchInput.<span style="color: #004993;">text</span><span style="color: #000000;">&#41;</span>;
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> searchResults<span style="color: #000000;">&#40;</span>event<span style="color: #000000; font-weight: bold;">:</span>TweetEvent<span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
	_searchResults.<span style="color: #004993;">source</span> = event.responseArray;
	_searchResults.refresh<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<p>Using MX, I&#8217;d normally bind that data to some sort of DataGrid or Repeater, but Spark has neither.  But, thanks to Flash Builder&#8217;s code hinting, I discovered the DataGroup component.  It&#8217;s somewhat like a repeater, but with more layout options thanks to the way layouts work in Spark.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?">?</a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p166code8'); return false;">View Code</a> ACTIONSCRIPT3</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p1668"><td class="code" id="p166code8"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;</span>s<span style="color: #000000; font-weight: bold;">:</span>DataGroup 
	dataProvider=<span style="color: #990000;">&quot;{_searchResults}&quot;</span> 
	itemRenderer=<span style="color: #990000;">&quot;com.enigmaticthought.components.TweetBox&quot;</span> <span style="color: #004993;">width</span>=<span style="color: #990000;">&quot;100%&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span>
	<span style="color: #000000; font-weight: bold;">&lt;</span>s<span style="color: #000000; font-weight: bold;">:</span>layout<span style="color: #000000; font-weight: bold;">&gt;</span>
		<span style="color: #000000; font-weight: bold;">&lt;</span>s<span style="color: #000000; font-weight: bold;">:</span>VerticalLayout <span style="color: #000000; font-weight: bold;">/&gt;</span>
	<span style="color: #000000; font-weight: bold;">&lt;/</span>s<span style="color: #000000; font-weight: bold;">:</span>layout<span style="color: #000000; font-weight: bold;">&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;/</span>s<span style="color: #000000; font-weight: bold;">:</span>DataGroup<span style="color: #000000; font-weight: bold;">&gt;</span></pre></td></tr></table></div>

<p>So all I had left was to create a renderer for the data.  That&#8217;s where TweetBox came in to play.  Its base class is a Spark ItemRenderer, which was a little tricky to deal with because I had to define states for it, even though I didn&#8217;t use any states.  This is because the ItemRenderer uses states to handle things like hover and select to make the component customizable.</p>
<p>To fill in the TweetBox, I simply overrode the set data function and assigned all the values to the display components.  Sadly, SearchResultData was not built as Bindable, so I couldn&#8217;t just let data binding do the work.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?">?</a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p166code9'); return false;">View Code</a> ACTIONSCRIPT3</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p1669"><td class="code" id="p166code9"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #0033ff; font-weight: bold;">import</span> com.swfjunkie.tweetr.<span style="color: #004993;">data</span>.objects.SearchResultData;
<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _tweet<span style="color: #000000; font-weight: bold;">:</span>SearchResultData; 
&nbsp;
override <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> <span style="color: #0033ff; font-weight: bold;">set</span> <span style="color: #004993;">data</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">value</span><span style="color: #000000; font-weight: bold;">:</span><a href="http://www.google.com/search?q=object%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:object.html&amp;filter=0&amp;num=100&amp;btnI=lucky"><span style="color: #004993;">Object</span></a><span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
	<span style="color: #0033ff; font-weight: bold;">super</span>.<span style="color: #004993;">data</span> = <span style="color: #004993;">value</span>;
	_tweet = <span style="color: #004993;">value</span> <span style="color: #0033ff; font-weight: bold;">as</span> SearchResultData;
	<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>_tweet<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
		tweetImage.<span style="color: #004993;">source</span> = _tweet.userProfileImage;
		tweetText.<span style="color: #004993;">text</span> = _tweet.<span style="color: #004993;">text</span>;
		tweetAuthor.<span style="color: #004993;">text</span> = _tweet.user;
	<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<p>One other thing to note is that while I could use Spark components for the text data, the image is still an MX component.  There isn&#8217;t any plan for a Spark Image in Flex 4, but this is a good example of how mixing Spark &#038; MX works.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?">?</a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p166code10'); return false;">View Code</a> ACTIONSCRIPT3</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p16610"><td class="code" id="p166code10"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;</span>s<span style="color: #000000; font-weight: bold;">:</span>ItemRenderer 
	xmlns<span style="color: #000000; font-weight: bold;">:</span>fx=<span style="color: #990000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span> 
	xmlns<span style="color: #000000; font-weight: bold;">:</span>s=<span style="color: #990000;">&quot;library://ns.adobe.com/flex/spark&quot;</span> 
	xmlns<span style="color: #000000; font-weight: bold;">:</span>mx=<span style="color: #990000;">&quot;library://ns.adobe.com/flex/halo&quot;</span>
	<span style="color: #004993;">width</span>=<span style="color: #990000;">&quot;100%&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span>
	<span style="color: #000000; font-weight: bold;">&lt;</span>s<span style="color: #000000; font-weight: bold;">:</span>layout<span style="color: #000000; font-weight: bold;">&gt;</span>
		<span style="color: #000000; font-weight: bold;">&lt;</span>s<span style="color: #000000; font-weight: bold;">:</span>HorizontalLayout<span style="color: #000000; font-weight: bold;">/&gt;</span>
	<span style="color: #000000; font-weight: bold;">&lt;/</span>s<span style="color: #000000; font-weight: bold;">:</span>layout<span style="color: #000000; font-weight: bold;">&gt;</span>
<span style="color: #000000; font-weight: bold;">--------------------------------------------</span>
...State <span style="color: #000000; font-weight: bold;">&amp;</span> Code Removed...
<span style="color: #000000; font-weight: bold;">--------------------------------------------</span>
	<span style="color: #000000; font-weight: bold;">&lt;</span>mx<span style="color: #000000; font-weight: bold;">:</span>Image id=<span style="color: #990000;">&quot;tweetImage&quot;</span> <span style="color: #004993;">height</span>=<span style="color: #990000;">&quot;48&quot;</span> <span style="color: #004993;">width</span>=<span style="color: #990000;">&quot;48&quot;</span> scaleContent=<span style="color: #990000;">&quot;true&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span>
	<span style="color: #000000; font-weight: bold;">&lt;</span>s<span style="color: #000000; font-weight: bold;">:</span>VGroup id=<span style="color: #990000;">&quot;textGroup&quot;</span> <span style="color: #004993;">width</span>=<span style="color: #990000;">&quot;100%&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span>
		<span style="color: #000000; font-weight: bold;">&lt;</span>s<span style="color: #000000; font-weight: bold;">:</span>SimpleText id=<span style="color: #990000;">&quot;tweetText&quot;</span> <span style="color: #004993;">width</span>=<span style="color: #990000;">&quot;100%&quot;</span> explicitMaxWidth=<span style="color: #990000;">&quot;{textGroup.width}&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span>
		<span style="color: #000000; font-weight: bold;">&lt;</span>s<span style="color: #000000; font-weight: bold;">:</span>SimpleText id=<span style="color: #990000;">&quot;tweetAuthor&quot;</span> <span style="color: #004993;">width</span>=<span style="color: #990000;">&quot;100%&quot;</span> textAlign=<span style="color: #990000;">&quot;right&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span>
	<span style="color: #000000; font-weight: bold;">&lt;/</span>s<span style="color: #000000; font-weight: bold;">:</span>VGroup<span style="color: #000000; font-weight: bold;">&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;/</span>s<span style="color: #000000; font-weight: bold;">:</span>ItemRenderer<span style="color: #000000; font-weight: bold;">&gt;</span></pre></td></tr></table></div>

<p>And now I have a really simple twitter search application.  So, what are some of the other uses for Twitter, other than e-stalking people?  You could build a new alert system that watches <a href="http://apiwiki.twitter.com/Twitter-Search-API-Method%3A-trends">Twitter Trends</a> to see what&#8217;s in the news, or use the search to keep an eye on a <a href="http://search.twitter.com/search?q=Blizzard">company</a>, <a href="http://search.twitter.com/search?q=Titans">team</a>, <a href="http://search.twitter.com/search?q=Avatar">movie</a>, <a href="http://search.twitter.com/search?q=ASOIAF">TV Show</a>, or <a href="http://search.twitter.com/search?q=ADBE">stock</a>. Of course, may you just want to <a href="http://search.twitter.com/search?q=%23songsincode">amuse yourself</a>.<br />
<h3 class='related_post_title'>Related Posts:</h3>
<ul class='related_post'>
<li><a href='http://enigmaticthought.com/2009/09/flash-builders-new-menu/' title='Altering Flash Builder&#8217;s new menu'>Altering Flash Builder&#8217;s new menu</a></li>
<li><a href='http://enigmaticthought.com/2009/08/flex-open-iteration-meeting-2/' title='Flex OIM review'>Flex OIM review</a></li>
<li><a href='http://enigmaticthought.com/2009/08/flex-open-iteration-meeting/' title='Flex Open Iteration Meeting'>Flex Open Iteration Meeting</a></li>
<li><a href='http://enigmaticthought.com/2009/08/sdk-16241/' title='Let&#8217;s patch: Fun with Scientific Notation!'>Let&#8217;s patch: Fun with Scientific Notation!</a></li>
<li><a href='http://enigmaticthought.com/2009/08/objectutil-compare-patch-3-with-feeling/' title='ObjectUtil.compare() Patch 3 (with feeling!)'>ObjectUtil.compare() Patch 3 (with feeling!)</a></li>
</ul>

<p><a href="http://feedads.g.doubleclick.net/~a/gLdYol81WQQhF8ougfWTct1p2GM/0/da"><img src="http://feedads.g.doubleclick.net/~a/gLdYol81WQQhF8ougfWTct1p2GM/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/gLdYol81WQQhF8ougfWTct1p2GM/1/da"><img src="http://feedads.g.doubleclick.net/~a/gLdYol81WQQhF8ougfWTct1p2GM/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/EnigmaticThought?a=vFB44gsf6SA:DYMay-vD2D4:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/EnigmaticThought?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/EnigmaticThought/~4/vFB44gsf6SA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://enigmaticthought.com/2009/08/how-to-flex-the-twitter-api/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://enigmaticthought.com/2009/08/how-to-flex-the-twitter-api/</feedburner:origLink></item>
	</channel>
</rss>
