<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Destroy Today &#187; Announcement</title>
	<atom:link href="http://destroytoday.com/blog/tag/announcement/feed/" rel="self" type="application/rss+xml" />
	<link>http://destroytoday.com/blog</link>
	<description>Jonnie is back to work.</description>
	<lastBuildDate>Fri, 19 Mar 2010 16:48:38 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Dwarf adds unit types and tool position to its arsenal</title>
		<link>http://destroytoday.com/blog/2010/02/dwarf-adds-unit-types-and-tool-position-to-its-arsenal/</link>
		<comments>http://destroytoday.com/blog/2010/02/dwarf-adds-unit-types-and-tool-position-to-its-arsenal/#comments</comments>
		<pubDate>Sun, 14 Feb 2010 19:03:00 +0000</pubDate>
		<dc:creator>Jonnie</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[AIR]]></category>
		<category><![CDATA[Announcement]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Dwarf]]></category>

		<guid isPermaLink="false">http://destroytoday.com/blog/?p=1739</guid>
		<description><![CDATA[
I&#8217;ve been working on Dwarf little by little and finally built one of the most requested features—unit types. The five available unit types are pixels, picas, centimeters, inches, and percent. Inches have dotted lines for quarter inches and percent always displays 100% on the ruler, but scales its grid to show ten columns and ten [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://github.com/destroytoday/Dwarf/downloads"><img class="alignnone size-full wp-image-1740" title="Dwarf unit types" src="http://destroytoday.com/blog/wp-content/uploads/2010/02/dwarf_units.gif" alt="Dwarf unit types" width="645" height="430" /></a></p>
<p>I&#8217;ve been working on <a href="http://github.com/destroytoday/Dwarf/downloads" target="_blank">Dwarf</a> little by little and finally built one of the most requested features—unit types. The five available unit types are pixels, picas, centimeters, inches, and percent. Inches have dotted lines for quarter inches and percent always displays 100% on the ruler, but scales its grid to show ten columns and ten rows. At the moment, the units are based on a 72 dpi screen, but I&#8217;ll be adding an option to change the dpi, since most screens aren&#8217;t 72. If anyone has suggestions for that other than using a list, let me know.</p>
<p><a href="http://github.com/destroytoday/Dwarf/downloads"><img class="alignnone size-full wp-image-1741" title="dwarf_units_toolbar" src="http://destroytoday.com/blog/wp-content/uploads/2010/02/dwarf_units_toolbar.jpg" alt="dwarf_units_toolbar" width="645" height="100" /></a></p>
<p>The unit type is selected by clicking the menu at the right of the toolbar. It prompts a context menu with the options. Dwarf remembers which unit type you used last, so it&#8217;ll remain the same next time you startup. Along with unit types, I included positions and dimensions in the toolbar. This is mostly for the position, but I thought dimensions look nice up there too. At the moment, the position is in relation to the main screen, but the next build improves multi-screen support. You will be able to specify which screen to relate the position to. This also comes in handy for moving guides from screen to screen.</p>
<p>If you&#8217;re already a Dwarf user, start up for the update, or <a href="http://github.com/destroytoday/Dwarf/downloads" target="_blank">download it</a> from GitHub. And, as always, let me know what you think in the comments.</p>
]]></content:encoded>
			<wfw:commentRss>http://destroytoday.com/blog/2010/02/dwarf-adds-unit-types-and-tool-position-to-its-arsenal/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Dwarf gets new life and is now open source</title>
		<link>http://destroytoday.com/blog/2010/01/dwarf-gets-new-life-and-is-now-open-source/</link>
		<comments>http://destroytoday.com/blog/2010/01/dwarf-gets-new-life-and-is-now-open-source/#comments</comments>
		<pubDate>Mon, 25 Jan 2010 16:18:30 +0000</pubDate>
		<dc:creator>Jonnie</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[AIR]]></category>
		<category><![CDATA[Announcement]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Dwarf]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://destroytoday.com/blog/?p=1716</guid>
		<description><![CDATA[
A recent AIR prerelease drop broke Dwarf. I&#8217;m actually not surprised, since it uses a pretty ghetto hack—displaying a transparent window fullscreen and using &#8216;virtual&#8217; windows. Because Dwarf is such an integral part of my everyday workflow and it&#8217;s such a small app, I figured I could easily rewrite it within a day or two. [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-1717" title="Dwarf on Git" src="http://destroytoday.com/blog/wp-content/uploads/2010/01/dwarf_on_git.gif" alt="Dwarf on Git" width="645" height="430" /></p>
<p>A recent AIR prerelease drop broke Dwarf. I&#8217;m actually not surprised, since it uses a pretty ghetto hack—displaying a transparent window fullscreen and using &#8216;virtual&#8217; windows. Because Dwarf is such an integral part of my everyday workflow and it&#8217;s such a small app, I figured I could easily rewrite it within a day or two. I&#8217;ve been on such a code-sharing high, that I started <a href="http://github.com/destroytoday/Dwarf" target="_blank">a new Git repository for it</a> where you can find my work in progress. So far, I have a single ruler working with a semi-functional Mac toolbar. Everything should be complete either tonight or tomorrow, so keep an eye out.</p>
<p>On a legal note, the source code is provided under the <a href="http://github.com/destroytoday/Dwarf/blob/master/README" target="_blank">GNU General Public License (GPL)</a>, so you can reuse and modify the code all you want as long as it&#8217;s still free. If you&#8217;d like to use it for commercial purposes, let&#8217;s talk.</p>
]]></content:encoded>
			<wfw:commentRss>http://destroytoday.com/blog/2010/01/dwarf-gets-new-life-and-is-now-open-source/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Introducing TwitterAspirin: an AS3 Twitter API painkiller</title>
		<link>http://destroytoday.com/blog/2010/01/introducing-twitteraspirin-an-as3-twitter-api-painkiller/</link>
		<comments>http://destroytoday.com/blog/2010/01/introducing-twitteraspirin-an-as3-twitter-api-painkiller/#comments</comments>
		<pubDate>Thu, 21 Jan 2010 15:01:58 +0000</pubDate>
		<dc:creator>Jonnie</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[AIR]]></category>
		<category><![CDATA[Announcement]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[DestroyTwitter]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Twitter]]></category>

		<guid isPermaLink="false">http://destroytoday.com/blog/?p=1704</guid>
		<description><![CDATA[A couple months ago, I started working on a Twitter component for my current project at Adobe. I went into this knowing I&#8217;d have to finally face the beast&#8230; OAuth. Just about every well-known Twitter client out there uses Basic Auth—and for a reason. It&#8217;s easy, what the user expects, and gives your app more [...]]]></description>
			<content:encoded><![CDATA[<p>A couple months ago, I started working on a Twitter component for my current project at Adobe. I went into this knowing I&#8217;d have to finally face the beast&#8230; OAuth. Just about every well-known Twitter client out there uses Basic Auth—and for a reason. It&#8217;s easy, what the user expects, and gives your app more credibility—there&#8217;s no requirement to leave to authenticate through the browser like with OAuth.</p>
<p>About five or six months ago, Twitter decided to enforce the transition. From then on, any application that uses the API must use OAuth in order to see &#8220;via [your app]&#8221; on tweets published with it—otherwise, it would display &#8220;via API.&#8221; Since &#8220;via&#8221; is where apps get probably 90% of their referrals, this was a big deal. Luckily for me, <a href="http://destroytwitter.com" target="_blank">DestroyTwitter</a> existed before that time and Twitter decided not to push the change on the veteran apps. Recently, however, the bad news spread that Basic Auth would be deprecated in June. This means every Twitter app must transition to the pain that is OAuth.</p>
<p>After developing the <a href="http://destroytoday.com/blog/2009/10/adobe-max-companion-launched/" target="_blank">MAX Companion</a> this past fall and now the more generalized version, I found myself rewriting the Twitter component each time. After a while, the Twitter API code I wrote for DestroyTwitter began to merge with the actual implementation, so it was no longer a standalone library that could easily be used by other projects. These past few months, I&#8217;ve been learning a great deal about framework architecture and design patterns. It has led me to realize I need to start fresh.</p>
<p>With all that being said, I&#8217;d like introduce a library I started working on two days ago. I call it <a href="http://github.com/destroytoday/TwitterAspirin" target="_blank">TwitterAspirin</a>. It&#8217;s an AS3 Twitter API library that eases the pain, providing developers with a very powerful tool for communicating with Twitter. Though it&#8217;s still a newborn at the moment, I see potential already. The library is built on <a href="http://robotlegs.org/" target="_blank">RobotLegs</a> and uses <a href="http://github.com/robertpenner/as3-signals" target="_blank">AS3 Signals</a> instead of events. It&#8217;s hosted on <a href="http://github.com" target="_blank">GitHub</a>, so the source code will always be available to the public. And, after last night&#8217;s commit, its OAuth functionality is complete. Here&#8217;s how to use it:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
</pre></td><td class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #0000FF;">package</span> <span style="color: #000000;">&#123;</span>
	<span style="color: #0000FF;">import</span> com.destroytoday.twitteraspirin.Twitter;
&nbsp;
	<span style="color: #0000FF;">import</span> <span style="color: #000000;">flash.display</span>.<span style="color: #000000;">Sprite</span>;
&nbsp;
	<span style="color: #0000FF;">public</span> <span style="color: #0000FF;">class</span> Test extends <span style="color: #000000;">Sprite</span> <span style="color: #000000;">&#123;</span>
		<span style="color: #FF0099;">// set application consumer key and secret</span>
		<span style="color: #0000FF;">public</span> <span style="color: #FF0000;">var</span> twitter<span style="color: #000000;">:</span>Twitter = <span style="color: #0000FF;">new</span> Twitter<span style="color: #000000;">&#40;</span>consumerKey, consumerSecret<span style="color: #000000;">&#41;</span>;
&nbsp;
		<span style="color: #0000FF;">public</span> <span style="color: #FF0000;">function</span> Test<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
			<span style="color: #FF0099;">// add signal listeners</span>
			twitter.oauth.requestTokenSignal.<span style="color: #FF0000;">add</span><span style="color: #000000;">&#40;</span>requestTokenHandler<span style="color: #000000;">&#41;</span>;
			twitter.oauth.accessTokenSignal.<span style="color: #FF0000;">add</span><span style="color: #000000;">&#40;</span>accessTokenHandler<span style="color: #000000;">&#41;</span>;
			twitter.oauth.verifyAccessTokenSignal.<span style="color: #FF0000;">add</span><span style="color: #000000;">&#40;</span>verifyAccessTokenHandler<span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #FF0099;">// click the 'Authorize' button to get the request token</span>
		<span style="color: #0000FF;">protected</span> <span style="color: #FF0000;">function</span> authorizeClickHandler<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">:</span><span style="color: #0000FF;">void</span> <span style="color: #000000;">&#123;</span>
			twitter.oauth.getRequestToken<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #FF0099;">// upon receiving the request token, open Twitter in the browser to authorize</span>
		<span style="color: #0000FF;">protected</span> <span style="color: #FF0000;">function</span> requestTokenHandler<span style="color: #000000;">&#40;</span>oauth<span style="color: #000000;">:</span>OAuth, token<span style="color: #000000;">:</span>OAuthToken<span style="color: #000000;">&#41;</span><span style="color: #000000;">:</span><span style="color: #0000FF;">void</span> <span style="color: #000000;">&#123;</span>
			<span style="color: #FF0000;">navigateToURL</span><span style="color: #000000;">&#40;</span><span style="color: #0000FF;">new</span> <span style="color: #000000;">URLRequest</span><span style="color: #000000;">&#40;</span>oauth.getAuthorizeURL<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #FF0099;">// return with the provided pin and click the 'Activate' button to get the access token</span>
		<span style="color: #0000FF;">protected</span> <span style="color: #FF0000;">function</span> activateClickHandler<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">:</span><span style="color: #0000FF;">void</span> <span style="color: #000000;">&#123;</span>
			twitter.oauth.getAccessToken<span style="color: #000000;">&#40;</span>pin<span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #FF0099;">// upon receiving the access token, verify it</span>
		<span style="color: #0000FF;">protected</span> <span style="color: #FF0000;">function</span> accessTokenHandler<span style="color: #000000;">&#40;</span>oauth<span style="color: #000000;">:</span>OAuth, token<span style="color: #000000;">:</span>OAuthToken<span style="color: #000000;">&#41;</span><span style="color: #000000;">:</span><span style="color: #0000FF;">void</span> <span style="color: #000000;">&#123;</span>
			oauth.verifyAccessToken<span style="color: #000000;">&#40;</span>token<span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #FF0099;">// done</span>
		<span style="color: #0000FF;">protected</span> <span style="color: #FF0000;">function</span> verifyAccessTokenHandler<span style="color: #000000;">&#40;</span>oauth<span style="color: #000000;">:</span>OAuth, token<span style="color: #000000;">:</span>OAuthToken<span style="color: #000000;">&#41;</span><span style="color: #000000;">:</span><span style="color: #0000FF;">void</span> <span style="color: #000000;">&#123;</span>
		<span style="color: #000000;">&#125;</span>
	<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<p>As you can see, it&#8217;s extremely easy to use. Not only that, it provides great flexibility. Many libraries are simple to implement, but don&#8217;t allow the developer access to certain aspects of the process. With TwitterAspirin, each method returns the loader involved with the operation, giving developers the ability to listen for errors, cancel the operation, or attain the raw API data. The library also uses loader pools to recycle instances, so you can submit a tweet and, while it&#8217;s loading, submit another—you don&#8217;t have to wait for the first operation to finish. Then, once the operation is complete, the loader is disposed and returned to the pool, which optimizes performance and memory usage.</p>
<p>I&#8217;m really excited to see where TwitterAspirin goes and I have nothing but great expectations. Be sure to follow along with development and fork whenever you like.</p>
]]></content:encoded>
			<wfw:commentRss>http://destroytoday.com/blog/2010/01/introducing-twitteraspirin-an-as3-twitter-api-painkiller/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Introducing the XMLLoader class</title>
		<link>http://destroytoday.com/blog/2010/01/introducing-the-xmlloader-class/</link>
		<comments>http://destroytoday.com/blog/2010/01/introducing-the-xmlloader-class/#comments</comments>
		<pubDate>Tue, 19 Jan 2010 14:43:45 +0000</pubDate>
		<dc:creator>Jonnie</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[AIR]]></category>
		<category><![CDATA[Announcement]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://destroytoday.com/blog/?p=1700</guid>
		<description><![CDATA[I started the XMLLoader class a few months back, but didn&#8217;t post right away because it needed a lot of cleanup. Not cleanup in the sense of performance improvement or refactoring—it simply used my old programming style, full of dollar signs and underscores. If anyone remembers seeing my code in that form, I deeply apologize [...]]]></description>
			<content:encoded><![CDATA[<p>I started the <a href="http://github.com/destroytoday/DestroyFramework/blob/master/src/com/destroytoday/net/XMLLoader.as" target="_blank">XMLLoader</a> class a few months back, but didn&#8217;t post right away because it needed a lot of cleanup. Not cleanup in the sense of performance improvement or refactoring—it simply used my old programming style, full of dollar signs and underscores. If anyone remembers seeing my code in that form, I deeply apologize for the pain it must have caused your eyes.</p>
<p>So why an <em>XMLLoader</em> class?—because 99% of the data I load with AS3/AIR is in XML format. I stay far from JSON when possible because in AS3 it&#8217;s slower than a slug on its day off. XML is native and uses E4X, which lets developers navigate its information just like you would an AS3 tree. I load XML so often, I found myself copying and pasting the same code each time I&#8217;d need it—this is the clearest indicator that a class must be written.</p>
<p>Parsing String data to XML poses an issue that many don&#8217;t know about. I only discovered it because of the Twitter API. The API is so janked, it sometimes returns the HTML error page instead of the XML response. It wouldn&#8217;t be so bad if it weren&#8217;t for an image tag in the HTML that isn&#8217;t closed. This immediately throws an &#8220;XML parser failure: element is malformed&#8221; error. Using try/catch is the only way to avoid this. That&#8217;s why I wrote it into <em>XMLLoader</em>. It automatically handles the data, attempts to parse it, and, if there are any errors, the load stops and dispatches an error signal.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
</pre></td><td class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #0000FF;">package</span> <span style="color: #000000;">&#123;</span>
	<span style="color: #0000FF;">import</span> com.destroytoday.net.XMLLoader;
&nbsp;
	<span style="color: #0000FF;">import</span> <span style="color: #000000;">flash.display</span>.<span style="color: #000000;">Sprite</span>;
&nbsp;
	<span style="color: #0000FF;">public</span> <span style="color: #0000FF;">class</span> Test extends <span style="color: #000000;">Sprite</span> <span style="color: #000000;">&#123;</span>
		<span style="color: #0000FF;">public</span> <span style="color: #FF0000;">var</span> <span style="color: #FF0000;">loader</span><span style="color: #000000;">:</span>XMLLoader;
&nbsp;
		<span style="color: #0000FF;">public</span> <span style="color: #FF0000;">function</span> Test<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
			<span style="color: #FF0000;">loader</span> = <span style="color: #0000FF;">new</span> XMLLoader<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
			<span style="color: #FF0000;">loader</span>.retryCount = <span style="color: #000000;">2</span>;
			<span style="color: #FF0000;">loader</span>.includeResponseInfo = <span style="color: #0000FF;">true</span>;
&nbsp;
			<span style="color: #FF0000;">loader</span>.openSignal.<span style="color: #FF0000;">add</span><span style="color: #000000;">&#40;</span>loaderOpenHandler<span style="color: #000000;">&#41;</span>;
			<span style="color: #FF0000;">loader</span>.completeSignal.<span style="color: #FF0000;">add</span><span style="color: #000000;">&#40;</span>loaderCompleteHandler<span style="color: #000000;">&#41;</span>;
			<span style="color: #FF0000;">loader</span>.errorSignal.<span style="color: #FF0000;">add</span><span style="color: #000000;">&#40;</span>loaderErrorHandler<span style="color: #000000;">&#41;</span>;
&nbsp;
			<span style="color: #FF0000;">loader</span>.<span style="color: #FF0000;">load</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;http://search.twitter.com/search.atom?q=destroytoday&quot;</span><span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #0000FF;">protected</span> <span style="color: #FF0000;">function</span> loaderOpenHandler<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">loader</span><span style="color: #000000;">:</span>XMLLoader<span style="color: #000000;">&#41;</span><span style="color: #000000;">:</span><span style="color: #0000FF;">void</span> <span style="color: #000000;">&#123;</span>
			<span style="color: #FF0000;">trace</span><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">loader</span><span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #0000FF;">protected</span> <span style="color: #FF0000;">function</span> loaderCompleteHandler<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">loader</span><span style="color: #000000;">:</span>XMLLoader, <span style="color: #FF0000;">data</span><span style="color: #000000;">:</span><span style="color: #000000;">XML</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">:</span><span style="color: #0000FF;">void</span> <span style="color: #000000;">&#123;</span>
			<span style="color: #FF0000;">trace</span><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">loader</span>, <span style="color: #FF0000;">data</span><span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #0000FF;">protected</span> <span style="color: #FF0000;">function</span> loaderErrorHandler<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">loader</span><span style="color: #000000;">:</span>XMLLoader, <span style="color: #FF0000;">error</span><span style="color: #000000;">:</span><span style="color: #000000;">String</span>, <span style="color: #FF0000;">message</span><span style="color: #000000;">:</span><span style="color: #000000;">String</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">:</span><span style="color: #0000FF;">void</span> <span style="color: #000000;">&#123;</span>
			<span style="color: #FF0000;">trace</span><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">loader</span>, <span style="color: #FF0000;">error</span>, <span style="color: #FF0000;">message</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #FF0000;">trace</span><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">loader</span>.responseStatus<span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
	<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<p>Speaking of signals, <em>XMLLoader</em> is the first class in <a href="http://github.com/destroytoday/DestroyFramework" target="_blank">DestroyFramework</a> to use <a href="http://robertpenner.com/flashblog/" target="_blank">Robert Penner&#8217;s</a> <a href="http://github.com/robertpenner/as3-signals" target="_blank">AS3 Signals</a> instead of events. If you have to ask why, you haven&#8217;t been programming in AS3 long enough. Each <em>XMLLoader</em> instance has signals for <em>open</em>, <em>complete</em>, <em>error</em>, and <em>cancel</em>. The class also includes a <em>retryCount</em> property that indicates how many times to attempt to load a URL before calling it quits. Since some APIs can be down one second, then up the next, this feature really comes in handy. It&#8217;s mainly intended for handling the beloved fail whale.</p>
<p>The last two features include a <em>cancel</em> method and an <em>includeResponseInfo</em> property. Sure, <em>URLLoader</em> has a cancel method, <em>close</em>, but an exception is thrown if you call <em>close</em> when no operation is in progress. This makes sense, but the runtime shouldn&#8217;t close down shop when it happens. <em>XMLLoader</em> instead cancels and dispatches the <em>cancel</em> signal when the cancel method is called, and if no operations are in progress, it simply does nothing.</p>
<p>The <em>includeResponseInfo</em> property is an incredibly easy way to tell the loader to return the response status code and headers upon success or fail. Without <em>XMLLoader</em>, you could get this information with an event listener and the appropriate handler, but it&#8217;s far easier to flick a switch. In all honesty, I&#8217;ve neglected to retrieve this info using <em>URLLoader</em> in the past simply because it&#8217;s such a verbose process. Now that it only requires setting the property to <em>true</em>, I know I&#8217;ll use it more often than not.</p>
<p>As always, the <a href="http://github.com/destroytoday/DestroyFramework/blob/master/src/com/destroytoday/net/XMLLoader.as" target="_blank">source code</a> is available on <a href="http://github.com" target="_blank">GitHub</a>. Be sure to keep watch—my account will be pretty active these next few weeks.</p>
]]></content:encoded>
			<wfw:commentRss>http://destroytoday.com/blog/2010/01/introducing-the-xmlloader-class/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Getting back into the swing of things</title>
		<link>http://destroytoday.com/blog/2010/01/getting-back-into-the-swing-of-things/</link>
		<comments>http://destroytoday.com/blog/2010/01/getting-back-into-the-swing-of-things/#comments</comments>
		<pubDate>Sun, 17 Jan 2010 16:38:27 +0000</pubDate>
		<dc:creator>Jonnie</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Announcement]]></category>
		<category><![CDATA[Future]]></category>
		<category><![CDATA[Photography]]></category>
		<category><![CDATA[Thoughts]]></category>

		<guid isPermaLink="false">http://destroytoday.com/blog/?p=1688</guid>
		<description><![CDATA[It&#8217;s been a solid 17 days since I started Destroy Everyday—the creation-a-day mini blog aimed to balance my life between coding and off-the-computer mediums. So far, it&#8217;s been a success, meaning I have yet to miss a day. It&#8217;s been such a personal success that I&#8217;ve somewhat neglected the mothership—Destroy Today. Now that I have [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been a solid 17 days since I started <a href="http://destroyeveryday.com" target="_blank">Destroy Everyday</a>—the creation-a-day mini blog aimed to balance my life between coding and off-the-computer mediums. So far, it&#8217;s been a success, meaning I have yet to miss a day. It&#8217;s been such a personal success that I&#8217;ve somewhat neglected the mothership—Destroy Today. Now that I have a solid routine down for the new year, it&#8217;s time to get back to business and stay active across the board.</p>
<p>I have a number of new <a href="http://github.com/destroytoday/DestroyFramework" target="_blank">DestroyFramework</a> classes ready to document and check-in over the next few days. I plan to get back into sharing interesting and useful things I come across, regarding both programming and design. And, now that I&#8217;ve been introduced to MVC(S) and <a href="http://robotlegs.org/" target="_blank">RobotLegs</a>, I have a lot more to talk about—expect a tutorial in the near future.</p>
<p>To add some imagery to this post, below is yesterday&#8217;s Destroy Everyday post featuring <a href="http://andymangold.com" target="_blank">Andy Mangold</a>. I also included a detail shot because the web-sized image really doesn&#8217;t do it justice.</p>
<p><a href="http://destroyeveryday.com"><img class="alignnone size-full wp-image-1690" title="andy" src="http://destroytoday.com/blog/wp-content/uploads/2010/01/andy.jpg" alt="andy" width="645" height="451" /></a></p>
<p><a href="http://destroyeveryday.com"><img class="alignnone size-full wp-image-1689" title="andy_detail" src="http://destroytoday.com/blog/wp-content/uploads/2010/01/andy_detail.jpg" alt="andy_detail" width="645" height="509" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://destroytoday.com/blog/2010/01/getting-back-into-the-swing-of-things/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>2010 is destroyeveryday.com</title>
		<link>http://destroytoday.com/blog/2010/01/2010-is-destroyeveryday-com/</link>
		<comments>http://destroytoday.com/blog/2010/01/2010-is-destroyeveryday-com/#comments</comments>
		<pubDate>Sat, 02 Jan 2010 02:58:40 +0000</pubDate>
		<dc:creator>Jonnie</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Announcement]]></category>
		<category><![CDATA[Photography]]></category>

		<guid isPermaLink="false">http://destroytoday.com/blog/?p=1679</guid>
		<description><![CDATA[
It&#8217;s the new year and the best day to start anything. In my search for a hobby off the computer, I compromised and found a semi-off-the-computer challenge. Jen led me to the &#8220;Make Something Cool Every Day&#8221; concept. It&#8217;s a great motivation to consistently produce work while strengthening creativity. The best example I&#8217;ve seen yet [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://destroyeveryday.com"><img class="alignnone size-full wp-image-1680" title="destroyeveryday.com" src="http://destroytoday.com/blog/wp-content/uploads/2010/01/2010_01_01.jpg" alt="destroyeveryday.com" width="645" height="293" /></a></p>
<p>It&#8217;s the new year and the best day to start anything. In my search for a hobby off the computer, I compromised and found a semi-off-the-computer challenge. Jen led me to the &#8220;Make Something Cool Every Day&#8221; concept. It&#8217;s a great motivation to consistently produce work while strengthening creativity. The best example I&#8217;ve seen yet is <a href="http://www.behance.net/Gallery/Make-Something-Cool-Every-Day-2009/171640" target="_blank">Brock Davis&#8217;s portfolio</a> on <a href="http://behance.net" target="_blank">Behance</a>. Surely, I don&#8217;t expect to think up ideas as original as his, but I plan to use this as a stimulus to return to photography, print, and any other physical mediums I&#8217;ve neglected over the years.</p>
<p>The daily creations will reside on <a href="http://destroyeveryday.com" target="_blank">destroyeveryday.com</a> as a <a href="http://tumblr.com" target="_blank">Tumblr</a> blog. The service provides a dozen different ways to post content, so &#8220;I didn&#8217;t have access to a computer&#8221; won&#8217;t be an excuse for missing a day—believe it or not, you can post content via a 1-800 number. Here&#8217;s to the new year and the beginning of a new venture.</p>
]]></content:encoded>
			<wfw:commentRss>http://destroytoday.com/blog/2010/01/2010-is-destroyeveryday-com/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Merry Christmas!</title>
		<link>http://destroytoday.com/blog/2009/12/merry-christmas/</link>
		<comments>http://destroytoday.com/blog/2009/12/merry-christmas/#comments</comments>
		<pubDate>Fri, 25 Dec 2009 15:22:57 +0000</pubDate>
		<dc:creator>Jonnie</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Announcement]]></category>

		<guid isPermaLink="false">http://destroytoday.com/blog/?p=1664</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-1665" title="merrychristmas" src="http://destroytoday.com/blog/wp-content/uploads/2009/12/merrychristmas.jpg" alt="merrychristmas" width="645" height="907" /></p>
]]></content:encoded>
			<wfw:commentRss>http://destroytoday.com/blog/2009/12/merry-christmas/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Introducing the AsyncLoop class</title>
		<link>http://destroytoday.com/blog/2009/12/introducing-the-asyncloop-class/</link>
		<comments>http://destroytoday.com/blog/2009/12/introducing-the-asyncloop-class/#comments</comments>
		<pubDate>Wed, 23 Dec 2009 06:17:02 +0000</pubDate>
		<dc:creator>Jonnie</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Announcement]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://destroytoday.com/blog/?p=1645</guid>
		<description><![CDATA[Out of my recent work, I&#8217;m especially proud of and excited about the AsyncLoop class. It&#8217;s a serious performance enhancer that takes heavy processes and spreads them out over time, preventing stalls and possible lockups. I originally wrote it to deal with a for loop that contained a complex process and iterated 1000 times. Needless [...]]]></description>
			<content:encoded><![CDATA[<p>Out of my recent work, I&#8217;m especially proud of and excited about the <a href="http://github.com/destroytoday/DestroyFramework/blob/master/src/com/destroytoday/timer/AsyncLoop.as" target="_blank">AsyncLoop</a> class. It&#8217;s a serious performance enhancer that takes heavy processes and spreads them out over time, preventing stalls and possible lockups. I originally wrote it to deal with a <code>for</code> loop that contained a complex process and iterated 1000 times. Needless to say, the beach ball made an extended stay each time the loop ran. After implementing <code>AsyncLoop</code>, the beach ball disappeared and animations played smooth throughout.</p>
<p><code>AsyncLoop</code> works around a timer limit. The developer sets the maximum number of milliseconds to loop through the process function. Once the timer exceeds that limit, it carries over to the next frame and repeats. The loop can be ended a number of ways, providing great flexibility. A limit can be placed on the loop count, mimicking common <code>for</code> loop usage. The loop can return the <code>AsyncLoopAction.BREAK</code> constant. When using that method, <code>AsyncLoopAction.CONTINUE</code> is used to tell the loop to continue to the next tick. Each loop provides analytics, keeping track of its duration, loop count, and frame count. Here are two ways you can use it:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
</pre></td><td class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #FF0099;">// new AsyncLoop(callback:Function, countLimit:int = -1, timerLimit:int = 20);</span>
<span style="color: #FF0000;">var</span> <span style="color: #FF0000;">loop</span><span style="color: #000000;">:</span>AsyncLoop = <span style="color: #0000FF;">new</span> AsyncLoop<span style="color: #000000;">&#40;</span>tick, <span style="color: #000000;">1000</span><span style="color: #000000;">&#41;</span>;
&nbsp;
<span style="color: #FF0000;">loop</span>.<span style="color: #FF0000;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">Event</span>.<span style="color: #000000;">OPEN</span>, loopOpenHandler<span style="color: #000000;">&#41;</span>;
<span style="color: #FF0000;">loop</span>.<span style="color: #FF0000;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">Event</span>.<span style="color: #000000;">CHANGE</span>, loopChangeHandler<span style="color: #000000;">&#41;</span>;
<span style="color: #FF0000;">loop</span>.<span style="color: #FF0000;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">Event</span>.<span style="color: #000000;">COMPLETE</span>, loopCompleteHandler<span style="color: #000000;">&#41;</span>;
&nbsp;
<span style="color: #FF0000;">loop</span>.<span style="color: #FF0000;">start</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
<span style="color: #FF0000;">function</span> tick<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">:</span><span style="color: #0000FF;">void</span> <span style="color: #000000;">&#123;</span>
	<span style="color: #FF0099;">// heavy process</span>
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #FF0000;">function</span> loopOpenHandler<span style="color: #000000;">&#40;</span>event<span style="color: #000000;">:</span><span style="color: #000000;">Event</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">:</span><span style="color: #0000FF;">void</span> <span style="color: #000000;">&#123;</span>
	<span style="color: #FF0099;">// loop started</span>
<span style="color: #000000;">&#125;</span>
<span style="color: #FF0000;">function</span> loopChangeHandler<span style="color: #000000;">&#40;</span>event<span style="color: #000000;">:</span><span style="color: #000000;">Event</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">:</span><span style="color: #0000FF;">void</span> <span style="color: #000000;">&#123;</span>
	<span style="color: #FF0099;">// loop carries over to next frame</span>
&nbsp;
	<span style="color: #FF0000;">trace</span><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">loop</span>.duration<span style="color: #000000;">&#41;</span>; <span style="color: #FF0099;">// incomplete loop running time</span>
	<span style="color: #FF0000;">trace</span><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">loop</span>.<span style="color: #FF0000;">currentCount</span><span style="color: #000000;">&#41;</span>; <span style="color: #FF0099;">// number of callback calls</span>
<span style="color: #000000;">&#125;</span>
<span style="color: #FF0000;">function</span> loopCompleteHandler<span style="color: #000000;">&#40;</span>event<span style="color: #000000;">:</span><span style="color: #000000;">Event</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">:</span><span style="color: #0000FF;">void</span> <span style="color: #000000;">&#123;</span>
	<span style="color: #FF0099;">// loop complete</span>
&nbsp;
	<span style="color: #FF0000;">trace</span><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">loop</span>.duration<span style="color: #000000;">&#41;</span>; <span style="color: #FF0099;">// completed loop duration</span>
	<span style="color: #FF0000;">trace</span><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">loop</span>.frameCount<span style="color: #000000;">&#41;</span>; <span style="color: #FF0099;">// frames needed to complete</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
</pre></td><td class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #FF0000;">var</span> <span style="color: #FF0000;">loop</span><span style="color: #000000;">:</span>AsyncLoop = <span style="color: #0000FF;">new</span> AsyncLoop<span style="color: #000000;">&#40;</span>tick<span style="color: #000000;">&#41;</span>;
&nbsp;
<span style="color: #FF0000;">loop</span>.<span style="color: #FF0000;">start</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
<span style="color: #FF0000;">stage</span>.<span style="color: #FF0000;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">MouseEvent</span>.<span style="color: #000000;">CLICK</span>, clickHandler<span style="color: #000000;">&#41;</span>;
<span style="color: #FF0000;">stage</span>.<span style="color: #FF0000;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">MouseEvent</span>.<span style="color: #000000;">DOUBLE_CLICK</span>, doubleClickHandler<span style="color: #000000;">&#41;</span>;
&nbsp;
<span style="color: #FF0000;">function</span> tick<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">:</span><span style="color: #000000;">String</span> <span style="color: #000000;">&#123;</span>
	<span style="color: #FF0099;">// heavy process</span>
&nbsp;
	<span style="color: #0000FF;">if</span> <span style="color: #000000;">&#40;</span>loopShouldEnd<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
		<span style="color: #0000FF;">return</span> AsyncLoopAction.BREAK;
	<span style="color: #000000;">&#125;</span>
&nbsp;
	<span style="color: #0000FF;">return</span> AsyncLoopAction.CONTINUE;
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #FF0000;">function</span> clickHandler<span style="color: #000000;">&#40;</span>event<span style="color: #000000;">:</span><span style="color: #000000;">MouseEvent</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">:</span><span style="color: #0000FF;">void</span> <span style="color: #000000;">&#123;</span>
	<span style="color: #0000FF;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #FF0000;">loop</span>.<span style="color: #FF0000;">running</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
		<span style="color: #FF0000;">loop</span>.<span style="color: #FF0000;">pause</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
	<span style="color: #000000;">&#125;</span> <span style="color: #0000FF;">else</span> <span style="color: #000000;">&#123;</span>
		<span style="color: #FF0000;">loop</span>.<span style="color: #FF0000;">start</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
	<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span>
<span style="color: #FF0000;">function</span> doubleClickHandler<span style="color: #000000;">&#40;</span>event<span style="color: #000000;">:</span><span style="color: #000000;">MouseEvent</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">:</span><span style="color: #0000FF;">void</span> <span style="color: #000000;">&#123;</span>
	<span style="color: #FF0000;">loop</span>.<span style="color: #FF0000;">cancel</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<p>I&#8217;m really happy with the class and how far it has come since its original form as <code>fLoop</code>. As always, the <a href="http://github.com/destroytoday/DestroyFramework/blob/master/src/com/destroytoday/timer/AsyncLoop.as" target="_blank">source code</a> is on GitHub, so take it and run! If you find it useful, feel free to share how you used it, or simply let me know what you think.</p>
]]></content:encoded>
			<wfw:commentRss>http://destroytoday.com/blog/2009/12/introducing-the-asyncloop-class/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Introducing the ApplicationUtil class</title>
		<link>http://destroytoday.com/blog/2009/12/introducing-the-applicationutil-class/</link>
		<comments>http://destroytoday.com/blog/2009/12/introducing-the-applicationutil-class/#comments</comments>
		<pubDate>Mon, 21 Dec 2009 14:23:05 +0000</pubDate>
		<dc:creator>Jonnie</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[AIR]]></category>
		<category><![CDATA[Announcement]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://destroytoday.com/blog/?p=1639</guid>
		<description><![CDATA[Yesterday, during my weekly football &#8220;service&#8221;, I spent a few minutes starting the ApplicationUtil class. So far, it consists of only two methods, getVersion and closeOpenWindows. The first accesses the application descriptor and returns the application&#8217;s version. closeOpenWindows is a necessity I learned in the Apollo days from Christian Cantrell. I had issues with my [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday, during my weekly football &#8220;service&#8221;, I spent a few minutes starting the <a href="http://github.com/destroytoday/DestroyFramework/blob/master/src/com/destroytoday/util/ApplicationUtil.as" target="_blank">ApplicationUtil</a> class. So far, it consists of only two methods, <code>getVersion</code> and <code>closeOpenWindows</code>. The first accesses the application descriptor and returns the application&#8217;s version. <code>closeOpenWindows</code> is a necessity I learned in the Apollo days from <a href="http://blogs.adobe.com/cantrell/" target="_blank">Christian Cantrell</a>. I had issues with my first AIR app, <a href="http://destroytoday.com/releases/DestroyFlickr108B.zip" target="_blank">DestroyFlickr</a>, where it wouldn&#8217;t quit, even if all of the visible windows were closed. I commonly use window visibility to show/hide utility windows, so the invisible ones were hanging around, keeping the app open. This method runs a quick loop to close all open windows, visible or not. It also includes an <code>andQuit</code> argument that, when true, sets <code>autoExit</code> to true, which quits the app upon close of the windows. Here&#8217;s some unnecessary example code to give this post more character:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #FF0000;">var</span> <span style="color: #FF0000;">version</span><span style="color: #000000;">:</span><span style="color: #000000;">String</span> = ApplicationUtil.getVersion<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
<span style="color: #FF0000;">trace</span><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">version</span><span style="color: #000000;">&#41;</span>; <span style="color: #FF0099;">// v1</span>
&nbsp;
<span style="color: #FF0000;">trace</span><span style="color: #000000;">&#40;</span>NativeApplication.nativeApplication.openedWindows.<span style="color: #FF0000;">length</span><span style="color: #000000;">&#41;</span>; <span style="color: #FF0099;">// 3</span>
ApplicationUtil.closeOpenWindows<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
<span style="color: #FF0000;">trace</span><span style="color: #000000;">&#40;</span>NativeApplication.nativeApplication.openedWindows.<span style="color: #FF0000;">length</span><span style="color: #000000;">&#41;</span>; <span style="color: #FF0099;">// 0</span>
&nbsp;
<span style="color: #FF0099;">// suppose three windows are open again</span>
ApplicationUtil.closeOpenWindows<span style="color: #000000;">&#40;</span><span style="color: #0000FF;">true</span><span style="color: #000000;">&#41;</span>; <span style="color: #FF0099;">// closes windows and quits before trace is called</span>
<span style="color: #FF0000;">trace</span><span style="color: #000000;">&#40;</span>NativeApplication.nativeApplication.openedWindows.<span style="color: #FF0000;">length</span><span style="color: #000000;">&#41;</span>;</pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://destroytoday.com/blog/2009/12/introducing-the-applicationutil-class/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Introducing the Scale9Bitmap class</title>
		<link>http://destroytoday.com/blog/2009/12/introducing-the-scale9bitmap-class/</link>
		<comments>http://destroytoday.com/blog/2009/12/introducing-the-scale9bitmap-class/#comments</comments>
		<pubDate>Sun, 20 Dec 2009 02:23:06 +0000</pubDate>
		<dc:creator>Jonnie</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Announcement]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://destroytoday.com/blog/?p=1629</guid>
		<description><![CDATA[
The Scale9Bitmap class applies a scale9Grid to a Bitmap. It takes advantage of a technique I used for DestroyTwitter&#8217;s window drop shadow, scaling nine Bitmap instances. When developing the MAX Companion, I tried Didier Brun&#8217;s ScaleBitmap class, but discovered a costly memory leak in which it instantiates a new BitmapData instance with every resize call. [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-1630" title="scale9bitmap" src="http://destroytoday.com/blog/wp-content/uploads/2009/12/scale9bitmap.jpg" alt="scale9bitmap" width="645" height="429" /></p>
<p>The <a href="http://github.com/destroytoday/DestroyFramework/blob/master/src/com/destroytoday/display/Scale9Bitmap.as" target="_blank">Scale9Bitmap</a> class applies a <code>scale9Grid</code> to a <code>Bitmap</code>. It takes advantage of a technique I used for <a href="http://destroytwitter.com">DestroyTwitter&#8217;s</a> window drop shadow, scaling nine <code>Bitmap</code> instances. When developing the <a href="http://destroytoday.com/blog/2009/10/adobe-max-companion-launched/" target="_blank">MAX Companion</a>, I tried <a href="http://bytearray.org" target="_blank">Didier Brun&#8217;s</a> <a href="http://www.bytearray.org/?p=118" target="_blank">ScaleBitmap</a> class, but discovered a costly memory leak in which it instantiates a new <code>BitmapData</code> instance with every resize call. This wouldn&#8217;t be a big deal for a once-and-done resize, but as a window drop shadow, memory skyrockets.</p>
<p>I decided to start from scratch and develop a class that is super fast and slim as can be. The <code>Bitmaps</code> are only updated when the <code>BitmapData</code> is set. After that, the only process that takes place is the resizing of each <code>Bitmap</code>—no <code>BitmapData</code> manipulation needed. Setup requires a single method to set the <code>BitmapData</code> and the <code>Rectangle</code> that indicates the stretchable portion of the <code>Bitmap</code>. <code>BitmapData</code> can be changed on the fly and there is a <code>scale</code> property that sets both <code>scaleX</code> and <code>scaleY</code>.</p>
<p>The <a href="http://github.com/destroytoday/DestroyFramework/blob/master/src/com/destroytoday/display/Scale9Bitmap.as" target="_blank">source code</a> is on GitHub, so feel free to give it a whirl.</p>
]]></content:encoded>
			<wfw:commentRss>http://destroytoday.com/blog/2009/12/introducing-the-scale9bitmap-class/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>
