<?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.unfocus.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>unFocus Projects</title>
	
	<link>http://www.unfocus.com</link>
	<description>A blog about unFocus Projects, and things of interest, including unFocus History Keeper.</description>
	<lastBuildDate>Thu, 31 May 2012 15:38:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.unfocus.com/unfocus/projects" /><feedburner:info uri="unfocus/projects" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId>unfocus/projects</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>Backstage2D – the GPU Augmented Flash Display List</title>
		<link>http://feeds.unfocus.com/~r/unfocus/projects/~3/SEreM7cyxx0/</link>
		<comments>http://www.unfocus.com/2012/05/04/backstage2d-the-gpu-augmented-flash-display-list/#comments</comments>
		<pubDate>Fri, 04 May 2012 21:42:14 +0000</pubDate>
		<dc:creator>Kevin Newman</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Backstage2D]]></category>
		<category><![CDATA[Dev Stuff]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Mobile App Development]]></category>

		<guid isPermaLink="false">http://www.unfocus.com/?p=4180</guid>
		<description><![CDATA[I&#8217;ve been playing with some 2D API ideas built on top of Flash&#8217;s Stage3D and Actionscript 3.0. I call it Backstage2D, the GPU augmented flash display list. Currently, Backstage2D&#8217;s code base is mostly a playground for proof of concept of &#8230; <a href="http://www.unfocus.com/2012/05/04/backstage2d-the-gpu-augmented-flash-display-list/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been playing with some 2D API ideas built on top of Flash&#8217;s Stage3D and Actionscript 3.0. I call it Backstage2D, the GPU augmented flash display list.</p>
<p>Currently, Backstage2D&#8217;s code base is mostly a playground for proof of concept of some API ideas. Some stuff in this post may not match the git repo (for example, I&#8217;m still using &#8220;layer&#8221; instead of &#8220;surface&#8221;). There&#8217;s a bunch left to do, but it is working enough to run a modified version of MoleHill_BunnMark that some folks from Adobe put together (I actually lifted most of my GPU code from that example code, heh). The BunnyMark example was adapted from <a href="http://blog.iainlobb.com/2010/11/display-list-vs-blitting-results.html">Iain Lobb&#8217;s BunnyMark</a>, with some additions from <a href="http://philippe.elsass.me/2011/11/nme-ready-for-the-show/">Phillipe Elsass</a>. You can view the <a href="http://www.unfocus.com/BunnyMark/Backstage2D.html">Backstage2D version of BunnyMark here</a> (and check out <a href="http://www.bytearray.org/?p=4074">the original BunnyMark MoleHill here</a>).</p>
<p><a href="https://github.com/unFocus/Backstage2D">Fork Backstage2D at GitHub</a>.</p>
<p>The rest of this post describes the thought process that went into Backstage2D.</p>
<p>The Flash AS3 display list API is not the best way to utilize the massively parallel capabilities of a GPU, and deal with the other limitations of a CPU/GPU architecture. The display list&#8217;s deeply nestable DisplayObject metaphor, and all the fun filters and blend modes just doesn&#8217;t translate well to very parallel, flat GPU hardware renderer. All of this is especially true on mobile like iPhones, iPads and Android devices, and that&#8217;s the primary target for Backstage2D.</p>
<p>With an API like the traditional flash display list, it&#8217;s easy to create situations that can&#8217;t easily be batched due to branching operations and other things which change the GPU state, and break parallel processing &#8211; slowing everything down. You see this in Adobe AIR&#8217;s GPU render mode, where seemingly random things can have a huge negative impact on performance. Behind the scenes AIR attempts to break the content into batches to speed things up. The use of certain features, or normal features in certain ways can drop you out of a batch. When performance degradation happens, it&#8217;s not always clear why. Because of that, to get great performance you must target just a subset of the normal features, and apply a lot of discipline to make sure everything keeps working smoothly.</p>
<p>I wanted do something different. I wanted to play with an API that is intentionally unlike the Flash display list &#8211; one designed to help the implementor (Flash developer or designer) understand how to arrange their content, so that it renders very quickly, even on mobile devices &#8211; and still get the benefits of all the glorious Flash stuff we are all used to.</p>
<p>Here are some of the primary principles I came up with, which impact the API:</p>
<ul>
<li>In order to take advantage of the parallel nature of GPUs, we need to batch many Quads (think, DisplayObject) into batches. The API should make batches easy to understand and use, so there&#8217;s no guessing about what&#8217;s going on.</li>
<li>GPUs like shallow content &#8211; they draw a lot triangles all at the same time. There is no nesting on the GPU, so while some form of organization is necessary, the infinite nesting model must be reigned in.</li>
<li>Backstage2D shouldn&#8217;t do too much in an automagic kind of way. Guessing about the impact of nesting things a certain way, or using a blend mode, or the performance impact of using certain features translates into extra effort and cost during production because of the unpredictable negative impact features can have on performance. Features should work as you expect them to, and the performance impacts of doing certain things should be clear.</li>
<li>Think of the GPU as a remote server that you send instructions to. Uploading things like Textures to the GPU from system memory is slow (especially on mobile). Backstage2D should make these stress points clear.</li>
<li>Flash&#8217;s vector engine is tops, and working with Bitmaps (and sprite sheets) sucks! The API should enable the continued use of the display list, in GPU friendly ways. Drawing vector art on the GPU is hard, and is ugly anyway. So leverage the CPU rasterizer, and make sure the API makes the GPU upload bandwidth and render time overhead clear.</li>
<li>Backstage2D objects shouldn&#8217;t look like traditional display list objects &#8211; we&#8217;ll use names other than Sprite, MovieClip, DisplayObject, etc.</li>
</ul>
<p>Of these, batching is the starting point, since it is the most necessary for advanced performance, and effects how data must be organized the most. You can draw each Quad (think Flash DisplayObject, or Sprite) individually by setting up the vertex, program, texture, etc. data for each quad, and calling drawTriangle for each and every Sprite. But the GPU can&#8217;t optimize to run in parallel if you do that &#8211; most of its processing cores end up underutilized in that model.</p>
<p>Batching let&#8217;s more than one quad be draw simultaneously, but there are limitations &#8211; Every item in a batch must use the same vector data (a giant array of x,y,other data), single texture and other state information, like blend modes. Additionally, the entire batch must be drawn without interruption, which means you can&#8217;t insert items from other batches (with other state settings like a different blend mode) in the middle of the batch.</p>
<p>So batches resemble layers, or surfaces. The model for Backstage2D will be a series of stacked surfaces, instead of a deeply nested tree structure starting at the root.</p>
<p>In this paradigm, the surface gets batched, and the children it contains get rendered in parallel &#8211; perfect for GPUs. To eliminate batch breaking APIs, certain &#8220;state changing&#8221; operations can be applied to only an entire layer, not to each element &#8211; operations like blend mode settings &#8211; or adding and removing elements from a surface. The limitations of surface API should help the implementor understand the impact of doing certain things. If you need to have 100 elements, and every other element has a blend mode of Multiply, while the one below it has a blend mode of Normal &#8211; in the traditional Flash API, this is fine, and can actually run pretty well. On the GPU, all 100 elements must be rendered individually in 100 distinct surfaces. Having that many surfaces feels heavy because it is heavy.</p>
<p>Texture changes are one of the things that break batching &#8211; a Shader can deal with only one texture (well, actually up to 8 &#8211; but that makes the pixel shader more expensive to run), so a set of elements in a batch must be combined into a sprite sheet or texture atlas. If you&#8217;ve tried to use a texture atlas in another 2D rendering engine, you may have noticed these are a pain to deal with &#8211; and usually it requires setting them up manually before compilation. This is one thing that Backstage2D handles for you &#8211; at runtime &#8211; in an automagic kind of way.</p>
<p>This feature was actually done for a bunch of reasons. I&#8217;d like to add is a resolution (screen DPI) independent measurement mode, where assets get generated on each device an app runs on, from high quality vector art, for exactly the necessary DPI the system is running at, and scaled to real life sizes. Type specified at 12-point, should truly measure at 12-point.</p>
<p>Additionally, Flash vector art looks great (especially with the new 16X16 quality modes), but they look their best when rendered to match the screen exactly. Resizing prerendered vector art can ruin the beautiful anti-aliasing in vector art. Proper sizing can also help performance with older hardware like an iPhone 3GS, which is actually pretty capable, but doesn&#8217;t cope well with iPhone 4 retina screen sized material (4x more pixels than will be displayed).</p>
<p>Setting all this up is expensive &#8211; especially generating the sprite sheet. But just setting up vector data and loading even predigested textures is already expensive enough that you wouldn&#8217;t want to do those tasks while your app is running some smooth animation &#8211; it will cause missed frames, and your users will notice. So Backstage2d&#8217;s API should guid the user to avoid doing expensive things while an app or animation is running. It exposes a build, load, and/or upload commands per layer. That way, the implementer always knows that what they are doing is computationally expensive (down the road, the plan would be to move much of that into concurrency &#8211; more on that another time).</p>
<p>The characteristics of this are very different from normal Flash, which is to load only the minimum of whats needed, when it&#8217;s needed, and try to keep as much as you can off the display list. In the Backstage2D model (in the standard surface type anyway), an entire surface, and all it&#8217;s children (called &#8220;Actors&#8221; to avoid colliding with AS3&#8242;s &#8220;Sprite&#8221;, etc.) gets rendered up front to a big TextureAtlas, and stored in memory or on disk. How to optimize and organize your assets to avoid running out of memory becomes an entirely different matter from the way to optimize for the CPU. A surface will have an associated sprite sheet bitmapData asset though, which can be measured.</p>
<p>With these restrictions in mind, the idea would be to create a variety of surface types to suit differing kinds of content. For classic content, a standard static Quads surface (done!), still frame animations (sprite sheet animations &#8211; generated at runtime), tweened animations (inverse kinematics &#8211; the bone tool), and streaming animations (dynamic MovieClips, large MovieClips, or video) &#8211; maybe even some surfaces useful for standard UI, like scroll panes. For more advanced 2D assets, a variety of different mesh layer types could be added (that&#8217;s where GPU stage3D programming gets fun!).</p>
<p>I&#8217;d love to flesh this out with more features, including an animation subsystem that would include a couple of different Animation display types. Alas, free time is short, and I&#8217;ll probably never get to it. But I already spent a lot of time on this (I broke my foot, and was couch bound for a while) so thought I&#8217;d share where I got to. <img src='http://www.unfocus.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<div class="feedflare">
<a href="http://feeds.unfocus.com/~ff/unfocus/projects?a=SEreM7cyxx0:KzLQVT5rc3c:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/unfocus/projects?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.unfocus.com/~ff/unfocus/projects?a=SEreM7cyxx0:KzLQVT5rc3c:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/unfocus/projects?i=SEreM7cyxx0:KzLQVT5rc3c:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.unfocus.com/~ff/unfocus/projects?a=SEreM7cyxx0:KzLQVT5rc3c:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/unfocus/projects?i=SEreM7cyxx0:KzLQVT5rc3c:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.unfocus.com/~ff/unfocus/projects?a=SEreM7cyxx0:KzLQVT5rc3c:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/unfocus/projects?i=SEreM7cyxx0:KzLQVT5rc3c:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/unfocus/projects/~4/SEreM7cyxx0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.unfocus.com/2012/05/04/backstage2d-the-gpu-augmented-flash-display-list/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.unfocus.com/2012/05/04/backstage2d-the-gpu-augmented-flash-display-list/</feedburner:origLink></item>
		<item>
		<title>Scripts n Styles Update 3.1</title>
		<link>http://feeds.unfocus.com/~r/unfocus/projects/~3/AEC6IhBGGEY/</link>
		<comments>http://www.unfocus.com/2012/05/03/scripts-n-styles-update-3-1/#comments</comments>
		<pubDate>Thu, 03 May 2012 19:11:16 +0000</pubDate>
		<dc:creator>Kenneth Newman</dc:creator>
				<category><![CDATA[Scripts n Styles]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Wordpress Plugins]]></category>

		<guid isPermaLink="false">http://www.unfocus.com/?p=4191</guid>
		<description><![CDATA[Scripts n Styles received a major update today. The two big features added are LESS.js support and Dynamic Shortcodes! The &#8220;Global&#8221; Settings page now has a LESS editor with syntax highlighting (via CodeMirror) and on-the-fly compiling so you can see &#8230; <a href="http://www.unfocus.com/2012/05/03/scripts-n-styles-update-3-1/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://wordpress.org/extend/plugins/scripts-n-styles/">Scripts n Styles</a> received a major update today. The two big features added are <a href="http://lesscss.org/">LESS.js</a> support and Dynamic Shortcodes! The &#8220;Global&#8221; Settings page now has a LESS editor with syntax highlighting (via <a href="http://codemirror.net/">CodeMirror</a>) and on-the-fly compiling so you can see how it&#8217;ll be outputted on the theme-side. The per-page meta-box has gained a new tab in which you can create one-off shortcodes which can contain arbitrary HTML content.</p>
<p>Scripts n Styles is a free OpenSource GPL project that you can <a href="https://github.com/unFocus/Scripts-n-Styles">fork and contribute to</a> on github! (You can also fork and contribute to <a href="https://github.com/marijnh/CodeMirror2">CodeMirror</a> and <a href="https://github.com/cloudhead/less.js">LESS.js</a>)</p>
<p><strong>As a Shortcode example:</strong> I placed the following html into the Shortcodes tab and gave it the name &#8220;tweet test&#8221;.</p>
<pre class="brush: xml; title: ; notranslate">
&lt;a href=&quot;https://twitter.com/share&quot; data-via=&quot;WraithKenny&quot; data-size=&quot;large&quot; data-related=&quot;unFocusProjects&quot; data-hashtags=&quot;ScriptsnStyles&quot;&gt;Tweet&lt;/a&gt;
&lt;script&gt;!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=&quot;//platform.twitter.com/widgets.js&quot;;fjs.parentNode.insertBefore(js,fjs);}}(document,&quot;script&quot;,&quot;twitter-wjs&quot;);&lt;/script&gt;
</pre>
<p>I then use the shortcode [sns_shortcode name="tweet test"] to display: <a href="https://twitter.com/share" class="twitter-share-button" data-via="WraithKenny" data-size="large" data-related="unFocusProjects" data-hashtags="ScriptsnStyles">Tweet</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script></p>
<div class="feedflare">
<a href="http://feeds.unfocus.com/~ff/unfocus/projects?a=AEC6IhBGGEY:jrcO4VOhHFg:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/unfocus/projects?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.unfocus.com/~ff/unfocus/projects?a=AEC6IhBGGEY:jrcO4VOhHFg:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/unfocus/projects?i=AEC6IhBGGEY:jrcO4VOhHFg:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.unfocus.com/~ff/unfocus/projects?a=AEC6IhBGGEY:jrcO4VOhHFg:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/unfocus/projects?i=AEC6IhBGGEY:jrcO4VOhHFg:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.unfocus.com/~ff/unfocus/projects?a=AEC6IhBGGEY:jrcO4VOhHFg:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/unfocus/projects?i=AEC6IhBGGEY:jrcO4VOhHFg:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/unfocus/projects/~4/AEC6IhBGGEY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.unfocus.com/2012/05/03/scripts-n-styles-update-3-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.unfocus.com/2012/05/03/scripts-n-styles-update-3-1/</feedburner:origLink></item>
		<item>
		<title>Fast AS3 Signals with SignalsLite</title>
		<link>http://feeds.unfocus.com/~r/unfocus/projects/~3/ynefQ30aqkc/</link>
		<comments>http://www.unfocus.com/2011/12/05/fast-as3-signals-with-signalslite/#comments</comments>
		<pubDate>Tue, 06 Dec 2011 01:18:15 +0000</pubDate>
		<dc:creator>Kevin Newman</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[SignalsLite]]></category>
		<category><![CDATA[Actionscript 3.0]]></category>
		<category><![CDATA[AIR]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[Signals]]></category>

		<guid isPermaLink="false">http://www.unfocus.com/?p=4116</guid>
		<description><![CDATA[I was playing around and ended up writing a lite Signals class (ok, 3 classes). The set works like a basic AS3 Signal, minus most of the extra functionality of AS3 Signals (run-time dispatching argument type checking as one example). &#8230; <a href="http://www.unfocus.com/2011/12/05/fast-as3-signals-with-signalslite/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I was playing around and ended up writing a lite Signals class (ok, 3 classes). The set works like a basic AS3 Signal, minus most of the extra functionality of AS3 Signals (run-time dispatching argument type checking as one example). The goal was to create a very fast Signal dispatcher, with very little overhead, and to dispatch with absolutely no heap allocation (check, check and check) &#8211; targeted mostly for mobile (AIR). Regular AS3 Signals does well, but it seemed to have a lot of extra stuff that I don&#8217;t need &#8211; and this was a fun kind of exercise anyway.</p>
<p>Some quick numbers from the <a href="https://github.com/CaptainN/SignalsLite/blob/master/performance-test/CallbacksTest.as">performance-test</a> with 1,000,000 iterations on a Core 2 Duo 2.6GHz (in milliseconds):</p>
<p>Func call time: 15<br />
Runnable call time: 5<br />
Event (1 listener) time: 863<br />
Signal (1 listener) time: 260<br />
<strong>SignalLite (1 listener) time: 232</strong><br />
RunnableSignal (1 listener) time: 56</p>
<p>Func call (10 listeners) time: 190<br />
Runnable call (10 listeners) time: 399<br />
Event (10 listeners) time: 2757<br />
Signal (10 listeners) time: 741<br />
<strong>SignalLite (10 listeners) time: 725</strong><br />
RunnableSignal (10 listeners) time: 221</p>
<p>The bold line is a vanilla SignalLite, and the line above Robert Penner&#8217;s AS3 Signals. They are pretty close, but SignalsLite takes a modest edge. But let&#8217;s look at the same test on iOS (iPhone 4S) with 100,000 iterations:</p>
<p>Func call time: 171<br />
Runnable call time: 26<br />
Event (1 listener) time: 3723<br />
Signal (1 listener) time: 789<br />
<strong>SignalLite (1 listener) time: 481</strong><br />
RunnableSignal (1 listener) time: 117</p>
<p>Func call (10 listeners) time: 2004<br />
Runnable call (10 listeners) time: 1892<br />
Event (10 listeners) time: 9217<br />
Signal (10 listeners) time: 4030<br />
<strong>SignalLite (10 listeners) time: 2074</strong><br />
RunnableSignal (10 listeners) time: 498</p>
<p>On iPhone you can see that SignalLite is almost twice as fast as AS3 Signals &#8211; a more substantial difference than on desktop. I&#8217;m not sure why that is, maybe the AOT compiler can optimize something about SignalLite better &#8211; IDK, but it sure is fast!</p>
<p>Then there&#8217;s that last line in each group &#8211; RunnableSignal. Now your talking speed. That one also solves a particular problem with function callback systems that they all seem to have &#8211; there is no compile time function signature checking. You have to wait until the thing runs, and then find out you are taking the wrong number of arguments, or the wrong type, etc. But, solving one problem (compile time type checking), solves the other (speed), and that brings us to SignalTyped which RunnableSignal in the test above extends (I&#8217;ll probably rename at some point).</p>
<p>SignalTyped is beginnings of a fast executing type safe implementation of AS3 Signals. The idea is, you extend 2 classes &#8211; SignalTyped and SlotLite. SignalTyped is effectively an abstract class &#8211; you must extend it and implement the dispatch method, and the constructor (at least for now, I&#8217;m looking for better ways to handle this). It takes a bit of boilerplate to implement this in a class that would expose signals. This example is based on the performance test from <a href="http://jacksondunstan.com/articles/573">Jackson Dunstan&#8217;s CallbackTest</a> which I borrowed (I hope that&#8217;s ok!):</p>
<pre class="brush: as3; title: ; notranslate">
// Interface for your class that might have listeners for the SignalTyped.
// Make one of these per listener type.
interface IRunnable {
	function run(): void;
} 

// Custom Slot has a specific property for the Runnable class.
class RunnableSlot extends SlotLite
{
	public function RunnableSlot( runnable:IRunnable ) {
		this.runnable = runnable;
	}
	public var runnable:IRunnable = new EmptyRunnable;
}

// An empty IRunnable class for first node.
class EmptyRunnable implements IRunnable {
	public function run():void {};
}

// You need one of these per dispatch type.
class RunnableSignal extends SignalTyped
{
	// last and first must be set to the typed Slot.
	public function RunnableSignal() {
		last = first = new RunnableSlot;
	} 

	// implement the dispatch method to call the runnable prop directly
	// It's easy to have it take and dispatch any type you want - with compile time type checking!
	public function dispatchRunnable():void
	{
		var node:RunnableSlot = first as RunnableSlot;
		while ( node = (node.next as RunnableSlot) ) {
			node.runnable.run(); // FAST!
		}
	}
}
</pre>
<p>That&#8217;s all necessary for the implementation requirements &#8211; a lot of boilerplate, I admit. Then you expose that in a class that might use it all:</p>
<pre class="brush: as3; title: ; notranslate">
class MyDisplayObject
{
	// could probably make this a getter..
	public var signaled:RunnableSignal = new RunnableSignal;
}
</pre>
<p>Now for the consumer to use this, it&#8217;s just a bit more boilerplate than a normal signal:</p>
<pre class="brush: as3; title: ; notranslate">
class MyConsumerOfSignalLite implements Runnable // boilerplate point 1
{
	public function MyConsumerOfSignalLite()
	{
		var dspObj:MyDisplayObject = new MyDisplayObject();
		// add the signal (boilerplate point 2 - normal)
		dspObj.signaled.addSlot( this );
	} 

	// boilerplate 3 - normal, but more strict - naming is specific - FAST!
	public function run(): void {
		// do whatever when signals
	}
}
// boilerplates 2 and 3 are normal for any signal, except the strictness of #3
</pre>
<p>What&#8217;s cool about this is you get compile time type checking for your method signature, and the performance improvement that comes with skipping those checks at runtime.</p>
<p>I&#8217;m also thinking about a slightly different signal API  that would be more like the Robot Legs&#8217; contract system &#8211; think signals by contract &#8211; I&#8217;m working on it. Since we would be implementing a defined interface per signal type, we could boil the add methods and signal nodes down to one method to add all the listeners of a single object &#8211; one add method per dispatching class, instead of one per signal on the dispatching class. This could lead to a reduction in boilerplate. We&#8217;d filter by interface type instead of using multiple signal.add nodes and methods. So &#8211; improved runtime performance, reduction in (usage) boilerplate (if not implementation) and compile time type checking. I love it!</p>
<p><strong>Note</strong> &#8211; I tested none of the example in this post, and the code in github is all very early stage stuff. The performance-test class works though &#8211; give it a try!</p>
<p>Oh, here&#8217;s the github repo:<br />
<a href="https://github.com/CaptainN/SignalsLite">https://github.com/CaptainN/SignalsLite</a></p>
<div class="feedflare">
<a href="http://feeds.unfocus.com/~ff/unfocus/projects?a=ynefQ30aqkc:InBi18GR63I:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/unfocus/projects?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.unfocus.com/~ff/unfocus/projects?a=ynefQ30aqkc:InBi18GR63I:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/unfocus/projects?i=ynefQ30aqkc:InBi18GR63I:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.unfocus.com/~ff/unfocus/projects?a=ynefQ30aqkc:InBi18GR63I:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/unfocus/projects?i=ynefQ30aqkc:InBi18GR63I:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.unfocus.com/~ff/unfocus/projects?a=ynefQ30aqkc:InBi18GR63I:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/unfocus/projects?i=ynefQ30aqkc:InBi18GR63I:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/unfocus/projects/~4/ynefQ30aqkc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.unfocus.com/2011/12/05/fast-as3-signals-with-signalslite/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		<feedburner:origLink>http://www.unfocus.com/2011/12/05/fast-as3-signals-with-signalslite/</feedburner:origLink></item>
		<item>
		<title>Adobe’s Flash/AIR Messaging Nightmare</title>
		<link>http://feeds.unfocus.com/~r/unfocus/projects/~3/1xIjNSUaA6k/</link>
		<comments>http://www.unfocus.com/2011/11/10/adobes-flashair-messaging-nightmare/#comments</comments>
		<pubDate>Thu, 10 Nov 2011 22:45:13 +0000</pubDate>
		<dc:creator>Kevin Newman</dc:creator>
				<category><![CDATA[Adobe]]></category>
		<category><![CDATA[Commentary]]></category>
		<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://www.unfocus.com/?p=718</guid>
		<description><![CDATA[Update: Mike Chambers posted an explanation and clarification on where Adobe is headed with Flash and AIR. Update 2: TechCrunch picks up (part of) the narrative. I published an old post with my thoughts on the &#8220;Flash is Dead&#8221; thing &#8230; <a href="http://www.unfocus.com/2011/11/10/adobes-flashair-messaging-nightmare/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><strong>Update:</strong> Mike Chambers posted an explanation and clarification on <a href="http://www.mikechambers.com/blog/2011/11/11/clarifications-on-flash-player-for-mobile-browsers-the-flash-platform-and-the-future-of-flash/">where Adobe is headed with Flash and AIR</a>. <strong>Update 2:</strong> <a href="http://techcrunch.com/2011/11/11/why-mobile-flash-died-an-adobe-employee-speaks-out/">TechCrunch picks up (part of) the narrative.</a></p>
<p>I published an old post with my thoughts on the &#8220;Flash is Dead&#8221; thing that pops up routinely in media circles after anything happens to shake things up (like an Apple ban on Flash, or Adobe dropping a supported platform, etc.) yesterday. I optimistically highlighted in that piece the promise that AIR technology represents &#8211; it’s even in the title &#8220;<a title="http://www.unfocus.com/2011/11/09/flash-and-air-nothing-but-opportunity/" href="../2011/11/09/flash-and-air-nothing-but-opportunity/">Flash and AIR, Nothing But Opportunity</a>&#8220;. I really believe the technology represents, and could fulfill all the promise those of us down in the weeds perceive. I also believe that Adobe’s Flash Platform engineers and evangelists also see that promise, and would like to see it fulfilled.</p>
<p>Yesterday Adobe unceremoniously dropped support for an entire class of platforms. No more Flash Player in mobile browsers. It’s not a terrible technical decision &#8211; working in AIR and native app land offers a ton more flexibility. It even makes business sense. Browser makers are increasingly hostile to Flash &#8211; Apple has never let it in the door on iOS (and never will), and Microsoft announced plans to kill off plugins even on the desktop in Windows 8 Metro interface. Browsers have become hostile territory for Flash, so it makes sense to move emphasis in the two directions the industry is headed &#8211; app store apps with AIR (which no one knows about) and HTML5 for browsers. In an important way, this does mean Flash is dead &#8211; it’s not going to be in the browser going forward. It really is out of Adobe’s control.</p>
<p>But there’s a problem. The longer Adobe’s bumbles the messaging, the harder it is to say for sure whether there is a lack of commitment to their platform (including AIR), or if it is truly just a PR problem. This kind of announcement had an easy to predict effect on Flash’s brand, yet there was no attempt to get out in front of that narrative that would show they are committed to the larger &#8220;Flash Platform&#8221; of which AIR is an important part going forward. In the non-technical parts of the industry &#8211; the media, managers, and creative side of production teams &#8211; they all heard Adobe Flash is out of mobile &#8211; use HTML5. It’s even worse in client land, where the term &#8220;HTML5 app&#8221; is used regularly along with &#8220;app store&#8221; &#8211; this news was so harmful to them, that clients with existing Flash content, which can be ported to the app space easily with AIR, are really freaking out. I can tell them about AIR all I want, but it’s hard for me to counteract all the media buzz (repetition is reality &#8211; brain science).</p>
<p>But what if they got the right message. This kind of move could represent a real intent on the part of Adobe’s leadership to get out of the Flash Platform altogether, and maybe out of the platform space entirely, and focus instead only on tooling to produce for the platform commons that HTML5 represents. Look at the kinds of decisions they’ve made recently. Adobe has essentially dropped internal support for their &#8220;Flash Platform&#8221; on every system platform they can, by either straight up dumping it (Linux, mobile flash, TV), or by farming out porting and support to partners like RIM.</p>
<p>On the other hand, Adobe and Flash evangelists and engineers seem committed to the &#8220;Flash Platform&#8221; which in an un-articulated narrative (narrative &#8211; it’s how we think &#8211; more brain science), really means AIR in app stores (mobile and desktop), but I’m not sure I’m getting the same message from the real decision makers at Adobe. I don’t know if it’s intent, or just plain old bad PR judgement, but it feels like I’m standing on the greasy platform, and it’s getting pretty tough to hold my balance. Some folks are already sliding off.</p>
<p>I think they are in it for the long haul, and they&#8217;ve even built some of their own apps on the little known Flash based mobile app technology that is AIR. But guessing someone’s intent is problematic &#8211; that only makes the PR problem clearer. I shouldn’t have to guess.</p>
<p>It boils down to this. I know technology, and I know the Flash Platform. I know it has merit and potential. But if people can’t tell if the decision makers at Adobe are serious about supporting it into the future, it&#8217;s going to be a tough haul to convince anyone to build anything on that platform. I already know a few platforms, including HTML, learning a new one isn’t scary, but I really prefer Flash and AIR because of it’s potential and even it’s legacy, which has value (despite the tar Steve Jobs dumped on it). If Adobe can’t or won’t make it clear that they are committed to AIR and the Flash Platform, I’ll have to find an alternative &#8211; and the decision won’t be mine. At this point, we need a clear unambiguous statement of intent from Adobe &#8211; are you committed to the Flash Platform and AIR, or not? A public roadmap wouldn’t hurt either.</p>
<div class="feedflare">
<a href="http://feeds.unfocus.com/~ff/unfocus/projects?a=1xIjNSUaA6k:MrS_kb9tg7s:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/unfocus/projects?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.unfocus.com/~ff/unfocus/projects?a=1xIjNSUaA6k:MrS_kb9tg7s:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/unfocus/projects?i=1xIjNSUaA6k:MrS_kb9tg7s:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.unfocus.com/~ff/unfocus/projects?a=1xIjNSUaA6k:MrS_kb9tg7s:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/unfocus/projects?i=1xIjNSUaA6k:MrS_kb9tg7s:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.unfocus.com/~ff/unfocus/projects?a=1xIjNSUaA6k:MrS_kb9tg7s:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/unfocus/projects?i=1xIjNSUaA6k:MrS_kb9tg7s:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/unfocus/projects/~4/1xIjNSUaA6k" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.unfocus.com/2011/11/10/adobes-flashair-messaging-nightmare/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		<feedburner:origLink>http://www.unfocus.com/2011/11/10/adobes-flashair-messaging-nightmare/</feedburner:origLink></item>
		<item>
		<title>Flash and AIR, Nothing But Opportunity</title>
		<link>http://feeds.unfocus.com/~r/unfocus/projects/~3/qE_M1jw7QaA/</link>
		<comments>http://www.unfocus.com/2011/11/09/flash-and-air-nothing-but-opportunity/#comments</comments>
		<pubDate>Thu, 10 Nov 2011 03:39:27 +0000</pubDate>
		<dc:creator>Kevin Newman</dc:creator>
				<category><![CDATA[Adobe]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[Commentary]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Mobile App Development]]></category>
		<category><![CDATA[AIR]]></category>
		<category><![CDATA[iOS]]></category>

		<guid isPermaLink="false">http://www.unfocus.com/?p=680</guid>
		<description><![CDATA[Preface: I wrote this one of the last few times the Flash is dead thing made the media rounds, because it seems as though many participants in the discussion are simply missing the bigger picture, that the market for rich &#8230; <a href="http://www.unfocus.com/2011/11/09/flash-and-air-nothing-but-opportunity/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><strong>Preface:</strong> I wrote this one of the last few times the Flash is dead thing made the media rounds, because it seems as though many participants in the discussion are simply missing the bigger picture, that the market for rich interactive work is splitting between app store apps (native applications), and desktop browser-based apps (websites), and that those divisions are deep enough to require different development mindsets. The post is overly long &#8211; I don&#8217;t have an editor &#8211; but I figured I&#8217;d post it in its current draft state, since this keeps coming up, and so I don&#8217;t have to noodle with it anymore. <img src='http://www.unfocus.com/wp-includes/images/smilies/icon_razz.gif' alt=':-P' class='wp-smiley' />  So here it is. (<strong>Instant update:</strong> Lee Brimelow has said similar things in fewer words on his <a href="http://www.leebrimelow.com/?p=3151">blog</a> <strong>Update 2:</strong> Thibault Imbert <a href="http://www.bytearray.org/?p=3744">chimes in</a>. <strong>Update 3:</strong> <a href="http://www.mikechambers.com/blog/2011/11/11/clarifications-on-flash-player-for-mobile-browsers-the-flash-platform-and-the-future-of-flash/">Mike Chambers rolls the narrative</a>. Now back to making awesome!).</p>
<p>In the technology business, if you aren&#8217;t looking ahead, you are being left behind. There is fundamental shift occurring in the content technology space, where Flash and HTML live their happy lives. This shift has mostly been explained using old terms, like &#8220;apps&#8221; and &#8220;HTML5 vs. Flash&#8221; &#8211; these explanations miss the point. They all describe how things were yesterday and are today, but miss how they will be tomorrow. The browser has been and is today, the primary means of application and content delivery. A new set of opportunities for delivering content are changing all that. The Split puts the traditional desktop browser market on one side, and app stores on new platforms, with new hardware, and new interface paradigms on the other.</p>
<p>App stores should be more broadly called content stores, because the line between apps and other kinds of content is pretty thin. Market specific content stores have been around for a while already on the desktop. Game shops like Steam and Direct2Drive already make up the lion&#8217;s share of the PC games market, and iTunes was already a form of an app store, before apps where apps.</p>
<p>The companies behind every platform are adopting apps stores, including all major operating systems on traditional PCs, including OSX, and soon Windows. Open source trail blazers like Ubuntu have actually had something like app stores for a long while now. Additionally, more and more types of content are being pulled into them, from apps, to music and movies, to Magazines and local newspapers. The models for monetization are so much clearer, and the tools to take advantage of the various models are already built, and for the consumer, very convenient. App stores are the new reality.</p>
<p>To really understand why this is happening, and what it means for those of us who make a living in the weeds, we need to understand where we are, and how we got here.</p>
<p><strong>The PC Era</strong></p>
<p>In the early days of personal computing, &#8220;applications&#8221; (or &#8220;programs&#8221;) were the hot action. You needed something to do with your new beige personal computer (PC), so you bought (or borrowed) software or other types of content on diskettes, and later CD-ROM (oh the magic) and installed that software to run on your PC or Mac. It was an offline process, but it was the only realistic way to go. Even if you had access to the internet, you weren&#8217;t going to download megabytes of data over your cutting edge 14.4KB fax/modem connection. Traditional forms of acquisition ruled in those days. You had to take yourself to the store, and buy a box or a publication or whatever else, to obtain content &#8211; probably paying with cash.</p>
<p>When the internet hit mainstream in the 90s, and data speeds increased, the transition from &#8220;applications&#8221; delivered through boxed diskettes, to continuously updated &#8220;websites&#8221; began. The internet had some advantages over boxed content. The biggest was that accessing a web site through the internet was exceedingly convenient for consumers. Far more convenient than traveling to the store and buying a box with a CD of clip art on it. For content producers there is also a sense of limitless shelf space compared with traditional retail outlets, so they were quick to try to carve out advantage there. Search engines and content indexing services like Google and Yahoo! made a killing on both ends by providing a way for content producers to get their content in front of users.</p>
<p>Broadband completed the transition. At the dawn of the new millennium and &#8220;the internet,&#8221; became the primary means of content and application delivery (aside from a few important smaller markets like games and productivity apps). The browser was the primary means of application and content delivery, and for good reason. The content is easy to access from multiple platforms, and is super convenient. All you need is an internet connection, and a browser.</p>
<p><strong>A Flash of brilliance</strong></p>
<p>At around the same time, Microsoft mostly won &#8220;the browser wars&#8221; with Internet Explorer 6, and basically stopped forward movement in their browser, and for many years, the internet &#8211; the commerce in the browser era&#8217;s &#8220;website&#8221; based economy was able to mature. The stagnant development of the dominant browser platform created a challenging environment, one in which it&#8217;s easy to see why Flash was able to thrive.</p>
<p>Flash brought many improvements over the browser, through constant performance and scriptability advancements, as well as significant additional features the browsers in the aggregate simply couldn&#8217;t match &#8211; video being an important notable feature. Additionally, Flash provided consistency across browsers and operating systems, and comparably great performance, when measured against HTML and JavaScript. A browser-based app simply couldn&#8217;t (still can&#8217;t) match it. Flash in the browser became the go to platform for serious interactive work on the internet. You just couldn&#8217;t get similar levels of awesome out of IE6 and the rest of the browsers of the time.</p>
<p><strong>All good things</strong></p>
<p>The split started to happen in 2006. On the PC, which really means in the PC browser, Adobe was getting more serious about the application space in the browser by releasing the first version of Flash with AVM2 (and s 3.0), a much more stable foundation than Actionscript 2.0 had been, along with an update to its application framework, Flex that took advantage of the improvements to Actionscript 3.0. This helped move trends in Flash&#8217;s direction, as seemingly every great site was build using the plugin technology. IE7 had come out that same year, but it only added to developers&#8217; pain in the short-term, and it still wasn&#8217;t the robust interoperable platform that browser ecosystem needed to compete in the applications space. So in that space, movement continued toward Flash.</p>
<p>This could be considered the golden age for Flash. Flash ruled the content space during that time, in everything from banner ads, to browser-based games, to anything dealing with charts, and data (so-called RIAs), to just about all the video delivery on the internet.</p>
<p>Browsers didn&#8217;t come without problems. They have been slow to innovate, incompatible with one another &#8211; universally slow, buggy and crashy &#8211; and often full of horrible security holes (especially IE &#8211; the dominant player). They were mired in standards battles, forks, company and social politics (open source/EU fines) &#8211; but mostly, the leader &#8211; Microsoft with IE6, just held everything up. On top of all that, it was difficult for content producers, like traditional newspapers, to find revenue sources other than ad systems. The market was set for change.</p>
<p>That&#8217;s about when Apple fired the first warning shots across the bows of the PC browser fleet, by releasing the first iPhone, which could browse the internet, but didn&#8217;t run Flash. A brand new platform &#8211; software and hardware, with a brand new interface paradigm &#8211; touch, instead of mouse and keyboard. This would be a platform built from the lessons of the browser era, and it provided a wide open space for Apple to do what it does best. They rapidly iterated on their ecosystem, and came up with the overwhelmingly successful App Store, a system that seemingly everyone wanted in to. This was a system that came with multiple obvious revenue systems built right in &#8211; app sales, technology cross-licensing, advertising, etc. &#8211; all things that could be done in the browser space, but the app store made exceedingly convenient, to both producers and consumers. Apple catered to that demand masterfully, and over time expanded opportunities to include, in-app purchases, magazine publishing platforms, and subscriptions services, among others.</p>
<p>In the same way the internet &#8211; the modern PC era &#8211; had provided enough advantages over the previous content delivery systems to overshadow any of its shortcomings, the App Store model would provide enough promise to overshadow its possible shortcomings measured against its predecessor. App stores proved so compelling, and so big a threat to the existing browser-based models, it almost immediately ended a cozy relationship between Apple and Google, who ruled the browser era, as the gatekeeper to content, and the owner of essentially all advertising on the web. Google moved quickly to duplicate the app system  for Android, and the other platform makers &#8211; WebOS, and Microsoft Windows Phone 7 Series &#8211; have been playing catch-up ever since. Eventually, Apple brought the app store system to the desktop in OSX Lion, and even Microsoft is picking it up in their Windows 8 Metro interface for full app store coverage in the traditional PC markets.</p>
<p>The rapidly evolving iPhone (later iOS) platform created new ways to think about a lot things. The most important new things were app and content delivery, and revenue sources through new monetization strategies. The Apple App Store changed everything.</p>
<p><strong>The end of an era</strong></p>
<p>When Apple released the iPad in April, 2010, Steve Jobs announced the &#8220;end of the PC era.&#8221; With the release of the iPad Apple did nothing less than complete and publish the rule book rewrite they began with the iPhone. More than anyone else, the folks at Apple seemed to understand that there is a divide between the &#8220;PC era&#8221; &#8211; which is really the &#8220;PC browser era&#8221; &#8211; and the new app store era. They understood that these two are on two different trajectories, and the app store era will supersede the browser. From now on, for better or for worse, applications would exist in App Stores, and websites would just be websites.</p>
<p>In the same month Apple announced the iPad, Steve Jobs followed up with a special letter in his open letter titled &#8220;Thoughts on Flash&#8221;, which highlighted some of the negatives of the browser-based &#8220;PC era,&#8221; where Flash was settling in as the dominant platform. The letter also exploited a division between the Flash crowd and the standards and open source crowds. And he directly addressed the “full web,” &#8211; Adobe&#8217;s tone-deaf name for &#8220;the PC era&#8221;. In that direct critique Jobs highlighted the disadvantages of the new app store model, by putting the &#8220;full web&#8221; flash apps in the &#8220;free&#8221; &#8211; or unprofitable box, and painting the technology with the old brush. Even the main part of the label &#8220;PC&#8221; is an old term, from a time that came before the modern browser era.</p>
<p>That letter was truly a brilliant piece of market positioning magic, but it was ultimately unnecessary, and Apple has since backed off. The app store model provides a marvelous promise without the need to degenerate the old browser based economy. Content makers, all of whom struggled to find revenue from websites, now have multiple new revenue streams to explore, through app sales, and licensing, and other kinds of content transactions within apps.</p>
<p>During the PC Era, browsers dominated users&#8217; mind share, and time on the PC, native applications were still the clear leaders in performance, access to hardware, and close integration with the underlying OS platform. Despite that advantage, native apps were hamstrung by seemingly insurmountable inconvenience &#8211; the boxed distribution model &#8211; an inconvenience that most online distribution stores of the time simply duplicated (download, unzip setup, run setup, store setup file somewhere in case you lose your hard drive, etc.).</p>
<p>App stores solve these native application distribution problems by providing a central hub for content, simple e-commerce (no more credit card into the random unverified website), and can be integrated with the legacy system &#8211; the website.</p>
<p><strong>My head hurts.<br />
</strong></p>
<p>So what does this all mean for us, the front line Flash developers? It means opportunity. There are now three platforms to develop for!</p>
<p>Yeah, that&#8217;s right &#8211; three.</p>
<p>The transition to app stores on the desktop will take a while to roll out, and old habbits die hard, and Flash will stick around in that space for .. well, as long as that space exists. There are still a chunk of 98%+ of the user out there on the internet, still accessing the web through their existing PCs. That won&#8217;t change overnight. Even initiatives like Microsoft&#8217;s plugin blockade with Windows 8 and Metro mode take effect, they will come hand in hand with app stores, so there&#8217;s a workaround.</p>
<p>But let&#8217;s get real for a second, the Flash Player &#8211; in the browser &#8211; sits at the core of entire new lucrative markets on the PC, in the browser. Take browser era social gaming and Zynga &#8211; a game company, with a quirky social media, micro-transaction game library, integrated with Facebook&#8217;s social platform, is more profitable than top traditional PC game companies like E.A. Flash in the browser is having a grand time. Stage3d was just released, Unreal Engine was shown running on it at MAX. Flash is still tops for the best kinds of awesome on the internet.</p>
<p>Second, you have all the HTML5 opportunity &#8211; not directly relevant for Flash devs (<a href="http://blogs.adobe.com/jnack/2010/10/adobe-demos-flash-to-html5-conversion-tool.html">yet</a>), but for those of us that have had their hands in both worlds this whole time, this is exciting! HTML, JavaScript and CSS are finally getting to the point where you can build really awesome stuff with it. And, for app store monetization to work, discovery is key. Searchable HTML (and HTML5) will dominate for that. App stores are easy to search and easy to link into &#8211; from a website. Websites aren&#8217;t going anywhere &#8211; in every way, the app store model can&#8217;t work without the browser based internet.</p>
<p>And finally, the new kid on the block, the app store. For Flash devs, that means AIR &#8211; which is essentially Flash for app stores. If you have Flash (or even HTML) skills to burn, you can almost, just recompile your Flash app for AIR. Adobe has built this amazing tool &#8211; the best kept secret they didn&#8217;t mean to keep (don&#8217;t get me started on their PR). The sky is the start with AIR for Mobile, never mind the limit (Apollo indeed). The best part is, once you build for one app store with AIR, you can build for basically all of them, with very little additional effort.</p>
<p>Have a look at <a href="http://machinarium.net/">Machinarium</a>. A traditionally packaged standalone desktop app, made with Flash, and distributed in a box through traditional outlets (and the specialty PC app stores, like Steam) with an <a href="http://machinarium.net/demo/">online demo</a> that runs in the desktop browser in Flash Player. Now republished for the <a href="http://itunes.apple.com/us/app/machinarium/id459189186?mt=8&amp;ign-mpt=uo%3D2">Apple App Store</a> with AIR and some optimizations, to run on iPad as a native app.</p>
<p>So where are we? Flash is alive and kicking &#8211; thriving even &#8211; despite the clueless ramblings of know-nothing media pundits and their bandwagon seeking behavior. You don&#8217;t need to listen to them, just get out there, and make cool apps/websites/games/whatever else with the same technology you&#8217;ve always used. These are exciting times.</p>
<p>&nbsp;</p>
<div class="feedflare">
<a href="http://feeds.unfocus.com/~ff/unfocus/projects?a=qE_M1jw7QaA:d7TFG5EJkQA:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/unfocus/projects?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.unfocus.com/~ff/unfocus/projects?a=qE_M1jw7QaA:d7TFG5EJkQA:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/unfocus/projects?i=qE_M1jw7QaA:d7TFG5EJkQA:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.unfocus.com/~ff/unfocus/projects?a=qE_M1jw7QaA:d7TFG5EJkQA:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/unfocus/projects?i=qE_M1jw7QaA:d7TFG5EJkQA:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.unfocus.com/~ff/unfocus/projects?a=qE_M1jw7QaA:d7TFG5EJkQA:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/unfocus/projects?i=qE_M1jw7QaA:d7TFG5EJkQA:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/unfocus/projects/~4/qE_M1jw7QaA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.unfocus.com/2011/11/09/flash-and-air-nothing-but-opportunity/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.unfocus.com/2011/11/09/flash-and-air-nothing-but-opportunity/</feedburner:origLink></item>
		<item>
		<title>Performance Benchmarks with AIR 2.7 for iOS</title>
		<link>http://feeds.unfocus.com/~r/unfocus/projects/~3/zqPkLAr5Y9I/</link>
		<comments>http://www.unfocus.com/2011/07/03/performance-benchmarks-with-air-2-7-for-ios/#comments</comments>
		<pubDate>Sun, 03 Jul 2011 06:14:19 +0000</pubDate>
		<dc:creator>Kevin Newman</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Mobile App Development]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[Actionscript 3.0]]></category>
		<category><![CDATA[AIR]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[Bunnymark]]></category>
		<category><![CDATA[iOS]]></category>

		<guid isPermaLink="false">http://www.unfocus.com/?p=632</guid>
		<description><![CDATA[I&#8217;ve been working on this Benchmark based on Iain Lobb&#8217;s BunnyMark. Being a bit confused sometimes about what things speed things up or slow things down, I didn&#8217;t want to guess anymore, so I grabbed Iain&#8217;s code base (cause I&#8217;m &#8230; <a href="http://www.unfocus.com/2011/07/03/performance-benchmarks-with-air-2-7-for-ios/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been working on this Benchmark based on <a href="http://blog.iainlobb.com/2010/11/display-list-vs-blitting-results.html">Iain Lobb&#8217;s BunnyMark</a>. Being a bit confused sometimes about what things speed things up or slow things down, I didn&#8217;t want to guess anymore, so I grabbed Iain&#8217;s code base (cause I&#8217;m lazy, and didn&#8217;t want to start from scratch), and added some tests for things I suspect are slowing things down (or speeding things up). I think this will also help shed some light on why some folks see a huge gain in AIR 2.7 CPU mode, while others do not.</p>
<p>Some caveats &#8211; this only tests instances of flash.display.Bitmap on the display list, at the size they are, moving the way they move. It&#8217;s on my list to add Blitting (I have some initial work on that done, thanks to Iain, but I need to add the rotation, and alpha settings to it), and I&#8217;d like to add a vector test, and maybe some extra sized Bitmaps (I&#8217;ve heard that makes a difference).</p>
<p>Enough! Here are some results &#8211; quality had no effect on GPU mode, so I included only one line:</p>
<p><strong>Note:</strong> some are reporting they see a difference in GPU mode, but I still don&#8217;t. <strong>Update:</strong> It appears some users are confusing &#8220;<a href="http://www.roguish.com/blog/?p=326">Mobile Performance Tester</a>&#8221; with BunnyMark, which explains the discrepancy. BunnyMark is not currently in any App Store, which is one key distinguishing feature. <img src='http://www.unfocus.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<table border="1">
<thead>
<tr>
<th colspan="10" align="left">BunnyMark Results &#8211; 500 Bunnies</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row" align="left">Alpha</th>
<td align="center"></td>
<td align="center"></td>
<td align="center"></td>
<td align="center"></td>
<td align="center"></td>
<td align="center"></td>
<td align="center"><strong>✓</strong></td>
<td align="center"><strong>✓</strong></td>
<td align="center"><strong>✓ </strong></td>
</tr>
<tr>
<th scope="row" align="left">Rotation</th>
<td align="center"></td>
<td align="center"></td>
<td align="center"></td>
<td align="center"><strong>✓</strong></td>
<td align="center"><strong>✓</strong></td>
<td align="center"><strong>✓</strong></td>
<td align="center"></td>
<td align="center"></td>
<td align="center"><strong>✓</strong></td>
</tr>
<tr>
<th scope="row" align="left">CaB</th>
<td align="center"></td>
<td align="center"><strong>✓</strong></td>
<td align="center"><strong>✓</strong></td>
<td align="center"></td>
<td align="center"><strong>✓</strong></td>
<td align="center"><strong>✓</strong></td>
<td align="center"></td>
<td align="center"><strong>✓</strong></td>
<td align="center"></td>
</tr>
<tr>
<th scope="row" align="left">CaBM</th>
<td align="center"></td>
<td align="center"></td>
<td align="center"><strong>✓</strong></td>
<td align="center"></td>
<td align="center"></td>
<td align="center"><strong>✓</strong></td>
<td align="center"></td>
<td align="center"></td>
<td align="center"></td>
</tr>
</tbody>
<thead>
<tr>
<th colspan="10" align="left">iPhone 3GS &#8211; <strong>GPU</strong></th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row" align="left">FPS</th>
<td align="center">24</td>
<td align="center">18</td>
<td align="center">17</td>
<td align="center">22</td>
<td align="center">13</td>
<td align="center">13</td>
<td align="center">19</td>
<td align="center">1</td>
<td align="center">19</td>
</tr>
</tbody>
<thead>
<tr>
<th colspan="10" align="left">iPhone 3GS &#8211; <strong>CPU</strong></th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row" align="left">FPS-L</th>
<td align="center">28</td>
<td align="center">21</td>
<td align="center">19</td>
<td align="center">9</td>
<td align="center">19</td>
<td align="center">5</td>
<td align="center">7</td>
<td align="center">5</td>
<td align="center">5</td>
</tr>
<tr>
<th scope="row" align="left">FPS-M</th>
<td align="center">28</td>
<td align="center">21</td>
<td align="center">19</td>
<td align="center">4</td>
<td align="center">18</td>
<td align="center">3</td>
<td align="center">7</td>
<td align="center">5</td>
<td align="center">3</td>
</tr>
<tr>
<th scope="row" align="left">FPS-H</th>
<td align="center">28</td>
<td align="center">21</td>
<td align="center">19</td>
<td align="center">3</td>
<td align="center">18</td>
<td align="center">2</td>
<td align="center">7</td>
<td align="center">5</td>
<td align="center">2</td>
</tr>
<tr>
<th scope="row" align="left">FPS-B</th>
<td align="center">28</td>
<td align="center">21</td>
<td align="center">19</td>
<td align="center">3</td>
<td align="center">18</td>
<td align="center">2</td>
<td align="center">7</td>
<td align="center">5</td>
<td align="center">2</td>
</tr>
</tbody>
<thead>
<tr>
<th colspan="10" align="left">iPhone 4 (Retina) &#8211; <strong>GPU</strong></th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row" align="left">FPS</th>
<td align="center">25</td>
<td align="center">21</td>
<td align="center">20</td>
<td align="center">25</td>
<td align="center">13</td>
<td align="center">13</td>
<td align="center">16</td>
<td align="center">0.5</td>
<td align="center">16</td>
</tr>
</tbody>
<thead>
<tr>
<th colspan="10" align="left">iPhone 4 (Retina) &#8211; <strong>CPU</strong></th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row" align="left">FPS-L</th>
<td align="center">32</td>
<td align="center">23</td>
<td align="center">20</td>
<td align="center">10</td>
<td align="center">21</td>
<td align="center">6</td>
<td align="center">8</td>
<td align="center">6</td>
<td align="center">7</td>
</tr>
<tr>
<th scope="row" align="left">FPS-M</th>
<td align="center">32</td>
<td align="center">23</td>
<td align="center">20</td>
<td align="center">5</td>
<td align="center">20</td>
<td align="center">3</td>
<td align="center">8</td>
<td align="center">6</td>
<td align="center">3</td>
</tr>
<tr>
<th scope="row" align="left">FPS-H</th>
<td align="center">32</td>
<td align="center">23</td>
<td align="center">19</td>
<td align="center">4</td>
<td align="center">20</td>
<td align="center">2</td>
<td align="center">8</td>
<td align="center">6</td>
<td align="center">2</td>
</tr>
<tr>
<th scope="row" align="left">FPS-B</th>
<td align="center">32</td>
<td align="center">23</td>
<td align="center">19</td>
<td align="center">4</td>
<td align="center">20</td>
<td align="center">2</td>
<td align="center">8</td>
<td align="center">6</td>
<td align="center">2</td>
</tr>
</tbody>
</table>
<p>Notes about the Benchmark:</p>
<ul>
<li>In general, the CPU mode seems pretty consistent with the way you&#8217;d expect things to work on the desktop &#8211; the same optimizations you&#8217;d apply for the browser plugin, you&#8217;d also apply to mobile for CPU mode.</li>
<li>Rotation in this benchmark is not continuous &#8211; the Bunny graphics are only rotated at the edge of the stage, which is why cacheAsBitmap works to speed those up. If they were constantly updated, it would likely be much more expensive on CPU mode (probably more like rotation without CaB).</li>
<li>Alpha is continuous &#8211; the alpha value of each Bunny is based on the y position and is updated every frame. I would like to add a mode similar to the rotation, so see what effect CaB has on alpha transparent objects that don&#8217;t constantly change.</li>
<li>iPhone 4 and 3GS numbers aren&#8217;t directly comparable for practical purposes. The Bitmaps on the screen on 3GS take up much more real estate, since the 3GS screen res has 1/4 as many pixels as the iPhone 4. In a normal app, we&#8217;d probably resize things to look comparable between the two devices. I&#8217;ll try to add a mode that makes this more comparable (because I suspect we&#8217;ll find that 3GS can keep up with iPhone 4 with similar looking content).</li>
<li>Touching the screen seems to cost about 4 fps across the board.</li>
<li>I think there may be an issue with returning to rotation = 0 costing some performance in GPU mode. Still have to test that.</li>
<li>I&#8217;m definitely getting some variance on default speeds &#8211; basically, before any settings are messed with on some runs I get the faster numbers (the baseline numbers in the tables above). Other times it runs at default settings a couple of FPS slower (on start, or after resetting the switches). With any of the settings, everything is consistent across multiple runs.</li>
</ul>
<p>&nbsp;</p>
<p>It&#8217;d be nice to have more benchmarks for more devices, but I only have the above devices available. This should run just fine on Android, Blackberry Playbook, and iPads. If anyone wants to contribute a set of benchmarks, hit the comments. <a href="http://www.unfocus.com/BunnyMark/unBUNNYMARK-0.5.zip">Here is the source</a>. One of these days I&#8217;ll make another post, and try to draw some conclusions, maybe wrap the bullet points into a narrative, and edit some of this, but the tables are there, and the source code, and that&#8217;s the important stuff.</p>
<p>In the midst of playing with this benchmark, I found (or was pointed at) some great resources. Here are some of them:</p>
<ul>
<li><a href="http://www.indieflashblog.com/understanding-gpu-rendering-in-adobe-air-for-mobile.html">Understanding GPU Rendering in Adobe AIR for Mobile</a> &#8211; Ton of good info here.</li>
<li><a href="http://www.roguish.com/blog/?p=326">Mobile Performance Tester — Now Live in App Stores</a> &#8211; This is very similar to what I&#8217;ve done, and has some of the same kinds of tests. It shows some different results though, which I&#8217;m a bit confused about. I suspect it has something to do with using larger images, which have more alpha transparency (smoother edges). I intend to look at it more closely to see what&#8217;s up in there.</li>
<li><a href="http://blog.iainlobb.com/2010/11/display-list-vs-blitting-results.html">Original BunnyMark by Iain Lobb</a></li>
<li><a href="http://www.unfocus.com/BunnyMark/unBUNNYMARK-0.5.zip">Source for BunnyMark for AIR Mobile</a></li>
</ul>
<p>Here is the Benchmark to see it in action:<br />
<object width="580" height="400" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="src" value="http://www.unfocus.com/wp-content/uploads/BitmapCPU.swf" /><param name="wmode" value="direct"><param name="quality" value="high" /><param name="pluginspage" value="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" /><embed width="580" height="400" type="application/x-shockwave-flash" src="http://www.unfocus.com/wp-content/uploads/BitmapCPU.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" /></param></object></p>
<div class="feedflare">
<a href="http://feeds.unfocus.com/~ff/unfocus/projects?a=zqPkLAr5Y9I:7wSSihjH_dc:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/unfocus/projects?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.unfocus.com/~ff/unfocus/projects?a=zqPkLAr5Y9I:7wSSihjH_dc:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/unfocus/projects?i=zqPkLAr5Y9I:7wSSihjH_dc:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.unfocus.com/~ff/unfocus/projects?a=zqPkLAr5Y9I:7wSSihjH_dc:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/unfocus/projects?i=zqPkLAr5Y9I:7wSSihjH_dc:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.unfocus.com/~ff/unfocus/projects?a=zqPkLAr5Y9I:7wSSihjH_dc:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/unfocus/projects?i=zqPkLAr5Y9I:7wSSihjH_dc:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/unfocus/projects/~4/zqPkLAr5Y9I" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.unfocus.com/2011/07/03/performance-benchmarks-with-air-2-7-for-ios/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://www.unfocus.com/2011/07/03/performance-benchmarks-with-air-2-7-for-ios/</feedburner:origLink></item>
		<item>
		<title>Scripts n Styles update 2.0.1</title>
		<link>http://feeds.unfocus.com/~r/unfocus/projects/~3/ta5glfP-9o4/</link>
		<comments>http://www.unfocus.com/2011/06/24/scripts-n-styles-update-2-0-1/#comments</comments>
		<pubDate>Fri, 24 Jun 2011 20:24:37 +0000</pubDate>
		<dc:creator>Kenneth Newman</dc:creator>
				<category><![CDATA[Scripts n Styles]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Wordpress Plugins]]></category>
		<category><![CDATA[wordpress plugin]]></category>

		<guid isPermaLink="false">http://www.unfocus.com/?p=634</guid>
		<description><![CDATA[Scripts n Styles is a tool to allow admins to add scripts and styles without editing template files, or worrying about authors overwriting the code. <a href="http://www.unfocus.com/2011/06/24/scripts-n-styles-update-2-0-1/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://wordpress.org/extend/plugins/scripts-n-styles/">Scripts n Styles</a> is a tool to allow admins (and editors in single installs) to add scripts and styles without editing template files, or worrying about authors overwriting the code (code is stripped when an author updates since they don&#8217;t have permission to use unfiltered html).</p>
<h3>Improvements in version 2.0.1:</h3>
<p>The meta box has been improved to provide a <a href="http://developersmind.com/tabbed-meta-box-in-wordpress/">tabbed interface</a> for less clutter, and syntax highlight and formating is added using the open-source <a href="http://codemirror.net/">CodeMirror 2.1</a>.</p>
<p>An option has been added to allow adding script to the head element in addition to the traditional bottom of the page spot.</p>
<p>An Options page (under Tools) has been added so you can add Script n Styles to the entire site, rather then just the individual posts and pages.</p>
<p>Some minor code improvements:</p>
<ul>
<li>Better selection of post_types.</li>
<li>micro-optimization for storage of class names.</li>
<li>Defined a later priority for Scripts n Styles to print after other scripts and styles.</li>
<li>Better adherence to coding standards.</li>
<li>began contextual help (notes on capabilities).</li>
</ul>
<div class="feedflare">
<a href="http://feeds.unfocus.com/~ff/unfocus/projects?a=ta5glfP-9o4:0e1aHndPIVs:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/unfocus/projects?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.unfocus.com/~ff/unfocus/projects?a=ta5glfP-9o4:0e1aHndPIVs:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/unfocus/projects?i=ta5glfP-9o4:0e1aHndPIVs:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.unfocus.com/~ff/unfocus/projects?a=ta5glfP-9o4:0e1aHndPIVs:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/unfocus/projects?i=ta5glfP-9o4:0e1aHndPIVs:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.unfocus.com/~ff/unfocus/projects?a=ta5glfP-9o4:0e1aHndPIVs:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/unfocus/projects?i=ta5glfP-9o4:0e1aHndPIVs:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/unfocus/projects/~4/ta5glfP-9o4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.unfocus.com/2011/06/24/scripts-n-styles-update-2-0-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.unfocus.com/2011/06/24/scripts-n-styles-update-2-0-1/</feedburner:origLink></item>
		<item>
		<title>What is a “Native” App?</title>
		<link>http://feeds.unfocus.com/~r/unfocus/projects/~3/RNO0SttjgOg/</link>
		<comments>http://www.unfocus.com/2011/03/25/what-is-a-native-app/#comments</comments>
		<pubDate>Fri, 25 Mar 2011 17:39:14 +0000</pubDate>
		<dc:creator>Kevin Newman</dc:creator>
				<category><![CDATA[Commentary]]></category>
		<category><![CDATA[AIR]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[iOS]]></category>

		<guid isPermaLink="false">http://www.unfocus.com/?p=605</guid>
		<description><![CDATA[I was recently asked my opinion on what makes a &#8220;native&#8221; app, and this was my response: It depends on how you split that hair. I think it depends on what platform level (hardware, OS, etc.) the particular user of &#8230; <a href="http://www.unfocus.com/2011/03/25/what-is-a-native-app/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I was recently asked my opinion on what makes a &#8220;native&#8221; app, and this was my response:</p>
<p>It depends on how you split that hair.</p>
<p>I think it depends on what platform level (hardware, OS, etc.) the particular user of the word native thinks that word applies to. It seems many use the word to refer to the actual bytecode and whether it matches the hardware (the CPU) &#8211; but in those cases I often see the term native used with the CPU architecture in the description &#8211; such as native ARM, or not native x86. iOS apps compiled with AIR 2.6 I&#8217;d say are compiled to native ARM bytecode.</p>
<p>There are other ways to parse it though &#8211; for example, it was pointed out to me that AIR for iOS apps are compiled from ABC bytecode into ARM bytecode to avoid the JIT (and Apple&#8217;s restrictions on the use of JIT), but that code still uses the virtual machine &#8211; the garbage collector, sandbox and whatnot. This gets right up to the edge of my understanding of virtual machines. But, if the use of a VM precludes an app from being called native then could .NET be native on Windows, or Dalvik apps on Android? In the case of .NET, there is even a JIT (pretty sure on that one, but not entirely so).</p>
<p>Then there&#8217;s the issue of targeted API (and ABI) &#8211; if an app is compiled to run on Windows, but is running in a VM on Linux, it&#8217;s probably not native (even though it&#8217;s CPU architecture probably matches), but if it runs in WINE on Linux, is that native?</p>
<p>Speaking of the Linux crowd &#8211; they parse their platforms even more granularity &#8211; Gnome apps, running on KDE are not native to some people, simply because they use a different GUI toolkit, though something running in an interpreted language like Python are native if they use the &#8220;native&#8221; GUI toolkit. Games are not subject to this line of reasoning &#8211; if it runs on Linux in OpenGL (without WINE) then it&#8217;s native.</p>
<p>I even remember reading some opinions in various places that programs not written in C are not native to Linux, and programs not written in C++ are not native to Windows &#8211; despite those programs using all the same APIs, ABIs, and not running a in VM.</p>
<p>So what is my opinion? As it relates to my current favorite target platform, I wouldn&#8217;t call an AIR app native &#8211; especially since it requires a 3rd party runtime to be installed separately (like on Android or desktops), and doesn&#8217;t have access to the native GUI toolkits and widgets and other OS APIs. That&#8217;s not a hard and fast opinion though, my definition of native is pretty malleable, and likely to change over time (or over the course of writing this response). I think I&#8217;d have a hard time selling the idea that a Java or AIR app is native to a client &#8211; on Android mostly because of the separate runtime requirement &#8211; and on all platforms, because of the lack of access to OS level APIs. It would feel disingenuous to call an AIR app a native app.</p>
<p>AIR for iOS comes closest to being reasonably called a native app &#8211; it is compiled as a complete standalone package, and runs pretty close to the metal (being compiled to ARM code) &#8211; and most importantly doesn&#8217;t require a third party runtime to be installed separately. If AIR for iOS apps had access to the native (underlying OS platform) GUI toolkit and other APIs, I would be more comfortable calling it native, though probably still wouldn&#8217;t.</p>
<p>Probably the best definition of &#8220;native&#8221; I could come up (which you still won&#8217;t get anywhere close to universal agreement on) is an app that comes out of using the platform maker&#8217;s tools to develop apps for the platform &#8211; XCode + Objective-C (and other supported languages) for OSX and iOS, Visual Studio for Windows and Windows Phone, Android SDK for Android &#8211; even using Adobe&#8217;s tools to make an AIR app makes it a &#8220;native&#8221; AIR app &#8211; where using HaXe may not count as native.</p>
<p>Generally though, as much as I could, I would try not to discuss whether or not an app development tool like AIR is native at all &#8211; especially since that term is so subjective. A project needs a particular problem solved, and if I can do that with AIR (on iOS that means it doesn&#8217;t require iOS GUI elements and conventions, or other features of iOS), then that&#8217;s what I&#8217;d recommend.</p>
<p><strong>Update:</strong> AIR 3.0 closes this gap, and makes the &#8220;Native App&#8221; comparison easier because of two features; 1. Captive runtime &#8211; no more separate runtime requirement means it&#8217;s a standalone app. 2. Native Extensions &#8211; now an app has access to all the native functionality of the underlying platform. I&#8217;m comfortable calling an AIR app a Native App with AIR 3.0.</p>
<div class="feedflare">
<a href="http://feeds.unfocus.com/~ff/unfocus/projects?a=RNO0SttjgOg:0k6Y-9f7tSE:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/unfocus/projects?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.unfocus.com/~ff/unfocus/projects?a=RNO0SttjgOg:0k6Y-9f7tSE:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/unfocus/projects?i=RNO0SttjgOg:0k6Y-9f7tSE:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.unfocus.com/~ff/unfocus/projects?a=RNO0SttjgOg:0k6Y-9f7tSE:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/unfocus/projects?i=RNO0SttjgOg:0k6Y-9f7tSE:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.unfocus.com/~ff/unfocus/projects?a=RNO0SttjgOg:0k6Y-9f7tSE:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/unfocus/projects?i=RNO0SttjgOg:0k6Y-9f7tSE:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/unfocus/projects/~4/RNO0SttjgOg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.unfocus.com/2011/03/25/what-is-a-native-app/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.unfocus.com/2011/03/25/what-is-a-native-app/</feedburner:origLink></item>
		<item>
		<title>WordPress Admin Bar Theme Support</title>
		<link>http://feeds.unfocus.com/~r/unfocus/projects/~3/upUoIhJ6b6o/</link>
		<comments>http://www.unfocus.com/2011/02/07/wordpress-admin-bar-theme-support/#comments</comments>
		<pubDate>Tue, 08 Feb 2011 00:37:01 +0000</pubDate>
		<dc:creator>Kenneth Newman</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Scrollbar Fix]]></category>
		<category><![CDATA[Theme Support]]></category>
		<category><![CDATA[WP Admin Bar]]></category>

		<guid isPermaLink="false">http://www.unfocus.com/?p=568</guid>
		<description><![CDATA[Here&#8217;s a quickie for WordPress Theme designers: If your theme is getting unwanted scroll-bars because of the new Admin Bar is WordPress 3.1, the core team included a way to handle it. Add Theme Support for it! With a full &#8230; <a href="http://www.unfocus.com/2011/02/07/wordpress-admin-bar-theme-support/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a quickie for WordPress Theme designers:</p>
<p>If your theme is getting unwanted scroll-bars because of the new Admin Bar is WordPress 3.1, the core team included a way to handle it. Add Theme Support for it! </p>
<p>With a full height layout, you&#8217;ll want to avoid adding a margin or padding to a height that is already at 100% because you&#8217;ll get useless scrollbars, and no one wants that. Instead, find the first non-full height element (usually #header or some-such), and apply the margin there (either the 28px for the height of the admin bar, or add 28 to the existing margin if the element already has one). In the code snippet below I assumed you&#8217;d create an element or assign the class &#8216;admin-bar-fix&#8217; to an existing element.</p>
<p>In your theme&#8217;s function file, add the following and modify as you see fit: (best to leave out the closing php tag though)</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">&lt;?php</span><br />
add_action<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'after_setup_theme'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'custom_theme_setup'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">function</span> custom_theme_setup<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
add_theme_support<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'admin-bar'</span><span style="color: #339933;">,</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'callback'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'admin_bar_bump_callback'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<span style="color: #000000; font-weight: bold;">function</span> admin_bar_bump_callback<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span><br />
&lt;style&gt;.admin-bar-fix { margin-top: 48px; }&lt;/style&gt;<br />
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></div></div>
<p>This snippet is derived from the TwentyTen Theme&#8217;s function file. The callback&#8217;s original code can be found <a href="http://core.trac.wordpress.org/browser/trunk/wp-includes/admin-bar.php#L655">in the source</a>. Original snippet also found commented <a href="http://core.trac.wordpress.org/browser/trunk/wp-includes/class-wp-admin-bar.php#L35">in the source (props ocean90)</a>.</p>
<p>Basically, by declaring support for the new (as of 3.1) &#8220;Admin Bar,&#8221; you declare that you can handle how your theme&#8217;s content gets &#8220;bumped&#8221; (by default, it gets pushed down by 28px via a margin on the html.) Most of the time the default behavior is fine&#8230; but it&#8217;s not fine on theme&#8217;s that have a height declaration of 100% (even min-height) or that have external scripts that declare 100% height on the html/body (like <a href="http://translate.google.com/translate_tools">Google Translate</a> does).</p>
<p>WordPress&#8217;s admin needed a similar treatment but <a href="http://core.trac.wordpress.org/ticket/15507">that got patched</a>. The 28px margin is just a default to handle most normal cases. Your theme is your responsibility <img src='http://www.unfocus.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  </p>
<p>Cheers! Hope this saves some time for someone!</p>
<h4>Update: Admin Bar Shim!</h4>
<p>If you don&#8217;t have a 100% height type of layout but are annoyed by improperly scrolling anchored links try the following.</p>
<p>If you add a &gt;div id=&#8221;admin-bar-shim&#8221;> (for lack of a better name) in your theme surrounding everything inside the  body except the wp_footer call (where the admin-bar gets echoed), you can add</p>
<div class="codecolorer-container css default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="css codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #6666ff;">.admin-bar</span> <span style="color: #cc00cc;">#admin-bar-shim</span> <span style="color: #00AA00;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">fixed</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">bottom</span><span style="color: #00AA00;">:</span> <span style="color: #933;">0pt</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">0pt</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">right</span><span style="color: #00AA00;">:</span> <span style="color: #933;">0pt</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">overflow</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">auto</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">28px</span><span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span></div></div>
<p>to your style sheet, or use the method above adding the callback. This new method allows anchor links to scroll properly.</p>
<div class="feedflare">
<a href="http://feeds.unfocus.com/~ff/unfocus/projects?a=upUoIhJ6b6o:CF4f7UxXQBg:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/unfocus/projects?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.unfocus.com/~ff/unfocus/projects?a=upUoIhJ6b6o:CF4f7UxXQBg:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/unfocus/projects?i=upUoIhJ6b6o:CF4f7UxXQBg:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.unfocus.com/~ff/unfocus/projects?a=upUoIhJ6b6o:CF4f7UxXQBg:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/unfocus/projects?i=upUoIhJ6b6o:CF4f7UxXQBg:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.unfocus.com/~ff/unfocus/projects?a=upUoIhJ6b6o:CF4f7UxXQBg:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/unfocus/projects?i=upUoIhJ6b6o:CF4f7UxXQBg:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/unfocus/projects/~4/upUoIhJ6b6o" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.unfocus.com/2011/02/07/wordpress-admin-bar-theme-support/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.unfocus.com/2011/02/07/wordpress-admin-bar-theme-support/</feedburner:origLink></item>
		<item>
		<title>unBrix Alpha in Android Marketplace!!</title>
		<link>http://feeds.unfocus.com/~r/unfocus/projects/~3/qwhlWrCTOMc/</link>
		<comments>http://www.unfocus.com/2010/10/22/unbrix-alpha-in-android-marketplace/#comments</comments>
		<pubDate>Sat, 23 Oct 2010 04:31:15 +0000</pubDate>
		<dc:creator>Kevin Newman</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Fun & Games]]></category>
		<category><![CDATA[Mobile App Development]]></category>
		<category><![CDATA[Actionscript 3.0]]></category>
		<category><![CDATA[Adobe AIR]]></category>
		<category><![CDATA[Video Games]]></category>

		<guid isPermaLink="false">http://www.unfocus.com/?p=544</guid>
		<description><![CDATA[My first Android app is in the market place! Built with Adobe AIR, unBrix Alpha is a quick take on the classic breakout style game. This is more of a &#8220;lite&#8221; game at this point (hence the &#8220;Alpha&#8221; suffix), but &#8230; <a href="http://www.unfocus.com/2010/10/22/unbrix-alpha-in-android-marketplace/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>My first Android app is in the market place! Built with Adobe AIR, unBrix Alpha is a quick take on the classic breakout style game. This is more of a &#8220;lite&#8221; game at this point (hence the &#8220;Alpha&#8221; suffix), but it is already more complete than many of the other Arkanoid clones in iOS App Store. There also seems to be some last minute performance problems on the Android version. :-/ I guess that&#8217;s what I get for only testing on an iPhone for most of the development. I&#8217;ll have fixes to that soon. I&#8217;m pretty sure it&#8217;s related to the scaleMode I set in Flash &#8211; the problem is if I set that the faster mode &#8211; NO_SCALE &#8211; it&#8217;s way too small on most Android devices. I&#8217;ll probably need to add some manual sizing based on measurement. Of course non of this was needed on the iPhone version.</p>
<p>Download unBrix Alpha and let me know what you think! I&#8217;d provide a link, but I don&#8217;t know how.</p>
<p><strong>Update:</strong> I Nerfed the framerate a bit to get it to run a little smoother. I think the problem will be solved better by setting NO_SCALE, but I&#8217;ll  have to do that another time (probably when I get to iPad port!). I also fixed the red line, and the icon too (I don&#8217;t know that didn&#8217;t show up last time). There is a report of the paddle jumping to one side when some users remove their finger from the screen. I haven&#8217;t been able to reproduce, but please let me know if this happens to you! Here is a link to <a href="http://www.appbrain.com/app/unbrix-alpha/air.unBrixAlpha">unBrix Alpha on appbrain</a> (it isn&#8217;t showing the update yet).</p>
<p><strong>Update 2:</strong> I switched to CPU rendering, because it seems as though GPU rendering is just slower on Android devices than CPU rendering &#8211; at least in this kind of game. Anyway, this solved a lot of problems, including missing text and missing affects. I also had to set a fullScreenRect to match the original intended size of the game (iPhone 3Gs size). Doing these two things cleaned up most of the performance issues and graphics glitches. I&#8217;ll work on getting the remainder of the basics in place, like proper shutdowns &#8211; so this doesn&#8217;t run in the background like it does now (didn&#8217;t have to worry about that for iOS!).</p>
<div class="feedflare">
<a href="http://feeds.unfocus.com/~ff/unfocus/projects?a=qwhlWrCTOMc:1VeseOi0ALQ:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/unfocus/projects?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.unfocus.com/~ff/unfocus/projects?a=qwhlWrCTOMc:1VeseOi0ALQ:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/unfocus/projects?i=qwhlWrCTOMc:1VeseOi0ALQ:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.unfocus.com/~ff/unfocus/projects?a=qwhlWrCTOMc:1VeseOi0ALQ:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/unfocus/projects?i=qwhlWrCTOMc:1VeseOi0ALQ:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.unfocus.com/~ff/unfocus/projects?a=qwhlWrCTOMc:1VeseOi0ALQ:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/unfocus/projects?i=qwhlWrCTOMc:1VeseOi0ALQ:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/unfocus/projects/~4/qwhlWrCTOMc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.unfocus.com/2010/10/22/unbrix-alpha-in-android-marketplace/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.unfocus.com/2010/10/22/unbrix-alpha-in-android-marketplace/</feedburner:origLink></item>
		<item>
		<title>Flash iPhone Game at Silky 60FPS on 3GS</title>
		<link>http://feeds.unfocus.com/~r/unfocus/projects/~3/6PPPtck9w6I/</link>
		<comments>http://www.unfocus.com/2010/10/01/flash-iphone-game-at-silky-60fps-on-3gs/#comments</comments>
		<pubDate>Fri, 01 Oct 2010 17:57:06 +0000</pubDate>
		<dc:creator>Kevin Newman</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Mobile App Development]]></category>
		<category><![CDATA[Actionscript 3.0]]></category>
		<category><![CDATA[AIR]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Video Games]]></category>

		<guid isPermaLink="false">http://www.unfocus.com/?p=519</guid>
		<description><![CDATA[Well, it&#8217;s only a tech demo at the moment. I&#8217;ve been playing with this Breakout like game for a while, trying to learn the ins and outs of Flash mobile development &#8211; particularly as it relates to performance. I now &#8230; <a href="http://www.unfocus.com/2010/10/01/flash-iphone-game-at-silky-60fps-on-3gs/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Well, it&#8217;s only a tech demo at the moment. I&#8217;ve been playing with this Breakout like game for a while, trying to learn the ins and outs of Flash mobile development &#8211; particularly as it relates to performance. I now have the unBrix demo running at close to 60FPS (59.1) &#8211; smooth as silk.</p>
<p>This won&#8217;t run at 60FPS on Android Flash Player plugin in the browser (or Firefox on Mac!) &#8211; this post is about the iPhone build &#8211; but <a href="http://www.unfocus.com/unBrix.refac.html">here&#8217;s the web version</a> to look at anyway.</p>
<p><object style="width: 480px; height: 320px;" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="590" height="480" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="src" value="http://www.unfocus.com/unBrix34.swf" /><param name="bgcolor" value="#000000" /><embed style="width: 480px; height: 320px;display:block;" type="application/x-shockwave-flash" width="480" height="320" src="http://www.unfocus.com/unBrix34.swf" bgcolor="#000000"></embed></object></p>
<p>Here is a blurry video of the thing running as a native iPhone app on a 3GS (I smoothed out the choppy splash transition in a later build by setting the BG element with cacheAsBitmapMatrix):</p>
<p><span class='embed-youtube' style='text-align:center; display: block;'><iframe class='youtube-player' type='text/html' width='584' height='359' src='http://www.youtube.com/embed/6wxwGv6DXgI?version=3&amp;rel=1&amp;fs=1&amp;showsearch=0&amp;showinfo=1&amp;iv_load_policy=1&amp;wmode=transparent' frameborder='0'></iframe></span></p>
<p>The most important thing was to make sure GPU acceleration was working, and to learn what things will impact performance in that area.</p>
<p>It turns out, there are some important differences with how GPU accelerated Flash woks compared with the traditional software renderer. In the software Flash renderer keeping your display list shallow, and sparse (using addChild/removeChild a lot) or avoiding the display list completely (by writing to BitmapData &#8211; as the <a href="http://flixel.org/">Flixel game engine</a> does) is a key optimization for performance. This is how the exploding bunny video demo is done, and why it&#8217;s so fast.</p>
<p>My current theory is that on GPU accelerated content (even on desktop) the reverse is true. You want to avoid CPU/system RAM to GPU/video RAM updates as much as possible &#8211; which means avoiding BitmapData updates which cause the player to upload a new texture to the GPU VRAM with every update. Because I don&#8217;t have access to the internals of the Flash Player architecture, I can&#8217;t be sure, but I think the bottle neck comes from clogging up the lanes between the CPU and GPU, and all stressing all three areas of the rendering pipeline (CPU, GPU and the bus) as they juggle around objects in memory. The key observation this conclusion is based on is the large performance impact addChild and removeChild has on the framerate. So I relentlessly avoid that in my iPhone Flash development &#8211; I precache everything, and don&#8217;t mess with the display list. This is also one reason why filters (which operate on a BitmapData representation of the DisplayObject you apply them to) are not recommended on mobile content.</p>
<p>Anyway, hopefully I can turn this into a full app for iPhone in a reasonable timeframe. <img src='http://www.unfocus.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<div class="feedflare">
<a href="http://feeds.unfocus.com/~ff/unfocus/projects?a=6PPPtck9w6I:kHOrP1_9nNQ:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/unfocus/projects?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.unfocus.com/~ff/unfocus/projects?a=6PPPtck9w6I:kHOrP1_9nNQ:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/unfocus/projects?i=6PPPtck9w6I:kHOrP1_9nNQ:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.unfocus.com/~ff/unfocus/projects?a=6PPPtck9w6I:kHOrP1_9nNQ:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/unfocus/projects?i=6PPPtck9w6I:kHOrP1_9nNQ:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.unfocus.com/~ff/unfocus/projects?a=6PPPtck9w6I:kHOrP1_9nNQ:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/unfocus/projects?i=6PPPtck9w6I:kHOrP1_9nNQ:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/unfocus/projects/~4/6PPPtck9w6I" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.unfocus.com/2010/10/01/flash-iphone-game-at-silky-60fps-on-3gs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.unfocus.com/2010/10/01/flash-iphone-game-at-silky-60fps-on-3gs/</feedburner:origLink></item>
		<item>
		<title>Scripts n Styles</title>
		<link>http://feeds.unfocus.com/~r/unfocus/projects/~3/PZ3vLklyQIs/</link>
		<comments>http://www.unfocus.com/2010/09/15/scripts-n-styles/#comments</comments>
		<pubDate>Wed, 15 Sep 2010 17:59:25 +0000</pubDate>
		<dc:creator>Kenneth Newman</dc:creator>
				<category><![CDATA[Wordpress Plugins]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[Scripts n Styles]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.unfocus.com/?p=502</guid>
		<description><![CDATA[Introducing a new plugin for WordPress from unFocus Projects! Ever need to add a CSS style or some code snippet to just one page or post in WordPress? We release an admin tool to do just that. On the post &#8230; <a href="http://www.unfocus.com/2010/09/15/scripts-n-styles/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Introducing a new plugin for WordPress from unFocus Projects!</p>
<p>Ever need to add a CSS style or some code snippet to just one page or post in WordPress? We release an admin tool to do just that.</p>
<p>On the post edit screen of the admin, <a title="Scripts n Styles project page" href="/projects/scripts-n-styles/">Scripts n Styles</a> adds a meta box where you can add JavaScript, CSS or even add class names to the body tag or the post content wrapper (as long as the theme supports wp_head, wp_footer, body_class, and post_class functions and almost all do).</p>
<p>The plugin is available on <a href="http://wordpress.org/extend/plugins/scripts-n-styles/">WordPress.org Extend</a> (and therefor your plugin admin screen <img src='http://www.unfocus.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  ). You can also fork it on <a href="http://github.com/WraithKenny/Scripts-n-Styles">Github</a>. It&#8217;s licensed GPLv2. (current version 1.0.2)</p>
<p>Enjoy!</p>
<div class="feedflare">
<a href="http://feeds.unfocus.com/~ff/unfocus/projects?a=PZ3vLklyQIs:mxnUzYAKi_U:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/unfocus/projects?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.unfocus.com/~ff/unfocus/projects?a=PZ3vLklyQIs:mxnUzYAKi_U:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/unfocus/projects?i=PZ3vLklyQIs:mxnUzYAKi_U:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.unfocus.com/~ff/unfocus/projects?a=PZ3vLklyQIs:mxnUzYAKi_U:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/unfocus/projects?i=PZ3vLklyQIs:mxnUzYAKi_U:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.unfocus.com/~ff/unfocus/projects?a=PZ3vLklyQIs:mxnUzYAKi_U:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/unfocus/projects?i=PZ3vLklyQIs:mxnUzYAKi_U:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/unfocus/projects/~4/PZ3vLklyQIs" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.unfocus.com/2010/09/15/scripts-n-styles/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.unfocus.com/2010/09/15/scripts-n-styles/</feedburner:origLink></item>
		<item>
		<title>A Simple State Manager for History Keeper</title>
		<link>http://feeds.unfocus.com/~r/unfocus/projects/~3/4QOxOMZLYVI/</link>
		<comments>http://www.unfocus.com/2010/08/26/a-simple-state-manager-with-history-keeper/#comments</comments>
		<pubDate>Thu, 26 Aug 2010 16:33:58 +0000</pubDate>
		<dc:creator>Kevin Newman</dc:creator>
				<category><![CDATA[History Keeper]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Ajax]]></category>
		<category><![CDATA[deep linking]]></category>
		<category><![CDATA[HistoryKeeper]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://www.unfocus.com/?p=498</guid>
		<description><![CDATA[Someone asked how to store a key value pair in HistoryKeeper recently, and this was my answer. History Keeper does not provide any state management features beyond the information you store on the actual deep link (URL hash). However, you &#8230; <a href="http://www.unfocus.com/2010/08/26/a-simple-state-manager-with-history-keeper/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Someone asked how to store a key value pair in HistoryKeeper recently, and this was my answer.</p>
<p>History Keeper does not provide any state management features beyond the information you store on the actual deep link (URL hash). However, you should be able to use the deep link information to grab the data you need out of a standard JS object (using it like a hash table):</p>
<div class="codecolorer-container javascript default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #003366; font-weight: bold;">var</span> storage <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #3366CC;">&quot;/&quot;</span><span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; key<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;home value&quot;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; <span style="color: #3366CC;">&quot;/about&quot;</span><span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; key<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;about value&quot;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span></div></div>
<p>Once you have your values stored like that you can use the storage object to lookup your chunk of data by the deep link string:</p>
<div class="codecolorer-container javascript default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #003366; font-weight: bold;">function</span> onHistoryChange<span style="color: #009900;">&#40;</span>hash<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span>storage<span style="color: #009900;">&#91;</span>hash<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">key</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
unFocus.<span style="color: #660066;">History</span>.<span style="color: #660066;">addEventListener</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'historyChange'</span><span style="color: #339933;">,</span> onHistoryChange<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></div>
<p>You can make the &#8220;value&#8221; as deep as you want ( key: {more: &#8220;complex&#8221;} ), I only used a simple string for demonstration purposes.</p>
<p>This example is JavaScript, but the concepts are the same for Actionscript as well.</p>
<p>I hope that helps!</p>
<div class="feedflare">
<a href="http://feeds.unfocus.com/~ff/unfocus/projects?a=4QOxOMZLYVI:o2p9GyBIcho:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/unfocus/projects?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.unfocus.com/~ff/unfocus/projects?a=4QOxOMZLYVI:o2p9GyBIcho:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/unfocus/projects?i=4QOxOMZLYVI:o2p9GyBIcho:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.unfocus.com/~ff/unfocus/projects?a=4QOxOMZLYVI:o2p9GyBIcho:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/unfocus/projects?i=4QOxOMZLYVI:o2p9GyBIcho:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.unfocus.com/~ff/unfocus/projects?a=4QOxOMZLYVI:o2p9GyBIcho:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/unfocus/projects?i=4QOxOMZLYVI:o2p9GyBIcho:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/unfocus/projects/~4/4QOxOMZLYVI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.unfocus.com/2010/08/26/a-simple-state-manager-with-history-keeper/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.unfocus.com/2010/08/26/a-simple-state-manager-with-history-keeper/</feedburner:origLink></item>
		<item>
		<title>Frash shows Flash on iPhone can be Great (with Screenshots)</title>
		<link>http://feeds.unfocus.com/~r/unfocus/projects/~3/Cwudy1Nuy_c/</link>
		<comments>http://www.unfocus.com/2010/08/11/frash-shows-flash-on-iphone-can-be-great-with-screenshots/#comments</comments>
		<pubDate>Wed, 11 Aug 2010 17:31:42 +0000</pubDate>
		<dc:creator>Kevin Newman</dc:creator>
				<category><![CDATA[Adobe]]></category>
		<category><![CDATA[Commentary]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Actionscript 3.0]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://www.unfocus.com/?p=468</guid>
		<description><![CDATA[Warning: RANT ahead Steve Jobs is full of crap. I could actually understand and respect a straightforward admission that the Flash Platform is a threat to Apple&#8217;s iOS business model &#8211; which is the real reason Jobs won&#8217;t let Flash &#8230; <a href="http://www.unfocus.com/2010/08/11/frash-shows-flash-on-iphone-can-be-great-with-screenshots/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Warning: RANT ahead</p>
<p>Steve Jobs is full of crap. I could actually understand and respect a straightforward admission that the Flash Platform is a threat to Apple&#8217;s iOS business model &#8211; which is the real reason Jobs won&#8217;t let Flash on the iPhone and iPad. That&#8217;s not even a very good reason &#8211; the App Store has many compelling features on it&#8217;s own, even if Flash is in the browser, not the least of which is the easy to understand path to monitization. Performance is another issue &#8211; Flash is fast enough, faster than JS/Canvas by quite a bit, but it&#8217;s still not as fast as a native app and all it&#8217;s OpenGL goodness (among all the other great Apple APIs). Keeping Flash off iPhone (and especially CS5 iPhone apps) has nothing to do with performance, or compatibility. That&#8217;s just bunk! And nobody likes a liar.</p>
<p>/rant</p>
<p>Here are some screenshots to show how well many sites I&#8217;ve been involved with work in Flash on the iPhone (3GS using jailbreak and Frash).</p>

<a href='http://www.unfocus.com/2010/08/11/frash-shows-flash-on-iphone-can-be-great-with-screenshots/screenshot-2010-08-09-12-45-08/' title='Screenshot 2010.08.09 12.45.08'><img width="150" height="150" src="http://www.unfocus.com/wp-content/uploads/Screenshot-2010.08.09-12.45.08-150x150.png" class="attachment-thumbnail" alt="adcSTUDIO&#039;s home page" title="Screenshot 2010.08.09 12.45.08" /></a>
<a href='http://www.unfocus.com/2010/08/11/frash-shows-flash-on-iphone-can-be-great-with-screenshots/screenshot-2010-08-09-12-45-26/' title='Screenshot 2010.08.09 12.45.26'><img width="150" height="150" src="http://www.unfocus.com/wp-content/uploads/Screenshot-2010.08.09-12.45.26-150x150.png" class="attachment-thumbnail" alt="adcSTUDIO&#039;s about us section" title="Screenshot 2010.08.09 12.45.26" /></a>
<a href='http://www.unfocus.com/2010/08/11/frash-shows-flash-on-iphone-can-be-great-with-screenshots/screenshot-2010-08-06-20-50-16/' title='Screenshot 2010.08.06 20.50.16'><img width="150" height="150" src="http://www.unfocus.com/wp-content/uploads/Screenshot-2010.08.06-20.50.16-150x150.png" class="attachment-thumbnail" alt="Terminal Design (before activating Frash)" title="Screenshot 2010.08.06 20.50.16" /></a>
<a href='http://www.unfocus.com/2010/08/11/frash-shows-flash-on-iphone-can-be-great-with-screenshots/screenshot-2010-08-06-19-28-54/' title='Screenshot 2010.08.06 19.28.54'><img width="150" height="150" src="http://www.unfocus.com/wp-content/uploads/Screenshot-2010.08.06-19.28.54-150x150.png" class="attachment-thumbnail" alt="Terminal Design&#039;s Home Page (with Flash)" title="Screenshot 2010.08.06 19.28.54" /></a>
<a href='http://www.unfocus.com/2010/08/11/frash-shows-flash-on-iphone-can-be-great-with-screenshots/screenshot-2010-08-06-21-03-52/' title='Screenshot 2010.08.06 21.03.52'><img width="150" height="150" src="http://www.unfocus.com/wp-content/uploads/Screenshot-2010.08.06-21.03.52-150x150.png" class="attachment-thumbnail" alt="Make Beliefs Comix app." title="Screenshot 2010.08.06 21.03.52" /></a>
<a href='http://www.unfocus.com/2010/08/11/frash-shows-flash-on-iphone-can-be-great-with-screenshots/screenshot-2010-08-06-20-58-31/' title='March of Dimes - March for Babies Facebook app'><img width="150" height="150" src="http://www.unfocus.com/wp-content/uploads/Screenshot-2010.08.06-20.58.31-150x150.png" class="attachment-thumbnail" alt="March of Dimes - March for Babies Facebook app" title="March of Dimes - March for Babies Facebook app" /></a>
<a href='http://www.unfocus.com/2010/08/11/frash-shows-flash-on-iphone-can-be-great-with-screenshots/screenshot-2010-08-06-20-48-09/' title='Beaverkill Press Homepage'><img width="150" height="150" src="http://www.unfocus.com/wp-content/uploads/Screenshot-2010.08.06-20.48.09-150x150.png" class="attachment-thumbnail" alt="Beaverkill Press Homepage" title="Beaverkill Press Homepage" /></a>
<a href='http://www.unfocus.com/2010/08/11/frash-shows-flash-on-iphone-can-be-great-with-screenshots/screenshot-2010-08-06-20-49-07/' title='Inside the Beaverkill Press Microsite'><img width="150" height="150" src="http://www.unfocus.com/wp-content/uploads/Screenshot-2010.08.06-20.49.07-150x150.png" class="attachment-thumbnail" alt="Inside the Beaverkill Press Microsite" title="Inside the Beaverkill Press Microsite" /></a>
<a href='http://www.unfocus.com/2010/08/11/frash-shows-flash-on-iphone-can-be-great-with-screenshots/screenshot-2010-08-06-20-41-42/' title='Screenshot 2010.08.06 20.41.42'><img width="150" height="150" src="http://www.unfocus.com/wp-content/uploads/Screenshot-2010.08.06-20.41.42-150x150.png" class="attachment-thumbnail" alt="A text book app" title="Screenshot 2010.08.06 20.41.42" /></a>

<p>A quit note on the technology: this is using Frash, which is a hack (a wrapper or compatibility layer) to get the Android version of Flash Player 10.1 running inside of iOS &#8211; it has not been optimized (or even completed at this point) to run well on iOS yet, and probably will never run as well as it can on Android. A recent test app I&#8217;ve been playing with runs 50% faster on a Droid Eris, vs. the iPhone 3GS &#8211; the Eris is slower hardware, running Android 2.1. It&#8217;s also crashy, and is missing features like streaming movie support (it does work with videos embedded in a swf) &#8211; and touch events are not quite as streamlined as they are on a real Android device (hover works better on Android for example, and hot spots are easier to hit). It&#8217;s also got all the quirks of the Wii and desktop Flash Player&#8217;s &#8220;noscale&#8221; feature (on Android there is a workaround that solves this, not implemented in Frash yet).</p>
<p>I just like to point that out, because some users are judging the viability of Flash on iOS/iPhone/iPad based on this hack (which is current at version 0.02), which is beyond silly.</p>
<p>For anyone interested, I followed <a href="http://digitaldj.net/2010/08/06/flash-for-iphone-4-yes-frash-0-02/">these instructions</a> to install it on my iPhone. Note: this uses SSH and dpkg to install. If you don&#8217;t know how to reverse that, you may want to find an apt repo and use Cydia to grab this, so you can uninstall Frash when you are done playing, as it can be quite unstable.</p>
<div class="feedflare">
<a href="http://feeds.unfocus.com/~ff/unfocus/projects?a=Cwudy1Nuy_c:UYif01kKsoA:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/unfocus/projects?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.unfocus.com/~ff/unfocus/projects?a=Cwudy1Nuy_c:UYif01kKsoA:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/unfocus/projects?i=Cwudy1Nuy_c:UYif01kKsoA:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.unfocus.com/~ff/unfocus/projects?a=Cwudy1Nuy_c:UYif01kKsoA:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/unfocus/projects?i=Cwudy1Nuy_c:UYif01kKsoA:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.unfocus.com/~ff/unfocus/projects?a=Cwudy1Nuy_c:UYif01kKsoA:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/unfocus/projects?i=Cwudy1Nuy_c:UYif01kKsoA:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/unfocus/projects/~4/Cwudy1Nuy_c" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.unfocus.com/2010/08/11/frash-shows-flash-on-iphone-can-be-great-with-screenshots/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.unfocus.com/2010/08/11/frash-shows-flash-on-iphone-can-be-great-with-screenshots/</feedburner:origLink></item>
		<item>
		<title>Including Page Templates from a WordPress Plugin</title>
		<link>http://feeds.unfocus.com/~r/unfocus/projects/~3/y26oITzXHgs/</link>
		<comments>http://www.unfocus.com/2010/08/10/including-page-templates-from-a-wordpress-plugin/#comments</comments>
		<pubDate>Tue, 10 Aug 2010 23:38:41 +0000</pubDate>
		<dc:creator>Kenneth Newman</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Wordpress Plugins]]></category>
		<category><![CDATA[Custom Post Types]]></category>
		<category><![CDATA[Plugin Theme Templates]]></category>
		<category><![CDATA[WordPress Taxonomies]]></category>

		<guid isPermaLink="false">http://www.unfocus.com/?p=481</guid>
		<description><![CDATA[Recently, It occurred to me while writing a plugin dealing with custom post types and taxonomies for WordPress that it&#8217;d be nice to have some custom templates to go along with it. I seemed onerous to ask the the user &#8230; <a href="http://www.unfocus.com/2010/08/10/including-page-templates-from-a-wordpress-plugin/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Recently, It occurred to me while writing a plugin dealing with custom post types and taxonomies for WordPress that it&#8217;d be nice to have some custom templates to go along with it. I seemed onerous to ask the the user to add template tags to their theme to be able to display a better page then what WordPress displays by default. So I set out to make the plugin include the template pages from the plugin directory itself. The code below is derived directly from the WordPress source code, which means it&#8217;s GPL, so feel free to use it in your GPL licensed projects.</p>
<p>So the first thing I needed to figured out was what functions needed to be filtered to let me add the plugin directory to the locations that WordPress checks for. I eventually found the appropriate ones by reading the source code and asking in the #wordpress IRC chat (<em>not</em> #wordpress-dev, that&#8217;d be the wrong chat to ask this kind of question). &#8220;get_single_template()&#8221; and &#8220;get_taxonomy_template()&#8221; are the functions of interest and they in turn call &#8220;locate_template()&#8221; which is the function we need to rewrite.</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">function</span> locate_plugin_template<span style="color: #009900;">&#40;</span><span style="color: #000088;">$template_names</span><span style="color: #339933;">,</span> <span style="color: #000088;">$load</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">,</span> <span style="color: #000088;">$require_once</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">true</span> <span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span><a href="http://www.php.net/is_array"><span style="color: #990000;">is_array</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$template_names</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #000088;">$located</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #000088;">$this_plugin_dir</span> <span style="color: #339933;">=</span> WP_PLUGIN_DIR<span style="color: #339933;">.</span><span style="color: #0000ff;">'/'</span><span style="color: #339933;">.</span><a href="http://www.php.net/str_replace"><span style="color: #990000;">str_replace</span></a><span style="color: #009900;">&#40;</span> <a href="http://www.php.net/basename"><span style="color: #990000;">basename</span></a><span style="color: #009900;">&#40;</span> <span style="color: #009900; font-weight: bold;">__FILE__</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">,</span> plugin_basename<span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">__FILE__</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$template_names</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$template_name</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span><span style="color: #000088;">$template_name</span> <span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">continue</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <a href="http://www.php.net/file_exists"><span style="color: #990000;">file_exists</span></a><span style="color: #009900;">&#40;</span>STYLESHEETPATH <span style="color: #339933;">.</span> <span style="color: #0000ff;">'/'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$template_name</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$located</span> <span style="color: #339933;">=</span> STYLESHEETPATH <span style="color: #339933;">.</span> <span style="color: #0000ff;">'/'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$template_name</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <a href="http://www.php.net/file_exists"><span style="color: #990000;">file_exists</span></a><span style="color: #009900;">&#40;</span>TEMPLATEPATH <span style="color: #339933;">.</span> <span style="color: #0000ff;">'/'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$template_name</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$located</span> <span style="color: #339933;">=</span> TEMPLATEPATH <span style="color: #339933;">.</span> <span style="color: #0000ff;">'/'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$template_name</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <a href="http://www.php.net/file_exists"><span style="color: #990000;">file_exists</span></a><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$this_plugin_dir</span> <span style="color: #339933;">.</span> &nbsp;<span style="color: #000088;">$template_name</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$located</span> <span style="color: #339933;">=</span> &nbsp;<span style="color: #000088;">$this_plugin_dir</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$template_name</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$load</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #0000ff;">''</span> <span style="color: #339933;">!=</span> <span style="color: #000088;">$located</span> <span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; load_template<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$located</span><span style="color: #339933;">,</span> <span style="color: #000088;">$require_once</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #000088;">$located</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
<p>(reference: &#8216;<a href="http://core.trac.wordpress.org/browser/trunk/wp-includes/theme.php#L1044">function locate_template</a>&#8216;)</p>
<p>The &#8220;locate_plugin_template()&#8221; function is a direct copy of &#8220;locate_template&#8221; function but I added the $this_plugin_dir variable (using code I found on the wordpress.org forums) and added a 3rd check to the foreach loop. (Some of the code here can be removed, for example the $load check with the load_template() call, as our code won&#8217;t be invoking it but I left it to better reflect the source.)</p>
<p>Next we have to filter the appropriate functions to call our new function.</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">add_filter<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'taxonomy_template'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'get_custom_taxonomy_template'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
add_filter<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'single_template'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'get_custom_single_template'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></div>
<p>There&#8217;s not much in the original functions that need to be changed:</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">function</span> get_custom_taxonomy_template<span style="color: #009900;">&#40;</span><span style="color: #000088;">$template</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// Twenty Ten adds a 'pretty' link at the end of the excerpt. We don't need it for the taxonomy.</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; remove_filter<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'get_the_excerpt'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'twentyten_custom_excerpt_more'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; remove_filter<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'get_the_excerpt'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'twentyten_auto_excerpt_more'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #000088;">$taxonomy</span> <span style="color: #339933;">=</span> get_query_var<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'taxonomy'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'custom_taxonomy_name'</span> <span style="color: #339933;">==</span> <span style="color: #000088;">$taxonomy</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$term</span> <span style="color: #339933;">=</span> get_query_var<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'term'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$templates</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$taxonomy</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$term</span> <span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$templates</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;taxonomy-<span style="color: #006699; font-weight: bold;">$taxonomy</span>-<span style="color: #006699; font-weight: bold;">$term</span>.php&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$taxonomy</span> <span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$templates</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;taxonomy-<span style="color: #006699; font-weight: bold;">$taxonomy</span>.php&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$templates</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;taxonomy.php&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$template</span> <span style="color: #339933;">=</span> locate_plugin_template<span style="color: #009900;">&#40;</span><span style="color: #000088;">$templates</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// return apply_filters('taxonomy_template', $template);</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #000088;">$template</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
<p>(reference &#8216;<a href="http://core.trac.wordpress.org/browser/trunk/wp-includes/theme.php#L848">function get_taxonomy_template</a>&#8216;)</p>
<p>There&#8217;s some bonus remove_filter calls at the beginning and &#8216;locate_template&#8217; is replace by &#8216;locate_plugin_template&#8217;. The only other thing is that we simply return the $template variable instead of using &#8216;apply_filters&#8217; (I got errors when trying to apply the filter while running the filter filtering the filter :-/). There is also a check to see if we are working with our own taxonomy: The code in the if statement doesn&#8217;t really need to run again unless it&#8217;s one of our taxonomies, else it&#8217;ll just return the original $template.</p>
<p>The single template function filter is much the same:</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">function</span> get_custom_single_template<span style="color: #009900;">&#40;</span><span style="color: #000088;">$template</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$wp_query</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$object</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$wp_query</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get_queried_object</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'custom_post_type_name'</span> <span style="color: #339933;">==</span> <span style="color: #000088;">$object</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">post_type</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$templates</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'single-'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$object</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">post_type</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'.php'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'single.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$template</span> <span style="color: #339933;">=</span> locate_plugin_template<span style="color: #009900;">&#40;</span><span style="color: #000088;">$templates</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// return apply_filters('single_template', $template);</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #000088;">$template</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
<p>(reference &#8216;<a href="http://core.trac.wordpress.org/browser/trunk/wp-includes/theme.php#L974">function get_single_template</a>&#8216;)</p>
<p>Now, this isn&#8217;t a perfect solution. For example, themes have much varying structures, so building a template that&#8217;s compatible with Twenty Ten wouldn&#8217;t necessarily be compatible with any other theme. If the theme isn&#8217;t compatible, it could be bad since you&#8217;ve interrupted the fallback that the theme provides in favor of yours. You should probably include a check to see if the current theme is the theme you are targeting. I suggest you use this code in a plugin that is basically a companion plugin for your own theme or framework. Additionally, you could offer template tag functions, shortcodes, and widgets as a more robust solution.</p>
<div class="feedflare">
<a href="http://feeds.unfocus.com/~ff/unfocus/projects?a=y26oITzXHgs:XjikN3SvjT8:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/unfocus/projects?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.unfocus.com/~ff/unfocus/projects?a=y26oITzXHgs:XjikN3SvjT8:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/unfocus/projects?i=y26oITzXHgs:XjikN3SvjT8:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.unfocus.com/~ff/unfocus/projects?a=y26oITzXHgs:XjikN3SvjT8:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/unfocus/projects?i=y26oITzXHgs:XjikN3SvjT8:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.unfocus.com/~ff/unfocus/projects?a=y26oITzXHgs:XjikN3SvjT8:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/unfocus/projects?i=y26oITzXHgs:XjikN3SvjT8:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/unfocus/projects/~4/y26oITzXHgs" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.unfocus.com/2010/08/10/including-page-templates-from-a-wordpress-plugin/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://www.unfocus.com/2010/08/10/including-page-templates-from-a-wordpress-plugin/</feedburner:origLink></item>
		<item>
		<title>The Bunny (Video) Explodes. Explodes!</title>
		<link>http://feeds.unfocus.com/~r/unfocus/projects/~3/faLxlcWO-FU/</link>
		<comments>http://www.unfocus.com/2010/06/29/the-bunny-video-eplodes-explodes/#comments</comments>
		<pubDate>Tue, 29 Jun 2010 05:45:14 +0000</pubDate>
		<dc:creator>Kevin Newman</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Fun & Games]]></category>
		<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[GFX]]></category>

		<guid isPermaLink="false">http://www.unfocus.com/?p=452</guid>
		<description><![CDATA[UPDATE: I intended to post the source for this a long while ago (after cleaning it up), but I never got around to it. Here it is in it&#8217;s current state. I wanted to see how far I could push &#8230; <a href="http://www.unfocus.com/2010/06/29/the-bunny-video-eplodes-explodes/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><strong>UPDATE:</strong> I intended to post the source for this a long while ago (after cleaning it up), but I never got around to it. <a href="http://www.unfocus.com/PixelExploder/PixelExploder02.zip">Here it is in it&#8217;s current state</a>.</p>
<p>I wanted to see how far I could push that exploding Actionscript 3.0 code &#8211; see if Flash could handle updating each animating pixel every frame, while playing a video, then blurring it. Sure enough, it can! It did take further optimization from the version I posted the other day &#8211; including swapping copyPixels with getPixel/setPixel, and removing an anonymous function call (wow that was expensive!). Here it is:</p>
<p><object style="width: 590px; height: 480px;" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="590" height="480" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="menu" value="false" /><param name="quality" value="high" /><param name="scale" value="noscale" /><param name="wmode" value="window" /><param name="base" value="http://www.unfocus.com/PixelExploder/" /><param name="src" value="http://www.unfocus.com/PixelExploder/BigBunny.swf" /><param name="bgcolor" value="#000000" /><embed style="width: 590px; height: 480px;" type="application/x-shockwave-flash" width="590" height="480" src="http://www.unfocus.com/PixelExploder/BigBunny.swf" bgcolor="#000000" base="http://www.unfocus.com/PixelExploder/" wmode="window" scale="noscale" quality="high" menu="false"></embed></object></p>
<p>Note: This <strong>WILL</strong> run like slush on the debug player. I don&#8217;t know why. If anyone knows why, please let me know!</p>
<div class="feedflare">
<a href="http://feeds.unfocus.com/~ff/unfocus/projects?a=faLxlcWO-FU:-HjzpalC7Dk:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/unfocus/projects?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.unfocus.com/~ff/unfocus/projects?a=faLxlcWO-FU:-HjzpalC7Dk:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/unfocus/projects?i=faLxlcWO-FU:-HjzpalC7Dk:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.unfocus.com/~ff/unfocus/projects?a=faLxlcWO-FU:-HjzpalC7Dk:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/unfocus/projects?i=faLxlcWO-FU:-HjzpalC7Dk:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.unfocus.com/~ff/unfocus/projects?a=faLxlcWO-FU:-HjzpalC7Dk:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/unfocus/projects?i=faLxlcWO-FU:-HjzpalC7Dk:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/unfocus/projects/~4/faLxlcWO-FU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.unfocus.com/2010/06/29/the-bunny-video-eplodes-explodes/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.unfocus.com/2010/06/29/the-bunny-video-eplodes-explodes/</feedburner:origLink></item>
		<item>
		<title>The Pixels Explode. Explode!</title>
		<link>http://feeds.unfocus.com/~r/unfocus/projects/~3/SS_d81fxdFc/</link>
		<comments>http://www.unfocus.com/2010/06/23/the-pixels-explode-explode/#comments</comments>
		<pubDate>Thu, 24 Jun 2010 04:22:25 +0000</pubDate>
		<dc:creator>Kevin Newman</dc:creator>
				<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[GFX]]></category>

		<guid isPermaLink="false">http://www.unfocus.com/?p=428</guid>
		<description><![CDATA[Update: I posted a follow up an exploding video! Well I guess technically the pixels don&#8217;t explode as much as the DisplayObject explodes into pixels! I recently needed an effect that would make a bitmap image look sparkley, so I &#8230; <a href="http://www.unfocus.com/2010/06/23/the-pixels-explode-explode/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><strong>Update:</strong> I posted a follow up an <a href="http://www.unfocus.com/2010/06/29/the-bunny-video-eplodes-explodes/">exploding video</a>!</p>
<p>Well I guess technically the pixels don&#8217;t explode as much as the DisplayObject explodes into pixels! I recently needed an effect that would make a bitmap image look sparkley, so I did some goggling, and game across a Firefly particle effect on a blog post belonging to <a href="http://www.erikhallander.com/blog/2008/bitmapvector-into-firefly-particles-as30.html">Erik Hallander</a> (at least I think so, the blog has been down for months, so I can&#8217;t double check). This pretty impressive effect looks like the following example (I hope reposting it here is not a problem).</p>
<p><object style="width: 400px; height: 400px;" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="400" height="400" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="menu" value="false" /><param name="quality" value="autohigh" /><param name="scale" value="noscale" /><param name="wmode" value="window" /><param name="src" value="http://www.unfocus.com/PixelExploder/fireflies.swf" /><embed style="width: 400px; height: 400px;" type="application/x-shockwave-flash" width="400" height="400" src="http://www.unfocus.com/PixelExploder/fireflies.swf" wmode="window" scale="noscale" quality="autohigh" menu="false"></embed></object></p>
<p>Note: This is a modified version of the original adding the Stats.as box, and autolooping &#8211; and removes the actual firefly affect (I didn&#8217;t need that part for my purposes).</p>
<p>Very nice start! I don&#8217;t get an FPS problem &#8211; on my computer the example above rocks 62/60 fps (25% CPU on my Core 2 Duo)! So FPS was not the big problem. This example uses over ~19-23MB of RAM (with a lot of fluctuation)! And that is with 2&#215;2 pixels, it goes up higher with 1&#215;1 pixels. Additionally, this example already has an optimization in it to skip over empty (black) pixels in the DisplayObject it works on &#8211; which leads to a significant RAM savings.</p>
<p>Using the display list this way &#8211; and two filters per DisplayObject &#8211; it began causing the player to kick up a lot of invalid BitmapData/null reference errors (which I&#8217;m guessing is what happens when you run out of memory, since many many checks confirmed that the BitmapData was not invalid) &#8211; especially when I tried to make it work on 1&#215;1 pixels to animate every pixel.</p>
<p>So the first thing I did was to clean up some of the obvious stuff, to bring down the memory usage &#8211; in the original blog post, Erik noted that this was unoptimized code, so I knew what I was getting into. I did things like remove the extra nested DisplayObjects (each pixel was a subclasses Sprite instance, with a BitmapData added to it), and cleaned up extra variables that were laying around, moved a lot of things inline, reused as many variables as I could, cutting down on object instantiation &#8211; and followed a lot of the other tips in a conveniently timed <a href="http://www.bytearray.org/?p=1363">ByteArray post</a>. Doing that really helped &#8211; I cut the memory use about in half &#8211; and on the initial animation (a black and white logo) the affect seemed worked quite well. But it didn&#8217;t scale well &#8211; larger images simply wouldn&#8217;t work.</p>
<p>I still wanted to use this affect, and I&#8217;ve seen many thousands of pixels being animated before &#8211; so I knew it was possible. So a radical departure. I&#8217;ve been reading about drawing directly to Bitmaps for quite a while, and that was going to be my path. So more optimizations &#8211; removed the display list code completely, changed the Pixel class to a simply property class (where are the enums?!), and used that to store information about where in the original source to look for the pixel data as well as other relevant animation data (most of which was already done for me &#8211; thanks!) for each pixel block. I also removed dependence on TweenMax &#8211; which is what the original uses for all the animations &#8211; and used the easing equations directly, within an ENTER_FRAME event.</p>
<p>The result is a RAM reduction by 25% and a steadier memory usage, coming in at ~5MB with 4x as many pixels (and roughly the same amount of CPU). The changes utilize copyPixels and a linked list, with an <a href="http://gotoandlearn.com/play.php?id=63">accumulation buffer like effect</a> &#8211; for a total of 3 bitmaps (the original, which is rendered from the DisplayObject and stored, the scattered one the pixels get copied into, and the copy of that that gets blurred by the BlurFilter &#8211; a hidden memory cost illuminated by Thibault Imbert).</p>
<p><object style="width: 400px; height: 400px;" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="400" height="400" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="menu" value="false" /><param name="quality" value="autohigh" /><param name="scale" value="noscale" /><param name="wmode" value="window" /><param name="src" value="http://www.unfocus.com/PixelExploder/Explode.swf" /><embed style="width: 400px; height: 400px;" type="application/x-shockwave-flash" width="400" height="400" src="http://www.unfocus.com/PixelExploder/Explode.swf" wmode="window" scale="noscale" quality="autohigh" menu="false"></embed></object></p>
<p>There are further optimizations that can be used as well (and should really be used for full image per pixel animations) &#8211; such as writing to an opaque BitmapData, rather than one with Alpha, and reducing the BlurFilter quality &#8211; getting a better handle on type marshaling, etc. It might also be faster to store the RGB value of each pixel, and draw those directly instead of using copyPixels, but I haven&#8217;t tried that yet.</p>
<p>I got so much help from the Flash community on this, that it would be irresponsible not to share this back, so feel free to check out the <a href="http://www.unfocus.com/PixelExploder/PixelExploder.zip">source</a>.</p>
<p><strong>Some Notes:</strong></p>
<p>The memory usage applies to both swfs on this page &#8211; so you can&#8217;t see the memory usage difference in these examples. I quoted the standalone Flash Player in this post.</p>
<p>Also, I&#8217;m getting some kind of performance problem in plugin browsers (everything except IE) on Windows, and on every browser on mac but Firefox which is limiting both of these to around 30FPS. I have no idea what&#8217;s causing it.</p>
<p>On the code quality &#8211; the code isn&#8217;t all that messy IMHO, but it is not well documented, and a lot of the configuration hooks I left in are not really being utilized in a decent API &#8211; I may refactor at some point to clean that up. There is also a limitation of the skip pixel check that will keep it from working well for greater than 1&#215;1 pixel size (since it only checks the top left corner of the size rect).</p>
<p>Enjoy!</p>
<div class="feedflare">
<a href="http://feeds.unfocus.com/~ff/unfocus/projects?a=SS_d81fxdFc:AsnOzu8JW90:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/unfocus/projects?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.unfocus.com/~ff/unfocus/projects?a=SS_d81fxdFc:AsnOzu8JW90:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/unfocus/projects?i=SS_d81fxdFc:AsnOzu8JW90:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.unfocus.com/~ff/unfocus/projects?a=SS_d81fxdFc:AsnOzu8JW90:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/unfocus/projects?i=SS_d81fxdFc:AsnOzu8JW90:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.unfocus.com/~ff/unfocus/projects?a=SS_d81fxdFc:AsnOzu8JW90:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/unfocus/projects?i=SS_d81fxdFc:AsnOzu8JW90:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/unfocus/projects/~4/SS_d81fxdFc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.unfocus.com/2010/06/23/the-pixels-explode-explode/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.unfocus.com/2010/06/23/the-pixels-explode-explode/</feedburner:origLink></item>
		<item>
		<title>I’m totally signing up for Final Fantasy XIV beta</title>
		<link>http://feeds.unfocus.com/~r/unfocus/projects/~3/QqjUQZim354/</link>
		<comments>http://www.unfocus.com/2010/04/07/im-totally-signing-up-for-final-fantasy-xiv-beta/#comments</comments>
		<pubDate>Thu, 08 Apr 2010 04:01:27 +0000</pubDate>
		<dc:creator>Kevin Newman</dc:creator>
				<category><![CDATA[Fun & Games]]></category>

		<guid isPermaLink="false">http://www.unfocus.com/?p=409</guid>
		<description><![CDATA[I&#8217;m totally signing up for Final Fantasy XIV. It seems to say I need a fan site. Does this count? BTW, Final Fantasy XIII is wicked cool.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m totally signing up for Final Fantasy XIV. It seems to say I need a fan site. Does this count? <img src='http://www.unfocus.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':-D' class='wp-smiley' />  BTW, Final Fantasy XIII is wicked cool.</p>
<div class="feedflare">
<a href="http://feeds.unfocus.com/~ff/unfocus/projects?a=QqjUQZim354:JhFGrDPsb_A:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/unfocus/projects?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.unfocus.com/~ff/unfocus/projects?a=QqjUQZim354:JhFGrDPsb_A:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/unfocus/projects?i=QqjUQZim354:JhFGrDPsb_A:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.unfocus.com/~ff/unfocus/projects?a=QqjUQZim354:JhFGrDPsb_A:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/unfocus/projects?i=QqjUQZim354:JhFGrDPsb_A:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.unfocus.com/~ff/unfocus/projects?a=QqjUQZim354:JhFGrDPsb_A:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/unfocus/projects?i=QqjUQZim354:JhFGrDPsb_A:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/unfocus/projects/~4/QqjUQZim354" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.unfocus.com/2010/04/07/im-totally-signing-up-for-final-fantasy-xiv-beta/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.unfocus.com/2010/04/07/im-totally-signing-up-for-final-fantasy-xiv-beta/</feedburner:origLink></item>
		<item>
		<title>Update Theme</title>
		<link>http://feeds.unfocus.com/~r/unfocus/projects/~3/et5SGD0rCeU/</link>
		<comments>http://www.unfocus.com/2010/03/11/update-theme/#comments</comments>
		<pubDate>Thu, 11 Mar 2010 21:35:09 +0000</pubDate>
		<dc:creator>Kevin Newman</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.unfocus.com/?p=405</guid>
		<description><![CDATA[Just a quick note. The old theme (iNove) was creating extra history entries for some reason when you came to unfocus.com. I have no idea why, but that theme is now history. This new theme (iCandy 1.4 by Nischal Maniar) &#8230; <a href="http://www.unfocus.com/2010/03/11/update-theme/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Just a quick note. The old theme (iNove) was creating extra history entries for some reason when you came to unfocus.com. I have no idea why, but that theme is now history. This new theme (iCandy 1.4 by Nischal Maniar) fixes the problem and looks nicer anyway. <img src='http://www.unfocus.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<div class="feedflare">
<a href="http://feeds.unfocus.com/~ff/unfocus/projects?a=et5SGD0rCeU:aN9BVN4mszs:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/unfocus/projects?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.unfocus.com/~ff/unfocus/projects?a=et5SGD0rCeU:aN9BVN4mszs:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/unfocus/projects?i=et5SGD0rCeU:aN9BVN4mszs:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.unfocus.com/~ff/unfocus/projects?a=et5SGD0rCeU:aN9BVN4mszs:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/unfocus/projects?i=et5SGD0rCeU:aN9BVN4mszs:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.unfocus.com/~ff/unfocus/projects?a=et5SGD0rCeU:aN9BVN4mszs:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/unfocus/projects?i=et5SGD0rCeU:aN9BVN4mszs:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/unfocus/projects/~4/et5SGD0rCeU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.unfocus.com/2010/03/11/update-theme/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.unfocus.com/2010/03/11/update-theme/</feedburner:origLink></item>
		<item>
		<title>3D Gaming is Awesome!</title>
		<link>http://feeds.unfocus.com/~r/unfocus/projects/~3/Zk6zkj0GAv4/</link>
		<comments>http://www.unfocus.com/2010/01/07/3d-gaming-is-awesome/#comments</comments>
		<pubDate>Thu, 07 Jan 2010 18:53:10 +0000</pubDate>
		<dc:creator>Kevin Newman</dc:creator>
				<category><![CDATA[Fun & Games]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[3d]]></category>
		<category><![CDATA[3d vision]]></category>
		<category><![CDATA[iZ3D]]></category>
		<category><![CDATA[nVidia]]></category>
		<category><![CDATA[Video Games]]></category>

		<guid isPermaLink="false">http://www.unfocus.com/?p=380</guid>
		<description><![CDATA[After I watched Avatar in 3D, I became curious about PC gaming in 3D. So I did some research on the subject. There are three kinds of home 3D solutions on the market today (and a few more in theaters); &#8230; <a href="http://www.unfocus.com/2010/01/07/3d-gaming-is-awesome/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>After I watched Avatar in 3D, I became curious about PC gaming in 3D. So I did some research on the subject. There are three kinds of home 3D solutions on the market today (and a few more in theaters); active shutter glasses, and polarized LCD monitors are the two full color technologies. Each have their advantages and drawbacks, which I may blog about in more detail in the future (if you want more info, I suggest reading the <a href="http://www.xbitlabs.com/articles/multimedia/display/nvidia-gf-3d-vision.html">xbit labs reviews</a> of the various technologies).</p>
<p>I wanted to try to find a solution that did not require the layout of hundreds of dollars just to test out how well (or not) the 3D of these systems actually worked, so I wondered if there was a way to test these out, with minimal cost &#8211; sure enough, both available 3D graphics drivers support anaglyph mode to preview the tech. The third option anaglyph &#8211; you may remember this trick from super bowl half time commercials, and cereal box addins. First up is nVidia&#8217;s solution is slightly </p>
<p>For <a href="http://www.nvidia.com/object/3D_Vision_Overview.html">nVidia 3D Vision Discover</a>, you&#8217;ll need to make sure you have a beefy enough nVidia video card &#8211; ATi users are out of luck. As luck would have it, I have <a title="nVidia 3D Vision Requirements" href="http://www.nvidia.com/object/3D_Vision_Requirements.html">a supported card</a>, an 8800GT (the lowest end card supported!). To turn it on, follow the instructions on <a href="http://www.nvidia.com/object/3D_Vision_Discover_driver_setup.html">nVidia&#8217;s 3D Vision Setup page</a>. Make sure you have both the correct version of display drivers, and the 3D Vision drivers.</p>
<p>If you don&#8217;t have the correct glasses colors (as I didn&#8217;t &#8211; I used magenta/green glasses backwards from Monster&#8217;s Vs. Aliens DVD &#8211; eventually I replaced one lense with a red one from a children&#8217;s spy kit I got from Friendly&#8217;s) it may be a little tricky to enable the affect in nVidida&#8217;s drivers if you don&#8217;t have the correct colored glasses, since they don&#8217;t actually let you turn it on without testing you first. Just guess at what the answers are and press back if you get it wrong &#8211; there are not that many combinations of answers, and you&#8217;ll eventually get it right.  Once you do that, you&#8217;ll have an option to turn this all on in the Stereoscopic 3D section of your NVIDIA Control Panel (right click desktop to get there), or use the CTRL + T shortcut to turn it on.</p>
<p>The nVidia drivers work amazingly well on Valve Source engine based games &#8211; like Left 4 Dead and Team Fortress 2. In some parts of Left 4 Dead 2, such as the sugar cane fields on the return trip level of Heavy Rain, it may even give you a bit of an advantage, since you can see the depth of the plants &#8211; it&#8217;s much easier to see where you are going. They did less well in older UT3 engine based games, like Bioshock, where you can see noticeable gaps around some objects where the fog effects just don&#8217;t line up correctly in both eyes (it&#8217;s shifted to the right or left, for each eye respectively), and certain shadows are lost. Newer UT3 games, like Batman .. Arkham Asylum, which claims out of the box support for nVidia 3D Vision, and Avatar, which has 3D support that must be enabled in game, look phenomenal. (For Avatar you need to set nVidia stereoscopic view on in the driver first and then the game to get it to work). Other Ubisoft games like Assassin&#8217;s Creed and Prince of Persia also look great.</p>
<p>Another option is to use the iZ3D 3D drivers &#8211; which work with any 3D card, including ATi Radeon. iZ3D sells a line of specialized monitors that actually polarize two images (similar to how many 3D movie screens work), and use passive glasses to filter out each image from the correct eye, thus presenting two different images to each eye. You don&#8217;t need a 3D monitor to use the drivers though, as they have a free anaglyph mode built in (among other modes). These drivers seem to incur a greater performance hit than the nVidia glasses &#8211; but despite many posts (seemingly little more than assumptions) I&#8217;ve found on forums and blog posts, I actually found them more compatible than nVidia&#8217;s drivers, especially in Bioshock, which is downright amazing in 3D (despite missing many shadows). These drivers don&#8217;t start out with the modest 3D settings as the nVidia&#8217;s more out of the box settings, but once you tweak these (there are more options for tweaking, and each game starts out with a tweaking guide overlay to help you out), you should be up and running.</p>
<p>The best part of the iZ3D drivers is that you can actually change the color settings of the anaglyph mode (apparently you used to be able to do that for nVidia, but they removed that ability). This is fantastic, because it means you can get all the colors, with less ghosting that you&#8217;d miss if you don&#8217;t use the correct glasses with the nVidia drivers. Most anaglyphs actually separate 3 colors, not just two &#8211; one channel (red) to one eye and the other two channels (green + blue = cyan) to the other. In my case, I am using green and magenta (blue + red). The fact that blue is being split to the wrong eye is why you get ghosting with the nvidia drivers and the Monsters Vs. Aliens (or Coraline) glasses.</p>
<p>Here&#8217;s a quick guide to change the anaglyph colors for iZ3D drivers. First find the correct config file &#8211; for me (Windows 7) it was:</p>
<blockquote><p>C:UsersAll UsersiZ3D Driver</p></blockquote>
<p>I can&#8217;t confirm these two, but they helped me find the location in Windows 7 - <a href="http://forum.iz3d.com/viewtopic.php?t=1668">from the iZ3D forums</a>:</p>
<blockquote><p>XP: “Documents and SettingsAll UsersApplication DataiZ3D DriverLanguage”</p>
<p>Vista: “ProgramDataiZ3D DriverLanguage”</p></blockquote>
<p>Once you have opened the Config.xml file in one of those folders, you can edit the following items to make it green/magenta:</p>
<div class="codecolorer-container xml default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;anaglyphoutput<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> <br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;customleftmatrix</span> <span style="color: #000066;">m00</span>=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #000066;">m01</span>=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #000066;">m02</span>=<span style="color: #ff0000;">&quot;0&quot;</span> </span><br />
<span style="color: #009900;"><span style="color: #000066;">m10</span>=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #000066;">m11</span>=<span style="color: #ff0000;">&quot;1&quot;</span> <span style="color: #000066;">m12</span>=<span style="color: #ff0000;">&quot;0&quot;</span> </span><br />
<span style="color: #009900;"><span style="color: #000066;">m20</span>=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #000066;">m21</span>=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #000066;">m22</span>=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span> <br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;customrightmatrix</span> <span style="color: #000066;">m00</span>=<span style="color: #ff0000;">&quot;1&quot;</span> <span style="color: #000066;">m01</span>=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #000066;">m02</span>=<span style="color: #ff0000;">&quot;0&quot;</span> </span><br />
<span style="color: #009900;"><span style="color: #000066;">m10</span>=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #000066;">m11</span>=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #000066;">m12</span>=<span style="color: #ff0000;">&quot;0&quot;</span> </span><br />
<span style="color: #009900;"><span style="color: #000066;">m20</span>=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #000066;">m21</span>=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #000066;">m22</span>=<span style="color: #ff0000;">&quot;1&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span> <br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/anaglyphoutput<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></div>
<p>In case you are interested, here is a quick key for what these values actually mean &#8211; or at least 3 of them &#8211; it&#8217;s matrix math which is hard <img src='http://www.unfocus.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> :</p>
<blockquote><p>m00=&#8221;<strong style="color:red">R</strong>&#8221; m01=&#8221;0&#8243; m02=&#8221;0&#8243;<br />
m10=&#8221;0&#8243; m11=&#8221;<strong style="color:green">G</strong>&#8221; m12=&#8221;0&#8243;<br />
m20=&#8221;0&#8243; m21=&#8221;0&#8243; m22=&#8221;<strong style="color:blue">B</strong>&#8220;</p></blockquote>
<p>There are bugs and drawbacks with each solution &#8211; most games were not made with 3D in mind, so this can be a bit of a hack. Some games are missing shadows or have misaligned affects (like Bioshock), and I couldn&#8217;t get OpenGL games to work at all with either driver (despite settings for it in iZ3D). Other games seem to perform flawlessly (like Left 4 Dead, Batman or Avatar). Another big drawback of these systems is the cost &#8211; full color 3D setups can be pretty expensive $300-$400 for the monitor, and another $200 for the glasses (and an additional $150 for each pair you want to add for group movie watching). The iZ3D solution (and Zalman makes a compatible monitor) are getting cheaper, but are still quite pricey at around $300 for the monitor and cheaper passive glasses (with no other special requirements/costs, except some kind of reasonably strong video card).</p>
<p>The affect is pretty convincing for me though, and since I already have a nice 120Hz monitor, and a decent enough graphics card, I&#8217;ll be adding nVidia Shutter glasses to my birthday list. <img src='http://www.unfocus.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<div class="feedflare">
<a href="http://feeds.unfocus.com/~ff/unfocus/projects?a=Zk6zkj0GAv4:oHe0GJneFi8:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/unfocus/projects?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.unfocus.com/~ff/unfocus/projects?a=Zk6zkj0GAv4:oHe0GJneFi8:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/unfocus/projects?i=Zk6zkj0GAv4:oHe0GJneFi8:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.unfocus.com/~ff/unfocus/projects?a=Zk6zkj0GAv4:oHe0GJneFi8:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/unfocus/projects?i=Zk6zkj0GAv4:oHe0GJneFi8:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.unfocus.com/~ff/unfocus/projects?a=Zk6zkj0GAv4:oHe0GJneFi8:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/unfocus/projects?i=Zk6zkj0GAv4:oHe0GJneFi8:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/unfocus/projects/~4/Zk6zkj0GAv4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.unfocus.com/2010/01/07/3d-gaming-is-awesome/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		<feedburner:origLink>http://www.unfocus.com/2010/01/07/3d-gaming-is-awesome/</feedburner:origLink></item>
	</channel>
</rss><!-- Dynamic page generated in 2.847 seconds. --><!-- Cached page generated by WP-Super-Cache on 2012-05-31 10:41:15 -->

