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

<channel>
	<title>JADBOX: Web Application Musings &#187; Flash/Flex/AIR</title>
	<atom:link href="http://www.jadbox.com/category/flashflex/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jadbox.com</link>
	<description>Programming, Visualization and Game Development Theory</description>
	<lastBuildDate>Mon, 16 Jan 2012 01:15:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Flash 11 &#8211; UDK and Unity arrive</title>
		<link>http://www.jadbox.com/2011/10/flash-11-udk-and-unity-arrive/</link>
		<comments>http://www.jadbox.com/2011/10/flash-11-udk-and-unity-arrive/#comments</comments>
		<pubDate>Sun, 23 Oct 2011 23:53:23 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Flash/Flex/AIR]]></category>
		<category><![CDATA[Game Development]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.jadbox.com/?p=1445</guid>
		<description><![CDATA[With the advent of HTML5/WEBGL gaining popularity, Adobe knew it had to move fast. Within a matter of two years, they designed and implemented one of the largest platform updates I&#8217;ve seen in the industry- Flash Player 11. It sports direct GPU integration allowing for console quality games to be possible through the browser. If [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><img class="aligncenter size-full wp-image-1447" title="flash-11" src="http://www.jadbox.com/wp-content/uploads/flash-1.jpg" alt="" width="512" height="222" /></p>
<p>With the advent of HTML5/WEBGL gaining popularity, Adobe knew it had to move fast. Within a matter of two years, they designed and implemented one of the largest platform updates I&#8217;ve seen in the industry- Flash Player 11. It sports direct GPU integration allowing for console quality games to be possible through the browser. If this wasn&#8217;t big enough news, they have been working with Unity and UDK to enable an export format from those [now] game tooling platforms. Below is a video of the Unreal Engine 3 running within the browser:</p>
<p><iframe width="560" height="315" src="http://www.youtube.com/embed/UQiUP2Hd60Y" frameborder="0" allowfullscreen="">Loading video&#8230;</iframe></p>
<p>I&#8217;ll be spending the next couple weeks writing my own engine for Flash 11 and will update here when I have something working. The new API is not as easy compared to the standard display list or even Papervision for that matter, however it allows you almost total control over the GPU shader pipeline. While ActionScript 3 (AS3) can get the job done, I wonder how long before the haXe community starts implementing the new version. I&#8217;m super excited to experience such a radical new set of tools for game development!</p>
<p><strong>Related external articles: </strong><br />
<a href="http://www.epicgames.com/news/unreal-engine-3-supports-adobe-flash/">http://www.epicgames.com/news/unreal-engine-3-supports-adobe-flash/<br />
</a><a href="http://blogs.unity3d.com/2011/02/27/unity-flash-3d-on-the-web/">http://blogs.unity3d.com/2011/02/27/unity-flash-3d-on-the-web/</a><a href="http://www.epicgames.com/news/unreal-engine-3-supports-adobe-flash/"> </a></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jadbox.com/2011/10/flash-11-udk-and-unity-arrive/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JAD Update: Social Games</title>
		<link>http://www.jadbox.com/2011/04/jad-update-social-games/</link>
		<comments>http://www.jadbox.com/2011/04/jad-update-social-games/#comments</comments>
		<pubDate>Wed, 06 Apr 2011 19:22:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Flash/Flex/AIR]]></category>
		<category><![CDATA[Game Development]]></category>
		<category><![CDATA[Lifestyle]]></category>
		<category><![CDATA[Showcase]]></category>

		<guid isPermaLink="false">http://www.jadbox.com/?p=1411</guid>
		<description><![CDATA[I&#8217;ve decided that I&#8217;ve neglected my blog long enough and decided it was time for an update. Here we go *long breath*&#8230;. Within just the past couple years, I&#8217;ve moved from Michigan to San Francisco and have been working primary in building mobile and Facebook social games that have given rise in the gaming industry. I did [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-1417" title="jad" src="http://www.jadbox.com/wp-content/uploads/jad.jpg" alt="" width="288" height="384" />I&#8217;ve decided that I&#8217;ve neglected my blog long enough and decided it was time for an update. Here we go *long breath*&#8230;. Within just the past couple years, I&#8217;ve moved from Michigan to San Francisco and have been working primary in building mobile and Facebook social games that have given rise in the gaming industry. I did a number of projects at <a href="http://www.crowdstar.com/">Crowdstar</a> including Hello City and Mighty Pirates, and now I&#8217;m working on the largest project yet in my career at a newer startup called <a href="http://metamoki.com/">Metamoki</a> (created by <a href="http://metamoki.com/about/">Dave Maestri</a>, founder of <a href="http://apps.facebook.com/mobwars/?mw_ref=website">Mafia Wars</a>). The game development industry in Silicon Valley is rather interesting on a couple of facets. In some ways, it&#8217;s repeating the game design that originated back in the DOS and Commodore days. On the other hand, there are mechanics that are new and &#8216;alien&#8217; in nature. Of course I am referring to the &#8220;social&#8221; aspect of Facebook games. In some FB games, the meaning of social is almost laughable as it doesn&#8217;t really exist. Even the best games in the industry still do not compare to the social aspect of co-op gaming that is rather prevent now in modern commercial games. Recently, big names in the traditional gaming industry are starting their own studios in hopes of breaking into the market. It will be very interesting to see what happens within the next two years.</p>
<p>Aside from the industry as a whole, I&#8217;ve been busy writing my own isometric engine, data structures, tooling, and learning other languages to support my day-to-day work. As soon as I think I&#8217;ve built the fastest possible system, I always find one more way to make the performance that much faster. I&#8217;ve also come to understand computer science more on a fundamental level beyond languages. It really helps to know what is happening behind the scenes when using language core libraries&#8230; just because a language provides a core function doesn&#8217;t mean you should use it! I have written a great deal of code that basically does what Flash already provides, but the level of performance can reach an average of 2-10x improvement (which helps significantly). I&#8217;ve also been following the methodologies of SOLID &lt;<a href="http://en.wikipedia.org/wiki/Solid_(object-oriented_design)">http://en.wikipedia.org/wiki/Solid_(object-oriented_design)</a>&gt; and being mindful of these principles really improves the rate in which I can iterate game concepts and cuts down time to complete maintenance tasks.</p>
<p>I&#8217;ll finally wrap-up and show off the last two games I&#8217;ve developed at my previous work with <a href="http://www.crowdstar.com/">Crowdstar</a>:</p>
<p><img class="alignnone size-full wp-image-1414" title="hellocity_sh" src="http://www.jadbox.com/wp-content/uploads/hellocity_sh.jpg" alt="" width="648" height="345" /></p>
<p>&nbsp;</p>
<p><img class="alignnone size-full wp-image-1413" title="pirates_scr" src="http://www.jadbox.com/wp-content/uploads/pirates_scr.png" alt="" width="606" height="510" /></p>
<p><strong>Visit the games below:</strong></p>
<div class="alignleft"><a href="http://apps.facebook.com/hello-city"><img title="hellocity" src="http://www.jadbox.com/wp-content/uploads/hellocity-251x300.png" alt="" width="251" height="300" /></a><br />
<a href="http://apps.facebook.com/hello-city">http://</a><a href="http://apps.facebook.com/hello-city">apps.facebook.com/hello-city</a></div>
<div class="alignleft">&#8230;</div>
<div class="alignleft"><a href="http://apps.facebook.com/mighty-pirates"><img class="alignnone size-medium wp-image-1416" title="pirates" src="http://www.jadbox.com/wp-content/uploads/pirates-251x300.png" alt="" width="251" height="300" /></a><br />
<a href="http://apps.facebook.com/mighty-pirates">http://apps.facebook.com/mighty-pirates</a></div>
<div id="_mcePaste" class="mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="font-family: Arial, sans-serif; font-size: 12px; line-height: 18px;"><strong style="outline-width: 0px; outline-style: initial; outline-color: initial; font-size: 12px; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; background-position: initial initial; background-repeat: initial initial; padding: 0px; margin: 0px; border: 0px initial initial;">Maestri</strong></span></div>
]]></content:encoded>
			<wfw:commentRss>http://www.jadbox.com/2011/04/jad-update-social-games/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flash component oriented programming</title>
		<link>http://www.jadbox.com/2010/11/flash-component-oriented-programming/</link>
		<comments>http://www.jadbox.com/2010/11/flash-component-oriented-programming/#comments</comments>
		<pubDate>Thu, 11 Nov 2010 02:47:35 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Flash/Flex/AIR]]></category>
		<category><![CDATA[Game Development]]></category>

		<guid isPermaLink="false">http://www.jadbox.com/?p=1399</guid>
		<description><![CDATA[In this article, the author is a bit half-crazed&#8230; bantering that OOP is dead in light of entity/component systems. However, if you can get past that, it&#8217;s a good read on the benefits of composing game objects using only composition (instead of complex inheritance): http://t-machine.org/index.php/2007/09/03/entity-systems-are-the-future-of-mmog-development-part-1/ An example approach to implement an entity system might be [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright" title="AS3 components" src="http://t3.gstatic.com/images?q=tbn:ANd9GcQIpynKrGWGtyyZtOKPmoYY4n4tbhQcTvotOL-Bu-nxh6cdR_k&amp;t=1&amp;h=167&amp;w=223&amp;usg=__B1uAtYhi1zZp85K_KW_Lp3aONfs=" alt="" width="223" height="167" />In this article, the author is a bit half-crazed&#8230; bantering that OOP is dead in light of entity/component systems. However, if you can get past that, it&#8217;s a good read on the benefits of composing game objects using only composition (instead of complex inheritance):<br />
<a href="http://t-machine.org/index.php/2007/09/03/entity-systems-are-the-future-of-mmog-development-part-1/">http://t-machine.org/index.php/2007/09/03/entity-systems-are-the-future-of-mmog-development-part-1/</a></p>
<p><strong>An example approach to implement an entity system might be as follows:</strong></p>
<div class="codecolorer-container actionscript3 twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="actionscript3 codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #339966; font-weight: bold;">function</span> example<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span><br />
<span style="color: #009900; font-style: italic;">// find game entities by tags or what components it has.</span><br />
<span style="color: #6699cc; font-weight: bold;">var</span> entity<span style="color: #000066; font-weight: bold;">:</span>Entity = Entity<span style="color: #000066; font-weight: bold;">.</span>getEntity<span style="color: #000000;">&#40;</span>Tags<span style="color: #000066; font-weight: bold;">.</span>SPACE_SHIP<span style="color: #000066; font-weight: bold;">,</span> Tags<span style="color: #000066; font-weight: bold;">.</span>USER_OWNED<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
entity<span style="color: #000066; font-weight: bold;">.</span>health<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">.</span>current<span style="color: #000066; font-weight: bold;">--;</span><br />
entity<span style="color: #000066; font-weight: bold;">.</span>health<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">reset</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span> <span style="color: #009900; font-style: italic;">//or entity.health().saveToServer();</span><br />
entity<span style="color: #000066; font-weight: bold;">.</span>mc<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">x</span> = <span style="color: #000000; font-weight:bold;">10</span><span style="color: #000066; font-weight: bold;">;</span><br />
entity<span style="color: #000066; font-weight: bold;">.</span>tooltip<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span> <span style="color: #009900; font-style: italic;">// setup a tooltip on this entity.</span><br />
<span style="color: #000000;">&#125;</span></div></div>
<div class="codecolorer-container actionscript3 twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="actionscript3 codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #9900cc; font-weight: bold;">class</span> Entity <span style="color: #000000;">&#123;</span> <span style="color: #009900; font-style: italic;">//Contains getters to all game components (this class could be subclassed)</span><br />
<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> has<span style="color: #000000;">&#40;</span><span style="color: #000066; font-weight: bold;">...</span>args<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=boolean%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:boolean.html"><span style="color: #004993;">Boolean</span></a> <span style="color: #000000;">&#123;</span> <span style="color: #000066; font-weight: bold;">...</span> <span style="color: #000000;">&#125;</span> <span style="color: #009900; font-style: italic;">//args are either Tags or component class references</span><br />
<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> tag<span style="color: #000000;">&#40;</span><span style="color: #004993;">name</span><span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=string%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:string.html"><span style="color: #004993;">String</span></a><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span> tags<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">push</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">name</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />
<span style="color: #0033ff; font-weight: bold;">public</span> static <span style="color: #339966; font-weight: bold;">function</span> getEntity<span style="color: #000000;">&#40;</span><span style="color: #000066; font-weight: bold;">...</span>args<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span>Entity <span style="color: #000000;">&#123;</span> <span style="color: #000066; font-weight: bold;">...</span> <span style="color: #000000;">&#125;</span> &nbsp;<span style="color: #009900; font-style: italic;">//args are either Tags or component class references</span><br />
<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> tags<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=array%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:array.html"><span style="color: #004993;">Array</span></a>=<span style="color: #000000;">&#91;</span><span style="color: #000000;">&#93;</span><span style="color: #000066; font-weight: bold;">;</span><br />
<br />
&nbsp;<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _tooltip<span style="color: #000066; font-weight: bold;">:</span>Tooltip<span style="color: #000066; font-weight: bold;">;</span><br />
<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> tooltip<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span>Tooltip <span style="color: #000000;">&#123;</span> <span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span>_tooltip<span style="color: #000000;">&#41;</span> <span style="color: #0033ff; font-weight: bold;">return</span> _tooltip<span style="color: #000066; font-weight: bold;">;</span> <span style="color: #0033ff; font-weight: bold;">else</span> <span style="color: #0033ff; font-weight: bold;">return</span> _tooltip = <span style="color: #0033ff; font-weight: bold;">new</span> Tooltip<span style="color: #000000;">&#40;</span><span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span> <span style="color: #000000;">&#125;</span> <span style="color: #009900; font-style: italic;">// could be getters</span><br />
<span style="color: #000066; font-weight: bold;">....</span><br />
<span style="color: #000000;">&#125;</span></div></div>
<div class="codecolorer-container actionscript3 twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="actionscript3 codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><a href="http://www.google.com/search?q=class%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:class.html"><span style="color: #004993;">Class</span></a> Tooltip <span style="color: #000000;">&#123;</span> <span style="color: #009900; font-style: italic;">// multi purpose tooltip class</span><br />
<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> Tooltip<span style="color: #000000;">&#40;</span>entity<span style="color: #000066; font-weight: bold;">:</span>Entity<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span><br />
<span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span>entity<span style="color: #000066; font-weight: bold;">.</span>has<span style="color: #000000;">&#40;</span>Tags<span style="color: #000066; font-weight: bold;">.</span>SPACE_SHIP<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> &nbsp;shipTip<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
<span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span>entity<span style="color: #000066; font-weight: bold;">.</span>has<span style="color: #000000;">&#40;</span>Tags<span style="color: #000066; font-weight: bold;">.</span>CHARACTER<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> &nbsp;pirateTip<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
<span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span>entity<span style="color: #000066; font-weight: bold;">.</span>has<span style="color: #000000;">&#40;</span><a href="http://www.google.com/search?q=movieclip%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:movieclip.html"><span style="color: #004993;">MovieClip</span></a><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> entity<span style="color: #000066; font-weight: bold;">.</span>mc<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span> tooltip_mc <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
<br />
<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> shipTip<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span> <span style="color: #000066; font-weight: bold;">...</span> <span style="color: #000000;">&#125;</span> <span style="color: #009900; font-style: italic;">// position and setup gfx</span><br />
<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> pirateTip<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span> <span style="color: #000066; font-weight: bold;">...</span> <span style="color: #000000;">&#125;</span> <span style="color: #009900; font-style: italic;">// position and setup gfx</span><br />
<span style="color: #000000;">&#125;</span></div></div>
<div class="codecolorer-container actionscript3 twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="actionscript3 codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #9900cc; font-weight: bold;">class</span> Tags <span style="color: #000000;">&#123;</span><br />
<span style="color: #0033ff; font-weight: bold;">public</span> static const SPACE_SHIP<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=string%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:string.html"><span style="color: #004993;">String</span></a>=<span style="color: #990000;">&quot;ship&quot;</span><span style="color: #000066; font-weight: bold;">;</span><br />
<span style="color: #0033ff; font-weight: bold;">public</span> static const USER_OWNED<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=string%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:string.html"><span style="color: #004993;">String</span></a> = <span style="color: #990000;">&quot;userShip&quot;</span><span style="color: #000066; font-weight: bold;">;</span><br />
<span style="color: #0033ff; font-weight: bold;">public</span> static const CHARACTER<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=string%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:string.html"><span style="color: #004993;">String</span></a> = <span style="color: #990000;">&quot;character&quot;</span><span style="color: #000066; font-weight: bold;">;</span><br />
<span style="color: #000000;">&#125;</span></div></div>
<p><strong>What are your thoughts? Can a pure entity system be implemented in AS3? Are entity systems worth pursuing in AS3 game development?</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jadbox.com/2010/11/flash-component-oriented-programming/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Now=new Year(2010)</title>
		<link>http://www.jadbox.com/2010/01/nownew-year2010/</link>
		<comments>http://www.jadbox.com/2010/01/nownew-year2010/#comments</comments>
		<pubDate>Mon, 04 Jan 2010 16:24:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Flash/Flex/AIR]]></category>
		<category><![CDATA[General Programming]]></category>
		<category><![CDATA[Lifestyle]]></category>

		<guid isPermaLink="false">http://www.jadbox.com/?p=1375</guid>
		<description><![CDATA[As the new decade begins, millions of people reflect on their situation and ponder how to proceed into the future. In many ways, 2009 was a game changer for the multimedia industry. We have seen Unity and the Unreal engine open to their doors to free indie developer licensing. This illustrates that corporations are realizing [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.jadbox.com/wp-content/uploads/2010/01/Happy_2010_by_MattTheSamurai.gif"><img class="alignleft size-full wp-image-1376" title="A new year 2010" src="http://www.jadbox.com/wp-content/uploads/2010/01/Happy_2010_by_MattTheSamurai.gif" alt="" width="150" height="150" /></a>As the new decade begins, millions of people reflect on their situation and ponder how to proceed into the future. In many ways, 2009 was a game changer for the multimedia industry. We have seen Unity and the Unreal engine open to their doors to free indie developer licensing. This illustrates that corporations are realizing that even a great multimedia software infrastructure can be shoved aside for lesser alternatives that however have the strong community around its platform.<br />
We have seen also a greater focus on one language compiling to multiple platforms. Adobe is pushing for Flash to compile natively to the iPhone and pushing the Flash player to all other mobile devices. Unity also aims for compiling to PC, Mac, and iPhone with little changes needed to the source. Microsoft continues to push XNA that has the boon of both PC and XBOX360 support. Of course, haXe continues to gain in popularity as it is a single language that translates into other platforms (Flash,  PHP, Neko, and C++ SDL).</p>
<p>Over at <a href="http://www.as3dp.com/2010/01/02/actionscript-3-0-design-patterns-new-years-resolution/">Bill Sander&#8217;s blog AS3 Design Patterns</a>, he talks about his journey into design patterns and that his New Year resolution is &#8220;Improve nailing down relationships between classes in design patterns.&#8221; This year I have expanded my knowledge of design patterns in areas that I do not normally require in my everyday work, but just learning their existence has given me the enlightenment of not just how the design pattern works but &#8216;why&#8217; it exists and what would happen to a system built without it.</p>
<p>My personal development New Year&#8217;s resolution is: &#8220;Learning to prototype quickly while keeping modular using loose coupling.&#8221; Being able to produce a skeleton of a system quickly helps to a keep the momentum of a project going and to isolate design flaws. However, rapid development can cause a system to be become stagnate and locked into a certain implementation. However, wise programming decisions like using the <a href="http://www.as3dp.com/2008/09/19/no-new-is-good-new-using-inheritance-composition-delegation-and-anything-else-other-than-new-in-actionscript-30-design-patterns/">acquaintance relationship</a> between classes and employing design patterns like <em>strategy</em> or <em>template</em> will make my prototypes open enough to evolve into the final product without infrastructure rewrites.</p>
<p><em>Update: While technically the new decade starts in 2011, I find the debate mute as people will refer to this era as the &#8220;2010&#8242;s</em>&#8220;.</p>
<p><span id="more-1375"></span><span style="color: #808080;"><em>Image (c) to mattthesamurai.deviantart.com</em></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jadbox.com/2010/01/nownew-year2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adobe MAX09 Aftermath</title>
		<link>http://www.jadbox.com/2009/10/adobe-max09-aftermath/</link>
		<comments>http://www.jadbox.com/2009/10/adobe-max09-aftermath/#comments</comments>
		<pubDate>Thu, 15 Oct 2009 15:00:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Flash/Flex/AIR]]></category>

		<guid isPermaLink="false">http://www.jadbox.com/?p=1355</guid>
		<description><![CDATA[Overall, what we learned at Adobe Max this year was really nothing different than what we already knew months ago almost. Granted, finding out that Flash CS5 can export iPhone apps (perhaps they bundle the player and the flash file together?) was pretty neat- it was not really unexpected. Every cell phone will be getting [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-1356" title="max09_640x360_vasava" src="http://www.jadbox.com/wp-content/uploads/2009/10/max09_640x360_vasava.jpg" alt="max09_640x360_vasava" width="570" height="320" /></p>
<p>Overall, what we learned at Adobe Max this year was really nothing different than what we already knew months ago almost. Granted, finding out that Flash CS5 can export iPhone apps (perhaps they bundle the player and the flash file together?) was pretty neat- it was not really unexpected. Every cell phone will be getting Flash player soon (including the iPhone with the special export) which will really help increase the hold that Flash Player has on the market. However, there really wasn&#8217;t anything other than this announced that was worth getting excited over in my humble opinion. AIR 2.0 is coming out soon, but it&#8217;s roster of new features is rather lackluster for a new revision number- it should have been a patch number I believe.</p>
<p>On the flip side, the speakers and show setup were truly aweful. Speakers droned on as if they never bothered writing an outline for themselves, and I felt many &#8216;novelties&#8217; of the show were tacky (like the canned video of the iPhone app doing the wheel-of-fortune company picker). Even the jokes the speakers used to lighten the content fell so flat that it was as if they were in lue of another joke. Don&#8217;t get me wrong, I am definately an Adobe fan boy- I just felt that they put almost no effort into their presentation. Anyone else feel the same way?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jadbox.com/2009/10/adobe-max09-aftermath/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>haXe 2.04 &#8211; Surprises and Yawns</title>
		<link>http://www.jadbox.com/2009/07/haxe-2-04-surprises-and-yawns/</link>
		<comments>http://www.jadbox.com/2009/07/haxe-2-04-surprises-and-yawns/#comments</comments>
		<pubDate>Mon, 27 Jul 2009 17:44:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Flash/Flex/AIR]]></category>
		<category><![CDATA[General Programming]]></category>

		<guid isPermaLink="false">http://www.jadbox.com/?p=1316</guid>
		<description><![CDATA[Over the weekend, we finally had a new release of haXe made available, bringing the current version up to 2.04. The new version mostly is for resolving a slew of obscure bugs; however it also introduces early C++ translation support which is definitely something to keep an eye on. Now we just have to wait [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-1064" title="haxe_logo" src="http://www.jadbox.com/wp-content/uploads/2009/04/haxe_logo.gif" alt="haxe_logo" width="252" height="72" />Over the weekend, we finally had a new release of haXe made available, bringing the current version up to 2.04. The new version mostly is for resolving a slew of obscure bugs; however it also introduces early C++ translation support which is definitely something to keep an eye on. Now we just have to wait till Flash Develop supports the C++ language additions. For the people who have not looked into this language, it worth your time to at least check out as it&#8217;s one of the few mature mutliplatform languages available today.</p>
<p><strong><a href="http://haxe.org/">Haxe information and download</a></strong></p>
<p><strong>Update: </strong>Nicolas Cannasse has a simple example of a C++ compile on <a href="http://ncannasse.fr/blog/haxe_2.04">his blog</a>.<strong><br />
</strong></p>
<p><strong>Changes 2009-07-26: 2.04</strong></p>
<ul>
<li> flash9 : fixed get_full_path error with -D fdb</li>
<li> js : fixed Array.remove on IE</li>
<li> flash8 : removed extra empty AS3 tag (causing some issue with F8 loadMovie)</li>
<li> improved speed of Bytes unserializing (no need for BytesBuffer)</li>
<li> flash9 : bugfix, Null&lt;Typedef&gt; was generating dynamic code</li>
<li> flash9 : added error message in flash.Vector if used without flash 10</li>
<li> flash9 : fixed some &#8220;never&#8221; property access issues</li>
<li> all : added &#8220;never&#8221; property access support for all platforms</li>
<li> js : small syntax fix with value-blocks</li>
<li> js : fixed Type.enumEq with null values</li>
<li> js/flash8 : use &amp;0xFF in haxe.io.Bytes.set</li>
<li> flash9 : fixed switch on Null&lt;Int&gt; verify error</li>
<li> flash9 : fixes related to UInt type + error when using Int/UInt comparison</li>
<li> as3 : improved Vector support, inline flash.Lib.as</li>
<li> as3 : bugfix with skip_constructor</li>
<li> as3 : added Enum.__constructs__ (allow Type.getEnumConstructs)</li>
<li> as3 : make all constructor parameters optional (allow Type.createEmptyInstance)</li>
<li> as3 : bugfix with property access inside setter (stack overflow)</li>
<li> all : Enum is now Enum&lt;T&gt;</li>
<li> all : added Type.createEnumIndex</li>
<li> all : forbid same name for static+instance field (not supported on several platforms)</li>
<li> all : renamed haxe.Http.request to &#8220;requestUrl&#8221;</li>
<li> all : renamed neko.zip.Compress/Uncompress.run to &#8220;execute&#8221;</li>
<li> spod : fix very rare issue with relations and transactions</li>
<li> compiler : added TClosure &#8211; optimize closure creation and ease code generation</li>
<li> cpp : added CPP platform</li>
<li> all : added &#8216;using&#8217; syntax</li>
<li> neko : added &#8216;domains&#8217; optional param to ThreadRemotingServer to answer policy-file-request</li>
<li> php : fixed php.db.Mysql so that getResult is consistent with Neko behavior</li>
<li> php : fixed __toString for anonymouse objects</li>
<li> php : fixed bug in overridden dynamic functions</li>
<li> php : fixed round to be consistent with other platforms</li>
<li> php : fixed bug concatenating two dynamic variables</li>
<li> php : php.Lib.rethrow now works as expected</li>
<li> flash9 : fixed bug with SWC output and recursive types</li>
<li> flash8 : fixed inversed arguments in __new__</li>
<li> neko : added neko.net.Socket.setFastSend</li>
<li> php: fixed String.charCodeAt</li>
<li> php: minor optimization (removed foreach from std code)</li>
<li> php: implemented haxe.Stack</li>
<li> php: changed exception handler to use haXe call stack</li>
<li> php: changed special vars to use the » prefix instead of __</li>
<li> php: fixed use of reserved keywords for var names</li>
<li> php: List iterator is now class based (faster)</li>
<li> php: fixed behavior of class variables having assigned functions</li>
<li> php: fixed php.db.Manager (was uncorrectly removing superclass fields)</li>
<li> php: added support for native Iterator and IteratorAggregate interfaces</li>
<li> all : added &#8211;display classes and &#8211;display keywords</li>
<li> all : fixed issue with optional parameters in inline functions</li>
<li> all : allow implementing interfaces with inline methods</li>
<li> all : enable inlining for getter/setter/iterator/resolve/using</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.jadbox.com/2009/07/haxe-2-04-surprises-and-yawns/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>FlashMVC 2.0 Released!</title>
		<link>http://www.jadbox.com/2009/06/flashmvc-2-0-released/</link>
		<comments>http://www.jadbox.com/2009/06/flashmvc-2-0-released/#comments</comments>
		<pubDate>Mon, 15 Jun 2009 14:04:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Flash/Flex/AIR]]></category>
		<category><![CDATA[Showcase]]></category>

		<guid isPermaLink="false">http://www.jadbox.com/?p=1221</guid>
		<description><![CDATA[I am very pleased to announce a major update to FlashMVC to version 2.0 with its OWN website at www.flashmvc.com! This version is a complete rewrite of the original version with better attention to scalability and framework usage. Since this is a dramatic upgrade, I have changed the package name to com.jadbox.flashmvc2. This version scales [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flashmvc.com/" target="_blank"><img src="http://www.flashmvc.com/wp-content/uploads/2009/06/FlashMVCWhite.gif" alt="" /></a><br />
I am very pleased to announce a major update to <a href="http://www.flashmvc.com/">FlashMVC</a> to version 2.0 with its OWN website at <a href="http://www.flashmvc.com/">www.flashmvc.com</a>! This version is a <strong>complete</strong> rewrite of the original version with better attention to scalability and framework usage. Since this is a dramatic upgrade, I have changed the package name to com.jadbox.flashmvc2. This version scales much higher allowing actions to relay complex messages to the view and built-in code hinting system for the view to execute an action. This is done by a new class called SuperAction. Let me start with the basics:</p>
<ul>
<li>action classes &#8211; these are normal classes (do not need to extent any classes) that perform an action</li>
<li>SuperEvent &#8211; this class acts like a model for a specific action class, as a constructor proxy for the action class. and as an event for once the action completes.</li>
<li>SuperModel &#8211; This class holds references to SuperActions which, in turn, hold references to SuperEvents and your action classes.</li>
<li>SuperAction &#8211; This class is a controller proxy between your view and the action that it needs to perform. It allows the user to dispatch a SuperEvent that gets used as a model/constructor for your action class.</li>
</ul>
<p>Benefits from version 1.0:</p>
<ul>
<li>The action has its own model/view (SuperEvent) to inform the view
<ul>
<li>The SuperModel has fewer global variables as actions have their own dedicated models</li>
</ul>
</li>
<li>The model (SuperEvent) also mocks the constructor of the action class for code hinting</li>
<li>Using the framework with Flash is the same exact flow you would use with Flex (or Flash Builder)</li>
<li>Much more readable code for applications made with the framework.</li>
<li>ActionHelper removed in place of SuperEvent</li>
<li>If an action doesn&#8217;t require a unique SuperModel, you can use the base class SuperEvent or make a SuperEvent that covers multiple action classes (less recommended).</li>
</ul>
<p>Example running an action:</p>
<div class="codecolorer-container actionscript3 twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="actionscript3 codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">SuperWebsite<span style="color: #000066; font-weight: bold;">.</span>instance<span style="color: #000066; font-weight: bold;">.</span>loginAction<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">dispatchEvent</span><span style="color: #000000;">&#40;</span><span style="color: #0033ff; font-weight: bold;">new</span> LoginEvent<span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;test@test.com));</span></div></div>
<p>Example reading an action:</p>
<div class="codecolorer-container actionscript3 twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="actionscript3 codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">SuperWebsite<span style="color: #000066; font-weight: bold;">.</span>instance<span style="color: #000066; font-weight: bold;">.</span>loginAction<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span>SuperEvent<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">COMPLETE</span><span style="color: #000066; font-weight: bold;">,</span> onComplete<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
<span style="color: #339966; font-weight: bold;">function</span> onComplete<span style="color: #000000;">&#40;</span>event<span style="color: #000066; font-weight: bold;">:</span>SuperLogin<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span> <span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span>event<span style="color: #000066; font-weight: bold;">.</span>isInvalidEmail<span style="color: #000000;">&#41;</span> <span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;email was invalid&quot;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><span style="color: #000066; font-weight: bold;">;</span></div></div>
<p><strong>Head over to <a href="http://www.flashmvc.com">www.flashmvc.com</a> and check it out!</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jadbox.com/2009/06/flashmvc-2-0-released/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>What&#8217;s New, Doc?</title>
		<link>http://www.jadbox.com/2009/05/whats-new-doc/</link>
		<comments>http://www.jadbox.com/2009/05/whats-new-doc/#comments</comments>
		<pubDate>Tue, 05 May 2009 15:20:26 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Artificial Intelligence (AI)]]></category>
		<category><![CDATA[Flash/Flex/AIR]]></category>
		<category><![CDATA[Showcase]]></category>

		<guid isPermaLink="false">http://www.jadbox.com/?p=1190</guid>
		<description><![CDATA[I have had some people asking me what I have been scheming lately which in honest hasn&#8217;t been much. The weather here in Michigan has been finally nice for a change so I have been spending most of my free time cycling. However, I did go out last weekend and finally bought the fabulous Gang [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><img class="size-medium wp-image-1192" title="design-patterns-book-cover" src="http://www.jadbox.com/wp-content/uploads/2009/05/design-patterns-book-cover-229x300.png" alt="design-patterns-book-cover" width="180" height="230" /><img class="size-full wp-image-1193" title="wacom-bamboo-fun-medium-tablet-cte650k-300" src="http://www.jadbox.com/wp-content/uploads/2009/05/wacom-bamboo-fun-medium-tablet-cte650k-300.gif" alt="wacom-bamboo-fun-medium-tablet-cte650k-300" width="232" height="219" /></p>
<p>I have had some people asking me what I have been scheming lately which in honest hasn&#8217;t been much. The weather here in Michigan has been finally nice for a change so I have been spending most of my free time cycling. However, I did go out last weekend and finally bought the fabulous Gang of Four book Design Patterns to add to my library. I know enough C++, JAVA, and Smalltalk to decipher the examples and apply it to whatever language I might be using these days (which has been lots of AS3, haXe, C#, and Unity3D).  I also decided to join the tablet bandwagon and added a Wacom Bamboo to my collection in hopes that it will inspire me to work on my art portfolio that I have been neglecting. The surface really feels (and sounds) like you are drawing on paper!</p>
<p>In the next coming weeks I will be working on <a href="http://www.jadbox.com/flashmvc">FlashMVC</a> to do some cleanup and perhaps add more examples to the repository.<br />
Lastly, I have been experimenting on AI development with local unit world data deresolution and querying. Such a system I am building will allow NPCs to explore large environments while meta tagging locations of interests for latter lookups. Usually this isn&#8217;t as complicated as the process I am developing, but I have to design something that is agile and performs well in the Flash player environment. I will blog more about this soon most likely.</p>
<p>O, and thank you to the people who came to my lecture on design patterns last week! I hope everyone was able to walk away with some practical knowledge to apply to their own projects. There is a good chance that I might continue this lecture in the future to dive deeper into a variety of AS3-applicable development pattens. The video camera we had in the room had some issues (we lost the second half of the lecture), but I hope to get the recording compressed and posted here soon.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jadbox.com/2009/05/whats-new-doc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Detroit Design Patterns Lecture pt. 2</title>
		<link>http://www.jadbox.com/2009/04/detroit-design-patterns-lecture-pt-2/</link>
		<comments>http://www.jadbox.com/2009/04/detroit-design-patterns-lecture-pt-2/#comments</comments>
		<pubDate>Mon, 27 Apr 2009 16:59:45 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Flash/Flex/AIR]]></category>
		<category><![CDATA[Showcase]]></category>

		<guid isPermaLink="false">http://www.jadbox.com/?p=1152</guid>
		<description><![CDATA[This Thursday, April 30th, I will be continuing my lecture on Actionscript design patterns and principles at the Detroit Adobe User&#8217;s Group meetup. See the first lecture post here for directions and time information. This week I will be covering different mainstream design patterns in detail and if we have time give a brief overview [...]]]></description>
			<content:encoded><![CDATA[<p>This Thursday, April 30th, I will be continuing my lecture on Actionscript design patterns and principles at the Detroit Adobe User&#8217;s Group meetup. See the <a href="http://www.jadbox.com/2009/03/my-adobe-users-group-seminar/" target="_self">first lecture post here</a> for directions and time information. This week I will be covering different mainstream design patterns in detail and if we have time give a brief overview of popular MVC frameworks that help accelerate application development. However, I do believe that teaching patterns and frameworks without knowing good object oriented principles is fruitless so I will also continue this topic discussion into the next portion of the lecture. </p>
<p>The conference is free to attend, and anyone from beginners to experts are welcome to join!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jadbox.com/2009/04/detroit-design-patterns-lecture-pt-2/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>FlashMVC Update: addResultListeners</title>
		<link>http://www.jadbox.com/2009/04/flashmvc-update-addresultlistener/</link>
		<comments>http://www.jadbox.com/2009/04/flashmvc-update-addresultlistener/#comments</comments>
		<pubDate>Tue, 07 Apr 2009 20:07:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Flash/Flex/AIR]]></category>
		<category><![CDATA[Showcase]]></category>
		<category><![CDATA[flashMVC]]></category>

		<guid isPermaLink="false">http://www.jadbox.com/?p=1090</guid>
		<description><![CDATA[I have just finished up making another addition to my framework FlashMVC. The update effectively removes the need to use ActionBinder as I will indicate below. ActionBinder was a neat utility, but ultimately I wanted solution that was just as simplistic but could be usable for both Flash and Flex. I couldn&#8217;t find any easy [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: right;"><a href="http://www.jadbox.com/flashmvc"><img class="size-full wp-image-745 alignright" title="flashmvc" src="http://www.jadbox.com/wp-content/uploads/2008/12/flashmvc.gif" alt="flashmvc" width="159" height="156" /></a></p>
<p>I have just finished up making another addition to my framework <a href="http://www.jadbox.com/flashmvc"><strong>FlashMVC</strong></a>. The update effectively removes the need to use ActionBinder as I will indicate below. ActionBinder was a neat utility, but ultimately I wanted solution that was just as simplistic but could be usable for both Flash and Flex. I couldn&#8217;t find any easy solutions until I thought about retrofitting addEventListener with an alternate form to allow callback functions to fire for specific commands on the SuperModel. Hence, I have added these three new methods to <strong>SuperModel</strong>:</p>
<p><strong>.addResultListeners</strong>(<em>actionName</em>:String, <em>onSuccess</em>:Function, <em>onFail</em>:Function)<br />
<strong>.addStatusListeners</strong>(<em>actionName</em>:String, <em>enabled</em>:Function, <em>disabled</em>:Function)<br />
<strong>.addHasActionListeners</strong>(<em>actionName</em>:String, <em>added</em>:Function, <em>removed</em>:Function)</p>
<p>Now in your view, you can do something like this in your view:</p>
<div class="codecolorer-container actionscript3 twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="actionscript3 codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #6699cc; font-weight: bold;">var</span> app<span style="color: #000066; font-weight: bold;">:</span>MySuperApplication = MySuperApplication<span style="color: #000066; font-weight: bold;">.</span>getInstance<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
app<span style="color: #000066; font-weight: bold;">.</span>addResultListeners<span style="color: #000000;">&#40;</span>MySuperApplication<span style="color: #000066; font-weight: bold;">.</span>Login<span style="color: #000066; font-weight: bold;">,</span> onSuccess<span style="color: #000066; font-weight: bold;">,</span> onFail<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
<span style="color: #009900; font-style: italic;">// SuperModel.perform(name of the action, optional onComplete function, ...Rest for the parameters of the action class)</span><br />
app<span style="color: #000066; font-weight: bold;">.</span>perform<span style="color: #000000;">&#40;</span>MySuperApplication<span style="color: #000066; font-weight: bold;">.</span>Login<span style="color: #000066; font-weight: bold;">,</span> <span style="color: #0033ff; font-weight: bold;">null</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #990000;">&quot;test@invalidemail@.com&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
<br />
<span style="color: #339966; font-weight: bold;">function</span> onSuccess<span style="color: #000000;">&#40;</span>result<span style="color: #000066; font-weight: bold;">:*</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp;<span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;Login was successful&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
<span style="color: #000000;">&#125;</span><br />
<span style="color: #339966; font-weight: bold;">function</span> onFail<span style="color: #000000;">&#40;</span>result<span style="color: #000066; font-weight: bold;">:*</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp;<span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span>result==MySuperApplication<span style="color: #000066; font-weight: bold;">.</span>RESULT_INVALID_EMAIL<span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;invalid email used&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
<span style="color: #000000;">&#125;</span></div></div>
<p><a href="http://www.jadbox.com/flashmvc_docs/">Updated ASDocs Here</a></p>
<p>Aside from this addition, I added in some safeguards like throwing an error if a command tries to call ActionHelper.complete() more than once as well as some other fixes. ActionBinder is still useful in the Flex world as it can help increase readability in some cases, but SuperModel now has most of the nice features built into it.</p>
<p>Please let me know if you have any comments! I am still working on adding in the replay feature to the framework which hopefully I will have done soon.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jadbox.com/2009/04/flashmvc-update-addresultlistener/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Further Reading on Design Patterns</title>
		<link>http://www.jadbox.com/2009/03/further-reading-on-design-patterns/</link>
		<comments>http://www.jadbox.com/2009/03/further-reading-on-design-patterns/#comments</comments>
		<pubDate>Sat, 28 Mar 2009 03:41:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Flash/Flex/AIR]]></category>
		<category><![CDATA[Game Development]]></category>
		<category><![CDATA[General Programming]]></category>
		<category><![CDATA[Lifestyle]]></category>
		<category><![CDATA[Showcase]]></category>

		<guid isPermaLink="false">http://www.jadbox.com/?p=1047</guid>
		<description><![CDATA[As a followup on my Wednesday lecture on design patterns, I wanted to post some informative resources for learning more about design patterns outside the next lecture on the topic. Also, I wanted to say thanks for everyone who showed up to hear me rant about code structure (not the most exciting topic in the [...]]]></description>
			<content:encoded><![CDATA[<p>As a followup on my Wednesday lecture on design patterns, I wanted to post some informative resources for learning more about design patterns outside the next lecture on the topic. Also, I wanted to say thanks for everyone who showed up to hear me rant about code structure (not the most exciting topic in the world mind you)!</p>
<p style="text-align: center;"><strong>Design Pattern Definition</strong><br />
<em>In software engineering, a design pattern is a general reusable solution to a commonly occurring problem in software design. A design pattern is not a finished design that can be transformed directly into code. It is a description or template for how to solve a problem that can be used in many different situations. Object-oriented design patterns typically show relationships and interactions between classes or objects, without specifying the final application classes or objects that are involved. </em><br />
- read more at <a href="http://en.wikipedia.org/wiki/Design_pattern_(computer_science)">WikiPedia</a></p>
<p style="text-align: center;"><strong>MVC </strong><strong>Definition </strong>(the most common principle of Design Patterns)<br />
<img class="aligncenter size-full wp-image-1049" title="graph" src="http://www.jadbox.com/wp-content/uploads/2009/03/mvc.gif" alt="mvc" width="346" height="312" /><br />
&#8220;<em>Model–View–Controller (MVC) is an architectural pattern used in software engineering. Successful use of the pattern isolates business logic from user interface considerations, resulting in an application where it is easier to modify either the visual appearance of the application or the underlying business rules without affecting the other. In MVC, the model represents the information (the data) of the application; the view corresponds to elements of the user interface such as text, checkbox items, and so forth; and the controller manages the communication of data and the business rules used to manipulate the data to and from the model.</em>&#8221;<br />
- read more at <a href="http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller">WikiPedia</a></p>
<p><strong>Books:</strong></p>
<ul>
<li><a href="http://www.amazon.com/Design-Patterns-Object-Oriented-Addison-Wesley-Professional/dp/0201633612/ref=pd_bbs_sr_1?ie=UTF8&amp;s=books&amp;qid=1238210502&amp;sr=8-1" target="_blank">Gang of Four&#8217;s original Design Patterns</a></li>
<li><a href="http://www.amazon.com/Advanced-ActionScript-3-Design-Patterns/dp/0321426568/ref=sr_1_2?ie=UTF8&amp;s=books&amp;qid=1238210569&amp;sr=1-2">Advanced ActionScript 3 with Design Patterns</a> (highly recommended)</li>
<li><a href="http://www.amazon.com/ActionScript-3-0-Design-Patterns-Programming/dp/0596528469/ref=sr_1_1?ie=UTF8&amp;s=books&amp;qid=1238210569&amp;sr=1-1">ActionScript 3.0 Design Patterns: Object Oriented Programming Techniques</a></li>
</ul>
<p><strong>AS3 Design Pattern Informational Websites:</strong></p>
<ul>
<li><a href="http://www.as3dp.com/category/principles/" target="_self">www.as3dp.com &#8211; ActionScript 3 Design Pattern Blog</a> (Principles Category)</li>
<li><a href="http://ntt.cc/category/programming/ria-flex/design-patterns">ntt.cc posts on of porting GoF design patterns to AS3</a></li>
</ul>
<p><strong>Flash Design Pattern Frameworks:</strong><br />
<em>(for now, it&#8217;s best to avoid these until you understand the fundamentals of MVC)</em></p>
<ul>
<li><a href="http://www.jadbox.com/flashmvc/">FlashMVC</a></li>
<li><a href="http://puremvc.org/">PureMVC</a></li>
<li><a href="http://opensource.adobe.com/wiki/display/cairngorm/Cairngorm">Cairngorm</a></li>
</ul>
<p><strong>Good Design Priniciples:</strong></p>
<ul>
<li>ALWAYS type your variables (not really design principle but I too often see people doing this still)</li>
<li>An object/MovieClip should contain the actions that it performs (as oppose to objects outside the class forcing it to perform actions)</li>
<li>A class should never be able to &#8220;break&#8221; if the user sets a property or calls a function on it when they are not suppose to. Keep preventive logic in the class that&#8217;s doing the work.</li>
<li>A good chosen design pattern for a problem will not take any longer to implement than not using it with spaghetti code.</li>
</ul>
<p>Feel free to leave comments or email me about any further questions you have about Design Patterns or where to find additional materials on it. Have a great weekend everyone!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jadbox.com/2009/03/further-reading-on-design-patterns/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Detroit Design Pattern Seminar</title>
		<link>http://www.jadbox.com/2009/03/my-adobe-users-group-seminar/</link>
		<comments>http://www.jadbox.com/2009/03/my-adobe-users-group-seminar/#comments</comments>
		<pubDate>Thu, 26 Mar 2009 04:24:45 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Flash/Flex/AIR]]></category>
		<category><![CDATA[Showcase]]></category>

		<guid isPermaLink="false">http://www.jadbox.com/?p=1024</guid>
		<description><![CDATA[On Thursday 3/26/2009, I will be giving an open seminar on design patterns for the Detroit Adobe User Group. I should have blogged about this much earlier but my free time has been spread thin of late unfortunately. It will be hosted at ePrize starting at 7:00pm and ending about 9:00pm. I will be covering [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><img class="size-full wp-image-1025 aligncenter" title="DAAUG" src="http://www.jadbox.com/wp-content/uploads/2009/03/2.jpg" alt="DAAUG" width="407" height="333" /></p>
<p>On Thursday 3/26/2009, I will be giving an open seminar on <em>design patterns</em> for the <a href="http://groups.adobe.com/groups/3a67effa9b/summary"><strong>Detroit Adobe User Group</strong></a>. I should have blogged about this much earlier but my free time has been spread thin of late unfortunately. It will be hosted at ePrize starting at 7:00pm and ending about 9:00pm. I will be covering just some introductory topics of good programming practices with AS3 while diving into some design pattern concepts. There is also a good chance that I will do a more advanced seminar on design patterns in the near future at the user group meetings. This conference will be free to the public so please leave a comment or shoot me an email for directions or more information.<br />
<strong>-[ </strong><a href="http://www.jadbox.com/about/">Jonathan_Dunlap</a>::email="jonathan AT jadbox.com"<strong> ]-</strong></p>
<p><iframe width="540" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps?oe=utf-8&amp;client=firefox-a&amp;ie=UTF8&amp;q=eprize+detroit,mi&amp;fb=1&amp;split=1&amp;gl=us&amp;cid=0,0,11218617017399383998&amp;ei=KgDLSenNHqnulQeBoLzqCQ&amp;source=embed&amp;ll=42.474851,-83.134918&amp;spn=0.005539,0.011587&amp;z=16&amp;iwloc=A&amp;output=embed"></iframe><br /><small><a href="http://maps.google.com/maps?oe=utf-8&amp;client=firefox-a&amp;ie=UTF8&amp;q=eprize+detroit,mi&amp;fb=1&amp;split=1&amp;gl=us&amp;cid=0,0,11218617017399383998&amp;ei=KgDLSenNHqnulQeBoLzqCQ&amp;source=embed&amp;ll=42.474851,-83.134918&amp;spn=0.005539,0.011587&amp;z=16&amp;iwloc=A" style="color:#0000FF;text-align:left">View Larger Map</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jadbox.com/2009/03/my-adobe-users-group-seminar/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>FlashMVC API Update</title>
		<link>http://www.jadbox.com/2009/02/flashmvc-api-update/</link>
		<comments>http://www.jadbox.com/2009/02/flashmvc-api-update/#comments</comments>
		<pubDate>Sat, 21 Feb 2009 22:42:13 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Flash/Flex/AIR]]></category>
		<category><![CDATA[Showcase]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[flashMVC]]></category>

		<guid isPermaLink="false">http://www.jadbox.com/?p=935</guid>
		<description><![CDATA[While having time this weekend to review a few of the Flash projects I&#8217;ve been working on, I became aware of the idea that every software &#8220;action&#8221; has the anticipated state of failing. Login will fail if the user enters incorrect credentials or leaves a field empty; A user cancels a file copy operation; A [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft" title="FlashMVC" src="http://www.jadbox.com/wp-content/uploads/2008/12/flashmvc1.gif" alt="" width="153" height="152" />While having time this weekend to review a few of the Flash projects I&#8217;ve been working on, I became aware of the idea that every software &#8220;action&#8221; has the anticipated state of failing. Login will fail if the user enters incorrect credentials or leaves a field empty; A user cancels a file copy operation; A reg form may fail if the user is not permitted to enter the site based off their information. It&#8217;s not that the application is failing because it can&#8217;t reach a web service or something unexpected happened, but rather a planned reaction was developed to give the user a negitive response to their action. In light of this, I have updated <a href="http://www.jadbox.com/flashmvc">FlashMVC</a> to allow actions to designate that it&#8217;s result is negitive/failed. Then on the SuperModel side, the view can optionally supply a fail callback function for when the action designates that it failed.</p>
<div class="codecolorer-container actionscript3 twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="actionscript3 codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900; font-style: italic;">// &nbsp;Action class</span><br />
<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> Login <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> Login<span style="color: #000000;">&#40;</span>helper<span style="color: #000066; font-weight: bold;">:</span>ActionHelper<span style="color: #000066; font-weight: bold;">,</span> <span style="color: #004993;">name</span><span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=string%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:string.html"><span style="color: #004993;">String</span></a><span style="color: #000066; font-weight: bold;">,</span> password<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=string%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:string.html"><span style="color: #004993;">String</span></a><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">name</span>==<span style="color: #990000;">&quot;user&quot;</span> <span style="color: #000066; font-weight: bold;">&amp;&amp;</span> password==<span style="color: #990000;">&quot;pw&quot;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SuperSimpleApp<span style="color: #000066; font-weight: bold;">.</span>getInstance<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">.</span>userFirstName = <span style="color: #990000;">&quot;John Doe&quot;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; helper<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">complete</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span> <span style="color: #0033ff; font-weight: bold;">else</span> <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">name</span>==<span style="color: #990000;">&quot;&quot;</span> <span style="color: #000066; font-weight: bold;">||</span> password==<span style="color: #990000;">&quot;&quot;</span><span style="color: #000000;">&#41;</span> helper<span style="color: #000066; font-weight: bold;">.</span>result = SuperSimpleApp<span style="color: #000066; font-weight: bold;">.</span>RESULT_EMPTY_FIELDS<span style="color: #000066; font-weight: bold;">;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; helper<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">complete</span><span style="color: #000000;">&#40;</span><span style="color: #0033ff; font-weight: bold;">false</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span> <span style="color: #009900; font-style: italic;">// &quot;false&quot; tells the caller that this was not successful</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
<span style="color: #000000;">&#125;</span></div></div>
<p>The line &#8220;helper.complete(false)&#8221; tells the SuperModel that the action completed but it was a negative response. In this example, it was failing the login action. So we have the action created, now we need to create the SuperModel that its attached to and the SuperModel will also service as its model.</p>
<div class="codecolorer-container actionscript3 twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="actionscript3 codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900; font-style: italic;">// SuperModel</span><br />
<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> SuperSimpleApp <span style="color: #0033ff; font-weight: bold;">extends</span> SuperModel <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">public</span> static const LOGIN<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=string%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:string.html"><span style="color: #004993;">String</span></a> = <span style="color: #990000;">&quot;Login&quot;</span><span style="color: #000066; font-weight: bold;">;</span> <span style="color: #009900; font-style: italic;">// String reference to the class name for the view to call</span><br />
&nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// Flag a response to use in special situations where the view needs to know more about the result</span><br />
&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">public</span> static const RESULT_EMPTY_FIELDS<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=string%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:string.html"><span style="color: #004993;">String</span></a> = <span style="color: #990000;">&quot;emptyFields&quot;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">var</span> userFirstName<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=string%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:string.html"><span style="color: #004993;">String</span></a><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> SuperSimpleApp<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// Register the class to the SuperModel for use.</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// Note: once the action is added, use the string name of the class to reference it</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; actionAdd<span style="color: #000000;">&#40;</span>Login<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span> <br />
&nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">public</span> static const getInstance<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span>SuperSimpleApp = <span style="color: #0033ff; font-weight: bold;">new</span> SuperSimpleApp<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span> <br />
<span style="color: #000000;">&#125;</span></div></div>
<p>Now in Flash or in your Flex MXML you can run your Login action like this:</p>
<div class="codecolorer-container actionscript3 twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="actionscript3 codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #6699cc; font-weight: bold;">var</span> superModel<span style="color: #000066; font-weight: bold;">:</span>SuperSimpleApp = SuperSimpleApp<span style="color: #000066; font-weight: bold;">.</span>getInstance<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
<span style="color: #009900; font-style: italic;">// loginAction will hold the action class we want to call and setup the onSuccess and onFail callbacks.</span><br />
<span style="color: #6699cc; font-weight: bold;">var</span> loginAction<span style="color: #000066; font-weight: bold;">:</span>Performance = <span style="color: #0033ff; font-weight: bold;">new</span> Performance<span style="color: #000000;">&#40;</span>SuperSimpleApp<span style="color: #000066; font-weight: bold;">.</span>LOGIN<span style="color: #000066; font-weight: bold;">,</span> onSuccess<span style="color: #000066; font-weight: bold;">,</span> onFail<span style="color: #000000;">&#41;</span><br />
<span style="color: #009900; font-style: italic;">// ...</span><br />
<span style="color: #009900; font-style: italic;">// Now later in the code, run the action now on the SuperModel with a test username and password</span><br />
<span style="color: #339966; font-weight: bold;">function</span> onSubmitButtonClick<span style="color: #000000;">&#40;</span>e<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=event%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:event.html"><span style="color: #004993;">Event</span></a><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; superModel<span style="color: #000066; font-weight: bold;">.</span>process<span style="color: #000000;">&#40;</span>loginAction<span style="color: #000066; font-weight: bold;">,</span> <span style="color: #990000;">&quot;user&quot;</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #990000;">&quot;pw&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
<span style="color: #000000;">&#125;</span><br />
<span style="color: #009900; font-style: italic;">// If the user is logged in successfully</span><br />
<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> onSuccess<span style="color: #000000;">&#40;</span>result<span style="color: #000066; font-weight: bold;">:*</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;Hello &quot;</span><span style="color: #000066; font-weight: bold;">+</span> superModel<span style="color: #000066; font-weight: bold;">.</span>userFirstName<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
<span style="color: #000000;">&#125;</span><br />
<span style="color: #009900; font-style: italic;">// If the login action designated a negative response to the request:</span><br />
<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> onFail<span style="color: #000000;">&#40;</span>result<span style="color: #000066; font-weight: bold;">:*</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// Check the result against known responses flagged in the super model... otherwise give generic message.</span><br />
&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span>result==SuperSimpleApp<span style="color: #000066; font-weight: bold;">.</span>RESULT_EMPTY_FIELDS<span style="color: #000000;">&#41;</span> <span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;Please fill out all fields&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">else</span> <span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;Invalid username or password&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
<span style="color: #000000;">&#125;</span></div></div>
<p>This should help having to deal with common success and fail responses from actions. Let me know what your thoughts are!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jadbox.com/2009/02/flashmvc-api-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

