<?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>Troy Gilbert</title>
	<atom:link href="http://troygilbert.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://troygilbert.com</link>
	<description>Gamedev 2.0</description>
	<lastBuildDate>Sun, 15 Aug 2010 21:12:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Perch: The only CMS I&#8217;ve paid for (and would pay for again!)</title>
		<link>http://troygilbert.com/2010/08/perch-the-only-cms-ive-paid-for-and-would-pay-for-again/</link>
		<comments>http://troygilbert.com/2010/08/perch-the-only-cms-ive-paid-for-and-would-pay-for-again/#comments</comments>
		<pubDate>Sun, 15 Aug 2010 21:12:25 +0000</pubDate>
		<dc:creator>Troy</dc:creator>
				<category><![CDATA[Web Dev]]></category>
		<category><![CDATA[cms]]></category>
		<category><![CDATA[perch]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://troygilbert.com/?p=269</guid>
		<description><![CDATA[Perch is a very interesting CMS package written in PHP. What will jump out at most developers first is the price: NOT free. While many folks use free CMS packages like WordPress these days, or pay for a hosted solution, it&#8217;s not often that you run into a package that&#8217;s both self-hosted and pay-to-use (per [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://grabaperch.com/">Perch</a> is a very interesting CMS package written in PHP. What will jump out at most developers first is the price: NOT free. While many folks use free CMS packages like <a href="http://wordpress.com/">WordPress</a> these days, or pay for a hosted solution, it&#8217;s not often that you run into a package that&#8217;s both self-hosted <em>and</em> pay-to-use (<em>per domain!</em>).</p>
<p>Of course, you get what you pay for, and Perch is definitely worth paying for… for some projects. Perch is very unique in its approach. Consider it an <em>emergent</em> CMS. Perch doesn&#8217;t have a predefined site structure that it builds on. Rather, you insert tags into your pages that CMS picks out and pairs with templates used for data-entry. It took me a while to wrap my head around it, but once I did I found it to be very powerful.</p>
<p>Because it&#8217;s not free (~$55 per domain), I&#8217;ve not used it at every opportunity. So far, I&#8217;ve reserved it for sites where someone else is picking up the tab, which is where it shines because that usually means I&#8217;m building a site for a non-technical user, thus Perch&#8217;s emergent CMS provides the minimal UI for that user&#8217;s site. For example, I used Perch to build a real-estate site for a friend of mine, <a href="http://williamsbrokerage.com/">Williams &#038; Associates</a>.</p>
<p>Originally, I was going to build this site on top of WordPress: pages for fixed content, categorized posts for news and property listings. I found a plugin that would provide a custom set of form fields for editing a post that would&#8217;ve worked well for the property listings… if I could have gotten it working. In the end, I was fighting WP more than it was helping me, and even if everything worked as planned there would still be a hugely complicated admin UI presented to the client whenever they wanted to make changes. (Yes, there are plugins to address that as well…)</p>
<p>I then ran across Perch. I loved its minimalism. It allowed me to build the site exactly as I wanted &mdash; which if you look at the HTML, you&#8217;ll see is pretty minimal, way more than a normal WP site would be &mdash; and then generate the admin-side of things automatically from its structure. Perch 1.0 definitely lacked some major features, such as image uploads and list re-ordering, but these have largely been addressed in recent updates (though they were slower coming than I would have hoped).</p>
<p>In fact, I was quite happy to see that when I recently went in to make some updates to the site, I ended up spending far more time in the admin UI editing text than I did touching any HTML structure, much of this thanks to Perch&#8217;s native support of Textile and Markdown.</p>
<p>Just last week, Perch 1.5.5 was announced, and I&#8217;m looking forward to playing with its new features. They include the notion of &#8220;apps&#8221; that I&#8217;m very interested in checking out. I do wish Perch was free, or significantly cheaper (say, $5 for non-commercial sites), or offered a subscription license (unlimited domains for a year) as it&#8217;s a perfect fit for lots of throw-away sites where a full-blown CMS would simply be overkill.</p>
<div class="tw_button" style="margin-bottom: 10px;"><a href="http://twitter.com/share?url=http%3A%2F%2Ftroygilbert.com%2F2010%2F08%2Fperch-the-only-cms-ive-paid-for-and-would-pay-for-again%2F&amp;via=troygilbert&amp;text=Perch%3A+The+only+CMS+I%27ve+paid+for+%28and+would+pay+for+again%21%29&amp;lang=en&amp;count=horizontal" style="" class="twitter-share-button">Tweet</a></div>
]]></content:encoded>
			<wfw:commentRss>http://troygilbert.com/2010/08/perch-the-only-cms-ive-paid-for-and-would-pay-for-again/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>The Grand Compromise</title>
		<link>http://troygilbert.com/2010/05/the-grand-compromise/</link>
		<comments>http://troygilbert.com/2010/05/the-grand-compromise/#comments</comments>
		<pubDate>Mon, 03 May 2010 04:30:08 +0000</pubDate>
		<dc:creator>Troy</dc:creator>
				<category><![CDATA[AS3 & Flash]]></category>
		<category><![CDATA[Web Dev]]></category>
		<category><![CDATA[adobe]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[html5]]></category>

		<guid isPermaLink="false">http://troygilbert.com/?p=267</guid>
		<description><![CDATA[I propose the following Grand Compromise: The WHATWG and W3C revise the Canvas API to align with Flash&#8217;s Display List API. Adobe donates the Flash Player to the WebKit project to serve as an initial implementation of the revised Canvas API. Apple, Google and Microsoft adopt and implement the revised Canvas API in all of [...]]]></description>
			<content:encoded><![CDATA[<p>I propose the following Grand Compromise:</p>
<ol>
<li>The WHATWG and W3C revise the Canvas API to align with Flash&#8217;s Display List API.</li>
<li>Adobe donates the Flash Player to the WebKit project to serve as an initial implementation of the revised Canvas API.</li>
<li>Apple, Google and Microsoft adopt and implement the revised Canvas API in all of their desktop and mobile browsers.</li>
</ol>
<p>I think this is an ideal compromise: everyone gives a little, everyone gains a lot. There are no losers.</p>
<p>I&#8217;ll address each point in more detail this week.
<div class="tw_button" style="margin-bottom: 10px;"><a href="http://twitter.com/share?url=http%3A%2F%2Ftroygilbert.com%2F2010%2F05%2Fthe-grand-compromise%2F&amp;via=troygilbert&amp;text=The+Grand+Compromise&amp;lang=en&amp;count=horizontal" style="" class="twitter-share-button">Tweet</a></div>
]]></content:encoded>
			<wfw:commentRss>http://troygilbert.com/2010/05/the-grand-compromise/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Flash is my platform.</title>
		<link>http://troygilbert.com/2010/04/flash-is-my-platform/</link>
		<comments>http://troygilbert.com/2010/04/flash-is-my-platform/#comments</comments>
		<pubDate>Thu, 22 Apr 2010 05:05:16 +0000</pubDate>
		<dc:creator>Troy</dc:creator>
				<category><![CDATA[AS3 & Flash]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Real Life]]></category>

		<guid isPermaLink="false">http://troygilbert.com/?p=263</guid>
		<description><![CDATA[Hi, my name is Troy. I&#8217;m a Flash Developer. Like many people my age, I first experimented with Flash during college. It was the 90&#8242;s, the web was new and exciting, and honestly we&#8217;d try anything. I got into it deep. I created the site OpenSWF.org. I maintained an updated SWF file format spec and [...]]]></description>
			<content:encoded><![CDATA[<p>Hi, my name is Troy. I&#8217;m a Flash Developer.</p>
<p>Like many people my age, I first experimented with Flash during college. It was the 90&#8242;s, the web was new and exciting, and honestly we&#8217;d try anything.</p>
<p>I got into it deep. I created the site OpenSWF.org. I maintained an updated SWF file format spec and built a Java-based player. In fact, this was pre-ActionScript, so I even designed an extension mechanism that leveraged Java&#8217;s dynamic class loading to allow on-the-fly, distributed updates to the player itself.</p>
<p>Then, I graduated from college, I got married, I got a grown-up job; I left my childish Flash ways behind me and got serious: C++, vector units, video game consoles, multi-million dollar projects.</p>
<p>Five years later I read an incredibly influential whitepaper from Scott Bilas, former Bungie engineer, based on his GDC 2005 presentation: <a href="http://web.archive.org/web/20080419055823/http://www.drizzle.com/~scottb/gdc/flash-paper.htm">What About Flash? Can We Really Make Games With It?</a> I fell back in love.</p>
<p>Within a year I set out to launch my first (and only) startup, <a href="http://mockingbirdgames.com/">Mockingbird Games</a>, with the goal of making <em>game making</em> as fun as <em>game playing</em>. Much like YouTube, we leveraged the Flash Platform to deliver our core experience to as many people as possible.</p>
<p>For the last 3 years I&#8217;ve been developing on the Flash Platform all day, every day. I&#8217;ve designed and built a flexible game architecture, a large and complex web application, and many games and apps for clients such as MTV, Paramount, Disney, Mattel and Hasbro. Me, myself and I programmed every single line of code. Millions of people have played these games and used these apps, and tens of thousands of games/levels have been made with <em>just our apps</em>.</p>
<p>During those 3 short years, the Flash Platform has gone from v8 to v10, from ActionScript2 to ActionScript3, from purely interpreted to a modern, JIT&#8217;d virtual machine, from a vector-only renderer to a high-performance raster/bitblit renderer. We&#8217;ve gotten a declarative markup language for building apps, a high-quality UI framework, multiple free &#038; commercial IDEs and an open-source compiler.</p>
<p>I can write an app for the Flash Platform, compiled with free, open-source tools using a free, open-source SDK, and it will run on Windows, OS X, Linux, Android and iPhone with zero changes. I don&#8217;t need anyone&#8217;s permission to do this, or anyone&#8217;s blessing. My app sinks or swims based on its quality, including not only the work I&#8217;ve done but the work I&#8217;m building on top of, the Flash Platform itself.</p>
<p><em>Amazingly, I could have done this 4 years ago with Flash. In fact, in 2006 I could have used a freely available compiler (mtasc) and free toolchain (swfmill) to produce a SWF that would still work today, unchanged on these platforms. But I digress…</em></p>
<p>I&#8217;m not alone in my experience: there are thousands of Flash developers out there building fantastic interactive content. Fantastic webapps like <a href="http://www.picnik.com/">Picnik</a>, <a href="http://www.audiotool.com/">Audiotool</a>, <a href="http://www.playcrafter.com/">Playcrafter</a> and <a href="http://www.balsamiq.com/">Balsamiq</a>. Even more fantastic games like <a href="http://adamatomic.com/canabalt/">Canabalt</a>, <a href="http://machinarium.net/demo/">Machinarium</a> and <a href="http://www.clubtreasureworld.com/">Club Treasure World</a>. <strong>And about a hundred thousand more examples.</strong></p>
<p>There&#8217;s something all of these examples have in common: their monetization and distribution are entirely within the control of their developers, and they are freely accessible by virtually any modern desktop computer. For me, this is the definition of an open platform.</p>
<p>Furthermore, many of these apps were built with freely available, open-source tools. They&#8217;re all published to a bytecode format that&#8217;s documented, well-defined and backwards compatible. They run on a player that&#8217;s freely available and is actively being maintained, improved and migrated to new platforms. For me, this is the definition of an open platform.</p>
<p>Flash has provided some unbelievable shoulders for me to stand on. I have used Flash to make my livelihood, to create my dreams and to share them with millions. I&#8217;ve used dozens of others languages and platforms over my last 20 years of programming, and none have done as much for me.</p>
<p>I support Flash. I&#8217;ll defend its role in the modern web. Flash is my platform.</p>
<div class="tw_button" style="margin-bottom: 10px;"><a href="http://twitter.com/share?url=http%3A%2F%2Ftroygilbert.com%2F2010%2F04%2Fflash-is-my-platform%2F&amp;via=troygilbert&amp;text=Flash+is+my+platform.&amp;lang=en&amp;count=horizontal" style="" class="twitter-share-button">Tweet</a></div>
]]></content:encoded>
			<wfw:commentRss>http://troygilbert.com/2010/04/flash-is-my-platform/feed/</wfw:commentRss>
		<slash:comments>39</slash:comments>
		</item>
		<item>
		<title>Auto-sized Windows</title>
		<link>http://troygilbert.com/2010/04/auto-sized-windows/</link>
		<comments>http://troygilbert.com/2010/04/auto-sized-windows/#comments</comments>
		<pubDate>Thu, 15 Apr 2010 04:46:14 +0000</pubDate>
		<dc:creator>Troy</dc:creator>
				<category><![CDATA[AS3 & Flash]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[air]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[mxml]]></category>

		<guid isPermaLink="false">http://troygilbert.com/?p=261</guid>
		<description><![CDATA[I asked around last week if anybody had suggestions for how to make an &#60;mx:Window/&#62; auto-size itself to its content. The general opinion was to simply override the measure() method setting width and height to the measured width and height. Never quite worked out. So, I&#8217;ve kind of obsessed about it this evening and put [...]]]></description>
			<content:encoded><![CDATA[<p>I asked around last week if anybody had suggestions for how to make an <tt>&lt;mx:Window/&gt;</tt> auto-size itself to its content. The general opinion was to simply override the <tt>measure()</tt> method setting <tt>width</tt> and <tt>height</tt> to the measured width and height. Never quite worked out.</p>
<p>So, I&#8217;ve kind of obsessed about it this evening and put together a pretty solid solution. I think you AIR folks out there will be interested in it. Very handy. Set <tt>autoWidth</tt> and/or <tt>autoHeight</tt> to true to lock that dimension to the ideal (based on the measured children).</p>
<p><script src="http://gist.github.com/366677.js?file=AutoSizedWindow.as"></script></p>
<div class="tw_button" style="margin-bottom: 10px;"><a href="http://twitter.com/share?url=http%3A%2F%2Ftroygilbert.com%2F2010%2F04%2Fauto-sized-windows%2F&amp;via=troygilbert&amp;text=Auto-sized+Windows&amp;lang=en&amp;count=horizontal" style="" class="twitter-share-button">Tweet</a></div>
]]></content:encoded>
			<wfw:commentRss>http://troygilbert.com/2010/04/auto-sized-windows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tax the Top, or Tax the Bottom?</title>
		<link>http://troygilbert.com/2010/04/tax-the-top-or-tax-the-bottom/</link>
		<comments>http://troygilbert.com/2010/04/tax-the-top-or-tax-the-bottom/#comments</comments>
		<pubDate>Tue, 13 Apr 2010 15:26:31 +0000</pubDate>
		<dc:creator>Troy</dc:creator>
				<category><![CDATA[Real Life]]></category>
		<category><![CDATA[government]]></category>
		<category><![CDATA[politics]]></category>
		<category><![CDATA[taxes]]></category>

		<guid isPermaLink="false">http://troygilbert.com/?p=259</guid>
		<description><![CDATA[Conventional Republican wisdom is that cutting taxes on the rich stimulates the economy because of &#8220;trickle-down&#8221; as they spend and hire as a result of the added income. I don&#8217;t know if anyone has definitively shown this to be true, and I don&#8217;t know if you can. But here&#8217;s a thought experiment (which admittedly may [...]]]></description>
			<content:encoded><![CDATA[<p>Conventional Republican wisdom is that cutting taxes on the rich stimulates the economy because of &#8220;trickle-down&#8221; as they spend and hire as a result of the added income. I don&#8217;t know if anyone has definitively shown this to be true, and I don&#8217;t know if you can. But here&#8217;s a thought experiment (which admittedly may be too simplistic):</p>
<p>Imagine $50,000 in &#8220;tax cuts.&#8221; Should we give that benefit to the top income earners, middle income earners, or bottom income earners?</p>
<p>Consider an extremely top earner earning $500,000 a year. Does the $50k change their life? No. Are they likely to spend it? Not immediately, and most likely not in a stimulative fashion. Does the tax cut reduce their burden on the government? No, because they&#8217;re already not a burden, i.e. they aren&#8217;t leveraging Medicare/Medicaid, welfare, food stamps, etc.</p>
<p>Now consider two top earners making $250k a year each. They get tax cuts of $25k each. Does it change their lives? Probably not. Are they likely to spend it? More likely, sure, often times on debt or major purchases (home, car). Stimulative effect? Minor, but some. Reduced burden on the government? Not really, again because they&#8217;re not likely utilizing expensive welfare services.</p>
<p>Now consider four middle earners making $125k a year each. They get tax cuts of $12.5k each. Does it change their lives? Probably doesn&#8217;t change their lives, but it can make some big differences. Credit cards get paid off. Down payments on a home get made. Car gets paid off. Or, if stuck in savings, now someone who more than likely didn&#8217;t have a significant savings &#8220;buffer&#8221; now has a few months of money to help them whether the storm. This buffer saves them even if they lose their jobs, or have emergency medical expenses, or wreck their car. Again, this earner is less dependent on welfare, etc., but they&#8217;re now less likely to ever need it because they&#8217;re in a &#8220;safer&#8221; spot financially.</p>
<p>Finally, consider 16 low income earners making $32k a year each. They each get tax cuts of $3.2k. Does it change their lives? Significantly. Simply spread out over the course of the year it&#8217;s enough to make the difference between being in the red at the end of each month and being in the black. A family of four could move from a 2 bedroom apartment to a 3 bedroom apartment. Healthcare insurance becomes a possibility. Medicaid is less necessary. Food stamps are less likely. Overall quality of life shifts subtly but significantly from sinking to staying afloat. And all the money spent is most likely spent at local businesses, subject to sales taxes, benefitting the local community, and directly employing other low wage workers.</p>
<p>Simplistic, sure. But certainly a more compelling and detailed argument than simple &#8220;trickle-down economics.&#8221; In the case of the top earner, the tax cut is more like a bonus, a cherry on top of an already comfortable, ultra high quality standard of living, with the most likely beneficiaries being other high income earners in the form of commissions on investments, etc. In the case of the bottom earner, the tax cut represents a make or break amount of money, the difference between a livable and poverty lifestyle, a reduction of secondary costs to the government, a healthier, lower-stress population spending money at the local level.</p>
<p>In all cases, the surface cost to the government is the same $50k in loss tax revenues. I think it&#8217;s pretty clear which category benefits the most people to the greatest extent.</p>
<div class="tw_button" style="margin-bottom: 10px;"><a href="http://twitter.com/share?url=http%3A%2F%2Ftroygilbert.com%2F2010%2F04%2Ftax-the-top-or-tax-the-bottom%2F&amp;via=troygilbert&amp;text=Tax+the+Top%2C+or+Tax+the+Bottom%3F&amp;lang=en&amp;count=horizontal" style="" class="twitter-share-button">Tweet</a></div>
]]></content:encoded>
			<wfw:commentRss>http://troygilbert.com/2010/04/tax-the-top-or-tax-the-bottom/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Invalidation Pattern</title>
		<link>http://troygilbert.com/2010/04/invalidation-pattern/</link>
		<comments>http://troygilbert.com/2010/04/invalidation-pattern/#comments</comments>
		<pubDate>Thu, 08 Apr 2010 05:19:06 +0000</pubDate>
		<dc:creator>Troy</dc:creator>
				<category><![CDATA[AS3 & Flash]]></category>
		<category><![CDATA[as3]]></category>

		<guid isPermaLink="false">http://troygilbert.com/?p=257</guid>
		<description><![CDATA[Jesse Freeman asked for advice: I&#8217;m not a stupid person but prop injection is retarded. I need both vars set before calling apply -> http://twitpic.com/1dz5d9 #Advice This comes up quite a bit in Mockingbird since hot-swapping dependencies while a game is running is our major differentiator. In practice, it&#8217;s often not necessary, but it definitely [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://twitter.com/TheFlashBum/status/11804515196">Jesse Freeman asked for advice</a>:</p>
<blockquote><p>I&#8217;m not a stupid person but prop injection is retarded. I need both vars set before calling apply -> <a href="http://twitpic.com/1dz5d9">http://twitpic.com/1dz5d9</a> #Advice</p></blockquote>
<p>This comes up quite a bit in Mockingbird since hot-swapping dependencies while a game is running is our major differentiator. In practice, it&#8217;s often not necessary, but it definitely always make your code more complicated, more fragile and (inevitably) buggier.</p>
<p>If your class has (or ever could have) more than two hot-swappable dependencies, you need a proper invalidation model in order to scale to the dependencies. You can also potentially have a faster object by deferring, and thus aggregating, validations.</p>
<p>Here&#8217;s a quick example class I just wrote-up because code speaks louder than words. To keep things conversational, I typed it up in a text editor and haven&#8217;t actually tried to compile and run it, which probably means there are typos and stupid mistakes. But the point (and pattern) should hold.</p>
<p><script src="http://gist.github.com/359780.js?file=InvalidationPattern.as"></script></p>
<p>If <tt>USE_DEFERRED_VALIDATION</tt> is <tt>true</tt>, validation will not occur immediately when a property changes. Instead, a flag will be set and on the next frame validation will happen. This allows you to set multiple dependencies during one frame and they&#8217;ll all be applied at once the next frame.</p>
<p>The classic game engine loop basically embodies this invalidation model with <tt>update()</tt> (which invalidates) and <tt>draw()</tt> (which validates).</p>
<div class="tw_button" style="margin-bottom: 10px;"><a href="http://twitter.com/share?url=http%3A%2F%2Ftroygilbert.com%2F2010%2F04%2Finvalidation-pattern%2F&amp;via=troygilbert&amp;text=Invalidation+Pattern&amp;lang=en&amp;count=horizontal" style="" class="twitter-share-button">Tweet</a></div>
]]></content:encoded>
			<wfw:commentRss>http://troygilbert.com/2010/04/invalidation-pattern/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Misc.</title>
		<link>http://troygilbert.com/2010/04/misc/</link>
		<comments>http://troygilbert.com/2010/04/misc/#comments</comments>
		<pubDate>Wed, 07 Apr 2010 19:08:37 +0000</pubDate>
		<dc:creator>Troy</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://troygilbert.com/?p=255</guid>
		<description><![CDATA[I&#8217;ve been making a few updates to the organization of the site. Sorry if this caused the RSS feeds to refill with old entries. Things should be settled now for a while. I updated the sidebar to include links to myself elsewhere, places updated slightly more often than the blog. I wanted to specifically point [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been making a few updates to the organization of the site. Sorry if this caused the RSS feeds to refill with old entries. Things should be settled now for a while.</p>
<p>I updated the sidebar to include links to myself elsewhere, places updated slightly more often than the blog.</p>
<p>I wanted to specifically point out <a href="http://dribbble.com/">Dribbble</a>. Excellent site built by <a href="http://simplebits.com/">Simplebits</a> that&#8217;s just recently come out of a private beta. I&#8217;ve made one post so far, but I&#8217;m trying to put in a schedule of posting something daily. There&#8217;s some incredible talent on there producing great stuff.</p>
<p>As many have pointed out, the release model for this site was fantastic. Perfect for a site full of user-generated content produced by avid content creators. It was invite only, and the number of posts is limited (30 a month, I think). I&#8217;ve got a site bubbling right now that I&#8217;m thinking about applying a similar mechanism to.</p>
<p>Now that Dribbble is public, folks will get to see me working on the next big thing! ;-)</p>
<div class="tw_button" style="margin-bottom: 10px;"><a href="http://twitter.com/share?url=http%3A%2F%2Ftroygilbert.com%2F2010%2F04%2Fmisc%2F&amp;via=troygilbert&amp;text=Misc.&amp;lang=en&amp;count=horizontal" style="" class="twitter-share-button">Tweet</a></div>
]]></content:encoded>
			<wfw:commentRss>http://troygilbert.com/2010/04/misc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Preloader Base Class</title>
		<link>http://troygilbert.com/2010/04/preloader-base-class/</link>
		<comments>http://troygilbert.com/2010/04/preloader-base-class/#comments</comments>
		<pubDate>Sat, 03 Apr 2010 05:01:52 +0000</pubDate>
		<dc:creator>Troy</dc:creator>
				<category><![CDATA[AS3 & Flash]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[as3]]></category>

		<guid isPermaLink="false">http://troygilbert.com/?p=252</guid>
		<description><![CDATA[UPDATE: Thanks to the suggestions of Casey, I&#8217;ve updated the base class to use events from the loaderInfo instead of checking each frame, as well as using the frame label as the class name (which I believe is the idiom that Flex&#8217;s [Frame] metadata follows). I reread the preloader post I made earlier today and [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p><strong>UPDATE:</strong> Thanks to the <a href="#comment-47130745">suggestions of Casey</a>, I&#8217;ve updated the base class to use events from the <tt>loaderInfo</tt> instead of checking each frame, as well as using the frame label as the class name (which I believe is the idiom that Flex&#8217;s <tt>[Frame]</tt> metadata follows).</p></blockquote>
<p>I reread the <a href="http://troygilbert.com/2010/04/minimal-preloader-for-as3/">preloader post</a> I made earlier today and it occurred to me I should make this an actual re-usable class. So, I did. Here&#8217;s the Preloader base class:</p>
<p><script src="http://gist.github.com/354120.js?file=Preloader.as"></script></p>
<p>Usage is very straightforward. I made everything protected for easy sub-classing, but you shouldn&#8217;t have to override the event handlers, <tt>onProgress()</tt>, <tt>onComplete</tt> and <tt>onRemovePreloader()</tt>.</p>
<p>As I discussed in my earlier article on the subject, you have to include a compiler argument to force your main application class to be loaded on a secondary frame. You do this using the <tt>-frame</tt> compiler argument like so: <tt>-frame frameLabel fullyQualifiedClassName</tt>.</p>
<p>To customize the preloader animation, override <tt>addPreloader()</tt>, <tt>updatePreloader()</tt> and <tt>removePreloader()</tt>.</p>
<p>To create your main application class you can either pass the application class&#8217;s name into the constructor, e.g. <tt>super("com.mycompany.myapp.Application");</tt>, or you can use the class&#8217;s name as the frame label in the compiler argument, e.g. <tt>-frame com.mycompany.myapp.Application com.mycompany.myapp.Application</tt>. If you need to do something more specialized than just constructing your class and adding it to the stage, you can override <tt>createApplication()</tt>.</p>
<p>Here&#8217;s an example of a preloader that displays progress as a percent in the top-left corner of the screen:</p>
<p><script src="http://gist.github.com/354131.js?file=MyAppPreloader.as"></script></p>
<div class="tw_button" style="margin-bottom: 10px;"><a href="http://twitter.com/share?url=http%3A%2F%2Ftroygilbert.com%2F2010%2F04%2Fpreloader-base-class%2F&amp;via=troygilbert&amp;text=Preloader+Base+Class&amp;lang=en&amp;count=horizontal" style="" class="twitter-share-button">Tweet</a></div>
]]></content:encoded>
			<wfw:commentRss>http://troygilbert.com/2010/04/preloader-base-class/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Minimal Preloader for AS3</title>
		<link>http://troygilbert.com/2010/04/minimal-preloader-for-as3/</link>
		<comments>http://troygilbert.com/2010/04/minimal-preloader-for-as3/#comments</comments>
		<pubDate>Fri, 02 Apr 2010 22:00:15 +0000</pubDate>
		<dc:creator>Troy</dc:creator>
				<category><![CDATA[AS3 & Flash]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[as3]]></category>

		<guid isPermaLink="false">http://troygilbert.com/?p=250</guid>
		<description><![CDATA[Saw this post on preloaders today. I see a lot of similar examples. What I don&#8217;t like about any of them is the fact that they use the [Frame] metadata, which—as far as I can tell—requires you to use IFlexModuleFactory which means you have to bring in some minimal portion of the Flex SDK. That, [...]]]></description>
			<content:encoded><![CDATA[<p>Saw this <a href="http://weblog.mrinalwadhwa.com/2010/04/02/preloaders-in-as3/">post on preloaders</a> today. I see a lot of similar examples. What I don&#8217;t like about any of them is the fact that they use the <tt>[Frame]</tt> metadata, which—as far as I can tell—requires you to use <tt>IFlexModuleFactory</tt> which means you have to bring in some minimal portion of the Flex SDK. That, I don&#8217;t like.</p>
<p>I&#8217;m not sure why Adobe dictated this in <tt>mxmlc</tt>, there&#8217;s no reason that <tt>[Frame]</tt> would require this to be implemented correctly. Unfortunately, they did, so we have to resort to using a compiler argument to get the result we want.</p>
<p><tt>[Frame]</tt> metadata basically equates to the <tt>-frame</tt> compiler argument, but a little reversed. With <tt>[Frame]</tt> you specify which class should be placed in the frame previous to the class it decorates; with <tt>-frame</tt>, you specify which frame a class should appear on.</p>
<p>My standard preloader is named for the application&#8217;s SWF (so I don&#8217;t have to add any extra compiler arguments in Flex Builder), and once it finishes preloading it instantiates the actual application&#8217;s root class, which I normally name <tt>Application</tt>.</p>
<p>Because the application usually does some additional remote service calls and asset loading after the SWF completes, I don&#8217;t remove the preloader until it&#8217;s notified by the application that&#8217;s it&#8217;s ready. I use an event to do this so that there&#8217;s no hard-references either way.</p>
<p>This is an important point: whatever you reference in your preloader will be placed in the first frame of your SWF, so you have to be sure and not reference your application class (or really, any classes outside of the <tt>flash.*</tt> packages) statically. What you do is load them by name using <tt>getClassDefinition()</tt> once you&#8217;ve determined that the entire SWF has loaded.</p>
<p><script src="http://gist.github.com/353779.js?file=PreloaderDemo.as"></script></p>
<p><script src="http://gist.github.com/353779.js?file=Application.as"></script></p>
<div class="tw_button" style="margin-bottom: 10px;"><a href="http://twitter.com/share?url=http%3A%2F%2Ftroygilbert.com%2F2010%2F04%2Fminimal-preloader-for-as3%2F&amp;via=troygilbert&amp;text=Minimal+Preloader+for+AS3&amp;lang=en&amp;count=horizontal" style="" class="twitter-share-button">Tweet</a></div>
]]></content:encoded>
			<wfw:commentRss>http://troygilbert.com/2010/04/minimal-preloader-for-as3/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Club Treasure World</title>
		<link>http://troygilbert.com/2010/03/club-treasure-world/</link>
		<comments>http://troygilbert.com/2010/03/club-treasure-world/#comments</comments>
		<pubDate>Wed, 31 Mar 2010 17:14:59 +0000</pubDate>
		<dc:creator>Troy</dc:creator>
				<category><![CDATA[AS3 & Flash]]></category>
		<category><![CDATA[Game Dev]]></category>
		<category><![CDATA[Mockingbird]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web Dev]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[aspyr]]></category>
		<category><![CDATA[robotlegs]]></category>
		<category><![CDATA[smartfox]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://troygilbert.com/?p=246</guid>
		<description><![CDATA[Last week saw the launch of Club Treasure World, the latest project powered by Mockingbird. Built in collaboration with Aspyr over the last four months, it&#8217;s the biggest project yet using our game making tech. I suggest visiting CTW to get the full run-down of what&#8217;s offered, but a quick description: CTW is place for [...]]]></description>
			<content:encoded><![CDATA[<p>Last week saw the launch of <a href="http://www.clubtreasureworld.com/">Club Treasure World</a>, the latest project powered by <a href="http://mockingbirdgames.com/">Mockingbird</a>. Built in collaboration with <a href="http://www.aspyr.com/">Aspyr</a> over the last four months, it&#8217;s the biggest project yet using our game making tech.</p>
<p>I suggest visiting <a href="http://www.clubtreasureworld.com/">CTW</a> to get the full run-down of what&#8217;s offered, but a quick description: CTW is place for kids (and adults!) to build their own games and &#8220;chat worlds&#8221; to share with their friends. Everything is built from treasures that folks can purchase through micro-transactions or earn using the Nintendo DS game <a href="http://offworld.com/2009/07/the-war-drivers-delight-wifi-t.html">Treasure World</a> which Aspyr shipped last year.</p>
<p>CTW was the first project I used <a href="http://www.robotlegs.org/">Robotlegs</a> on. Even though we didn&#8217;t use it extensively—the other developer on the project was not familiar with dependency injection—it provided a nice solid architecture to jump off of. And due to its minimal nature, even when we weren&#8217;t leveraging it, it was never in the way.</p>
<p>While we were working on this project I also started several other smaller projects leveraging Robotlegs (none yet released) and have gradually refined my own workflow with it. I&#8217;m still a fan, though I&#8217;m quite curious about <a href="http://swizframework.org/">Swiz</a> because it appears to be even <em>more</em> minimal, if that can be believed. I am <strong>completely</strong> sold on the idea of dependency injection and have started applying it to my API designs.</p>
<p>My latest Robotlegs project is also my first project to leverage Rob Penner&#8217;s excellent <a href="http://github.com/robertpenner/as3-signals">AS3 Signals</a>. These two together have significantly cleaned up my code and are definitely quashing many of the architectural issues I ran into when developing the <a href="http://playmockingbird.com/designer">original Mockingbird app</a>. In fact, I&#8217;m itching to go back and rebuild the whole app and site—not to add features but to clean up the codebase in such a way that it&#8217;d be ready for some <em>rapid</em> feature addition in the future. Robotlegs definitely provides a very agile framework.</p>
<p>For CTW we also used <a href="http://www.smartfoxserver.com/">SmartFoxServer</a> for the first time. In the end, I was less enthused about this choice. While it got us up and running really fast with it&#8217;s simple API and built-in chat functionality, it was a pain to develop with and debug, and I wouldn&#8217;t choose to use it again. The API originates from AS1/AS2, so there&#8217;s very little type safety and none of the current AS3 conventions. The documentation leaves out a huge amount of caveats present in the API that don&#8217;t necessarily make sense, even though it&#8217;s clear from the support forums that developer after developer encounter the same issue. The next time around I plan on using a more robust option, like <a href="http://www.electro-server.com/">ElectroServer</a>, or possibly the still-in-alpha <a href="http://www.unionplatform.com/">Union Platform</a>.</p>
<div class="tw_button" style="margin-bottom: 10px;"><a href="http://twitter.com/share?url=http%3A%2F%2Ftroygilbert.com%2F2010%2F03%2Fclub-treasure-world%2F&amp;via=troygilbert&amp;text=Club+Treasure+World&amp;lang=en&amp;count=horizontal" style="" class="twitter-share-button">Tweet</a></div>
]]></content:encoded>
			<wfw:commentRss>http://troygilbert.com/2010/03/club-treasure-world/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
