<?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>Tue, 05 Jan 2010 15:28:32 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<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 [...]


Related posts:<ol><li><a href='http://www.jadbox.com/2009/03/further-reading-on-design-patterns/' rel='bookmark' title='Permanent Link: Further Reading on Design Patterns'>Further Reading on Design Patterns</a> <small>As a followup on my Wednesday lecture on design patterns,...</small></li>
<li><a href='http://www.jadbox.com/2009/04/detroit-design-patterns-lecture-pt-2/' rel='bookmark' title='Permanent Link: Detroit Design Patterns Lecture pt. 2'>Detroit Design Patterns Lecture pt. 2</a> <small>This Thursday, April 30th, I will be continuing my lecture...</small></li>
<li><a href='http://www.jadbox.com/2009/05/whats-new-doc/' rel='bookmark' title='Permanent Link: What&#8217;s New, Doc?'>What&#8217;s New, Doc?</a> <small> I have had some people asking me what I...</small></li>
</ol>]]></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&#8217;s</em>&#8220;.</p>
<p><span id="more-1375"></span><span style="color: #808080;"><em>Image (c) to mattthesamurai.deviantart.com</em></span></p>


<p>Related posts:<ol><li><a href='http://www.jadbox.com/2009/03/further-reading-on-design-patterns/' rel='bookmark' title='Permanent Link: Further Reading on Design Patterns'>Further Reading on Design Patterns</a> <small>As a followup on my Wednesday lecture on design patterns,...</small></li>
<li><a href='http://www.jadbox.com/2009/04/detroit-design-patterns-lecture-pt-2/' rel='bookmark' title='Permanent Link: Detroit Design Patterns Lecture pt. 2'>Detroit Design Patterns Lecture pt. 2</a> <small>This Thursday, April 30th, I will be continuing my lecture...</small></li>
<li><a href='http://www.jadbox.com/2009/05/whats-new-doc/' rel='bookmark' title='Permanent Link: What&#8217;s New, Doc?'>What&#8217;s New, Doc?</a> <small> I have had some people asking me what I...</small></li>
</ol></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 [...]


Related posts:<ol><li><a href='http://www.jadbox.com/2009/09/countdown-to-mobile-flash-player-10/' rel='bookmark' title='Permanent Link: Countdown to Mobile Flash Player 10'>Countdown to Mobile Flash Player 10</a> <small> Adobe announced that this years MAX event will be...</small></li>
<li><a href='http://www.jadbox.com/2009/06/why-html-5-is-not-a-flash-killer/' rel='bookmark' title='Permanent Link: Why HTML 5 is NOT a Flash killer'>Why HTML 5 is NOT a Flash killer</a> <small>The RSS feeds are abuzz lately about the new W3C...</small></li>
<li><a href='http://www.jadbox.com/2010/01/nownew-year2010/' rel='bookmark' title='Permanent Link: Now=new Year(2010)'>Now=new Year(2010)</a> <small>As the new decade begins, millions of people reflect on...</small></li>
</ol>]]></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>


<p>Related posts:<ol><li><a href='http://www.jadbox.com/2009/09/countdown-to-mobile-flash-player-10/' rel='bookmark' title='Permanent Link: Countdown to Mobile Flash Player 10'>Countdown to Mobile Flash Player 10</a> <small> Adobe announced that this years MAX event will be...</small></li>
<li><a href='http://www.jadbox.com/2009/06/why-html-5-is-not-a-flash-killer/' rel='bookmark' title='Permanent Link: Why HTML 5 is NOT a Flash killer'>Why HTML 5 is NOT a Flash killer</a> <small>The RSS feeds are abuzz lately about the new W3C...</small></li>
<li><a href='http://www.jadbox.com/2010/01/nownew-year2010/' rel='bookmark' title='Permanent Link: Now=new Year(2010)'>Now=new Year(2010)</a> <small>As the new decade begins, millions of people reflect on...</small></li>
</ol></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 [...]


Related posts:<ol><li><a href='http://www.jadbox.com/2009/04/haxe-vs-unity3d-vs-xna-vs-others/' rel='bookmark' title='Permanent Link: HaXe vs Unity3D vs XNA vs others'>HaXe vs Unity3D vs XNA vs others</a> <small>For the past couple months, I have been trying to...</small></li>
<li><a href='http://www.jadbox.com/2009/04/haxe-particles/' rel='bookmark' title='Permanent Link: haXe Particles'>haXe Particles</a> <small>I have been tinkering with haXe a bit more lately...</small></li>
<li><a href='http://www.jadbox.com/2009/08/round-2-haxe-vs-unity3d-vs-o3d-vs-sfml/' rel='bookmark' title='Permanent Link: Round 2: haXe vs Unity3D vs O3D vs SFML'>Round 2: haXe vs Unity3D vs O3D vs SFML</a> <small>The bell rings, and it&#8217;s another showdown between modern drawing...</small></li>
</ol>]]></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>


<p>Related posts:<ol><li><a href='http://www.jadbox.com/2009/04/haxe-vs-unity3d-vs-xna-vs-others/' rel='bookmark' title='Permanent Link: HaXe vs Unity3D vs XNA vs others'>HaXe vs Unity3D vs XNA vs others</a> <small>For the past couple months, I have been trying to...</small></li>
<li><a href='http://www.jadbox.com/2009/04/haxe-particles/' rel='bookmark' title='Permanent Link: haXe Particles'>haXe Particles</a> <small>I have been tinkering with haXe a bit more lately...</small></li>
<li><a href='http://www.jadbox.com/2009/08/round-2-haxe-vs-unity3d-vs-o3d-vs-sfml/' rel='bookmark' title='Permanent Link: Round 2: haXe vs Unity3D vs O3D vs SFML'>Round 2: haXe vs Unity3D vs O3D vs SFML</a> <small>The bell rings, and it&#8217;s another showdown between modern drawing...</small></li>
</ol></p>]]></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 [...]


Related posts:<ol><li><a href='http://www.jadbox.com/2009/07/flashmvc-201-update-released/' rel='bookmark' title='Permanent Link: FlashMVC 2.01 update released'>FlashMVC 2.01 update released</a> <small>Here are just a couple more enhancements to FlashMVC I...</small></li>
<li><a href='http://www.jadbox.com/2009/04/flashmvc-update-addresultlistener/' rel='bookmark' title='Permanent Link: FlashMVC Update: addResultListeners'>FlashMVC Update: addResultListeners</a> <small> I have just finished up making another addition to...</small></li>
</ol>]]></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="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="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>


<p>Related posts:<ol><li><a href='http://www.jadbox.com/2009/07/flashmvc-201-update-released/' rel='bookmark' title='Permanent Link: FlashMVC 2.01 update released'>FlashMVC 2.01 update released</a> <small>Here are just a couple more enhancements to FlashMVC I...</small></li>
<li><a href='http://www.jadbox.com/2009/04/flashmvc-update-addresultlistener/' rel='bookmark' title='Permanent Link: FlashMVC Update: addResultListeners'>FlashMVC Update: addResultListeners</a> <small> I have just finished up making another addition to...</small></li>
</ol></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 [...]


Related posts:<ol><li><a href='http://www.jadbox.com/2009/04/detroit-design-patterns-lecture-pt-2/' rel='bookmark' title='Permanent Link: Detroit Design Patterns Lecture pt. 2'>Detroit Design Patterns Lecture pt. 2</a> <small>This Thursday, April 30th, I will be continuing my lecture...</small></li>
<li><a href='http://www.jadbox.com/2009/03/further-reading-on-design-patterns/' rel='bookmark' title='Permanent Link: Further Reading on Design Patterns'>Further Reading on Design Patterns</a> <small>As a followup on my Wednesday lecture on design patterns,...</small></li>
<li><a href='http://www.jadbox.com/2010/01/nownew-year2010/' rel='bookmark' title='Permanent Link: Now=new Year(2010)'>Now=new Year(2010)</a> <small>As the new decade begins, millions of people reflect on...</small></li>
</ol>]]></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>


<p>Related posts:<ol><li><a href='http://www.jadbox.com/2009/04/detroit-design-patterns-lecture-pt-2/' rel='bookmark' title='Permanent Link: Detroit Design Patterns Lecture pt. 2'>Detroit Design Patterns Lecture pt. 2</a> <small>This Thursday, April 30th, I will be continuing my lecture...</small></li>
<li><a href='http://www.jadbox.com/2009/03/further-reading-on-design-patterns/' rel='bookmark' title='Permanent Link: Further Reading on Design Patterns'>Further Reading on Design Patterns</a> <small>As a followup on my Wednesday lecture on design patterns,...</small></li>
<li><a href='http://www.jadbox.com/2010/01/nownew-year2010/' rel='bookmark' title='Permanent Link: Now=new Year(2010)'>Now=new Year(2010)</a> <small>As the new decade begins, millions of people reflect on...</small></li>
</ol></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 [...]


Related posts:<ol><li><a href='http://www.jadbox.com/2009/03/further-reading-on-design-patterns/' rel='bookmark' title='Permanent Link: Further Reading on Design Patterns'>Further Reading on Design Patterns</a> <small>As a followup on my Wednesday lecture on design patterns,...</small></li>
<li><a href='http://www.jadbox.com/2009/03/my-adobe-users-group-seminar/' rel='bookmark' title='Permanent Link: Detroit Design Pattern Seminar'>Detroit Design Pattern Seminar</a> <small> On Thursday 3/26/2009, I will be giving an open...</small></li>
<li><a href='http://www.jadbox.com/2009/05/whats-new-doc/' rel='bookmark' title='Permanent Link: What&#8217;s New, Doc?'>What&#8217;s New, Doc?</a> <small> I have had some people asking me what I...</small></li>
</ol>]]></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>


<p>Related posts:<ol><li><a href='http://www.jadbox.com/2009/03/further-reading-on-design-patterns/' rel='bookmark' title='Permanent Link: Further Reading on Design Patterns'>Further Reading on Design Patterns</a> <small>As a followup on my Wednesday lecture on design patterns,...</small></li>
<li><a href='http://www.jadbox.com/2009/03/my-adobe-users-group-seminar/' rel='bookmark' title='Permanent Link: Detroit Design Pattern Seminar'>Detroit Design Pattern Seminar</a> <small> On Thursday 3/26/2009, I will be giving an open...</small></li>
<li><a href='http://www.jadbox.com/2009/05/whats-new-doc/' rel='bookmark' title='Permanent Link: What&#8217;s New, Doc?'>What&#8217;s New, Doc?</a> <small> I have had some people asking me what I...</small></li>
</ol></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 [...]


Related posts:<ol><li><a href='http://www.jadbox.com/2009/07/flashmvc-201-update-released/' rel='bookmark' title='Permanent Link: FlashMVC 2.01 update released'>FlashMVC 2.01 update released</a> <small>Here are just a couple more enhancements to FlashMVC I...</small></li>
<li><a href='http://www.jadbox.com/2009/06/flashmvc-2-0-released/' rel='bookmark' title='Permanent Link: FlashMVC 2.0 Released!'>FlashMVC 2.0 Released!</a> <small> I am very pleased to announce a major update...</small></li>
</ol>]]></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="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>


<p>Related posts:<ol><li><a href='http://www.jadbox.com/2009/07/flashmvc-201-update-released/' rel='bookmark' title='Permanent Link: FlashMVC 2.01 update released'>FlashMVC 2.01 update released</a> <small>Here are just a couple more enhancements to FlashMVC I...</small></li>
<li><a href='http://www.jadbox.com/2009/06/flashmvc-2-0-released/' rel='bookmark' title='Permanent Link: FlashMVC 2.0 Released!'>FlashMVC 2.0 Released!</a> <small> I am very pleased to announce a major update...</small></li>
</ol></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 [...]


Related posts:<ol><li><a href='http://www.jadbox.com/2009/04/detroit-design-patterns-lecture-pt-2/' rel='bookmark' title='Permanent Link: Detroit Design Patterns Lecture pt. 2'>Detroit Design Patterns Lecture pt. 2</a> <small>This Thursday, April 30th, I will be continuing my lecture...</small></li>
<li><a href='http://www.jadbox.com/2009/03/my-adobe-users-group-seminar/' rel='bookmark' title='Permanent Link: Detroit Design Pattern Seminar'>Detroit Design Pattern Seminar</a> <small> On Thursday 3/26/2009, I will be giving an open...</small></li>
<li><a href='http://www.jadbox.com/2010/01/nownew-year2010/' rel='bookmark' title='Permanent Link: Now=new Year(2010)'>Now=new Year(2010)</a> <small>As the new decade begins, millions of people reflect on...</small></li>
</ol>]]></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>


<p>Related posts:<ol><li><a href='http://www.jadbox.com/2009/04/detroit-design-patterns-lecture-pt-2/' rel='bookmark' title='Permanent Link: Detroit Design Patterns Lecture pt. 2'>Detroit Design Patterns Lecture pt. 2</a> <small>This Thursday, April 30th, I will be continuing my lecture...</small></li>
<li><a href='http://www.jadbox.com/2009/03/my-adobe-users-group-seminar/' rel='bookmark' title='Permanent Link: Detroit Design Pattern Seminar'>Detroit Design Pattern Seminar</a> <small> On Thursday 3/26/2009, I will be giving an open...</small></li>
<li><a href='http://www.jadbox.com/2010/01/nownew-year2010/' rel='bookmark' title='Permanent Link: Now=new Year(2010)'>Now=new Year(2010)</a> <small>As the new decade begins, millions of people reflect on...</small></li>
</ol></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 [...]


Related posts:<ol><li><a href='http://www.jadbox.com/2009/04/detroit-design-patterns-lecture-pt-2/' rel='bookmark' title='Permanent Link: Detroit Design Patterns Lecture pt. 2'>Detroit Design Patterns Lecture pt. 2</a> <small>This Thursday, April 30th, I will be continuing my lecture...</small></li>
<li><a href='http://www.jadbox.com/2009/03/further-reading-on-design-patterns/' rel='bookmark' title='Permanent Link: Further Reading on Design Patterns'>Further Reading on Design Patterns</a> <small>As a followup on my Wednesday lecture on design patterns,...</small></li>
<li><a href='http://www.jadbox.com/2009/05/whats-new-doc/' rel='bookmark' title='Permanent Link: What&#8217;s New, Doc?'>What&#8217;s New, Doc?</a> <small> I have had some people asking me what I...</small></li>
</ol>]]></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>


<p>Related posts:<ol><li><a href='http://www.jadbox.com/2009/04/detroit-design-patterns-lecture-pt-2/' rel='bookmark' title='Permanent Link: Detroit Design Patterns Lecture pt. 2'>Detroit Design Patterns Lecture pt. 2</a> <small>This Thursday, April 30th, I will be continuing my lecture...</small></li>
<li><a href='http://www.jadbox.com/2009/03/further-reading-on-design-patterns/' rel='bookmark' title='Permanent Link: Further Reading on Design Patterns'>Further Reading on Design Patterns</a> <small>As a followup on my Wednesday lecture on design patterns,...</small></li>
<li><a href='http://www.jadbox.com/2009/05/whats-new-doc/' rel='bookmark' title='Permanent Link: What&#8217;s New, Doc?'>What&#8217;s New, Doc?</a> <small> I have had some people asking me what I...</small></li>
</ol></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 [...]


Related posts:<ol><li><a href='http://www.jadbox.com/2009/04/flashmvc-update-addresultlistener/' rel='bookmark' title='Permanent Link: FlashMVC Update: addResultListeners'>FlashMVC Update: addResultListeners</a> <small> I have just finished up making another addition to...</small></li>
<li><a href='http://www.jadbox.com/2009/07/flashmvc-201-update-released/' rel='bookmark' title='Permanent Link: FlashMVC 2.01 update released'>FlashMVC 2.01 update released</a> <small>Here are just a couple more enhancements to FlashMVC I...</small></li>
<li><a href='http://www.jadbox.com/2009/06/flashmvc-2-0-released/' rel='bookmark' title='Permanent Link: FlashMVC 2.0 Released!'>FlashMVC 2.0 Released!</a> <small> I am very pleased to announce a major update...</small></li>
</ol>]]></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="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="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="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>


<p>Related posts:<ol><li><a href='http://www.jadbox.com/2009/04/flashmvc-update-addresultlistener/' rel='bookmark' title='Permanent Link: FlashMVC Update: addResultListeners'>FlashMVC Update: addResultListeners</a> <small> I have just finished up making another addition to...</small></li>
<li><a href='http://www.jadbox.com/2009/07/flashmvc-201-update-released/' rel='bookmark' title='Permanent Link: FlashMVC 2.01 update released'>FlashMVC 2.01 update released</a> <small>Here are just a couple more enhancements to FlashMVC I...</small></li>
<li><a href='http://www.jadbox.com/2009/06/flashmvc-2-0-released/' rel='bookmark' title='Permanent Link: FlashMVC 2.0 Released!'>FlashMVC 2.0 Released!</a> <small> I am very pleased to announce a major update...</small></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.jadbox.com/2009/02/flashmvc-api-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AS3 Best Practice for Callback Evals</title>
		<link>http://www.jadbox.com/2009/02/as3-optional-callback-method-warning/</link>
		<comments>http://www.jadbox.com/2009/02/as3-optional-callback-method-warning/#comments</comments>
		<pubDate>Sat, 14 Feb 2009 04:37:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Flash/Flex/AIR]]></category>
		<category><![CDATA[as3]]></category>

		<guid isPermaLink="false">http://www.jadbox.com/?p=882</guid>
		<description><![CDATA[
UPDATED: Thanks to my readers- there is an even easier way to evaluate a function as being not null without a compiler warning. One suggested a method using a type check (functionName is Function) however this is process intensive task for the compiler especially if this has to be done within a game loop. I [...]


Related posts:<ol><li><a href='http://www.jadbox.com/2009/07/haxe-2-04-surprises-and-yawns/' rel='bookmark' title='Permanent Link: haXe 2.04 &#8211; Surprises and Yawns'>haXe 2.04 &#8211; Surprises and Yawns</a> <small>Over the weekend, we finally had a new release of...</small></li>
<li><a href='http://www.jadbox.com/2009/04/flashmvc-update-addresultlistener/' rel='bookmark' title='Permanent Link: FlashMVC Update: addResultListeners'>FlashMVC Update: addResultListeners</a> <small> I have just finished up making another addition to...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><img class="size-medium wp-image-883 aligncenter" title="Callback pun" src="http://www.jadbox.com/wp-content/uploads/2009/02/phone-call-300x219.jpg" alt="Callback pun" width="300" height="219" /></p>
<blockquote><p><strong>UPDATED: </strong>Thanks to my readers- there is an even easier way to evaluate a function as being not null without a compiler warning. One suggested a method using a type check (functionName is Function) however this is process intensive task for the compiler especially if this has to be done within a game loop. I believe the most efficient solution was suggested by Mije for doing a strict comparison by !== against null. This is better than != as the previous evaluation executes faster.</p></blockquote>
<p>One of the techniques I am fond of is <a href="http://en.wikipedia.org/wiki/Callback_(computer_science)">callback functions</a> when using a custom event may be overkill for the situation. However, trying to actually explain callbacks verbally is almost impossible. In a nutshell, it&#8217;s a method (lets say A) that accepts another a method (lets say B) as a property. Method A will perform its action and then call method B. This allows the class that uses Method A to have one of its methods called once Method A completed.</p>
<p>Here is an example; however, in practice, callbacks are only useful when the method that uses it is in a different class otherwise you could just call the method directly instead of using the callback.</p>
<div class="codecolorer-container actionscript3 twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="actionscript3 codecolorer" style="white-space:nowrap"><span style="color: #009900; font-style: italic;">// Example function that calls the method that uses a callback</span><br />
<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> gameEnded<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 />
saveScore<span style="color: #000000;">&#40;</span>10<span style="color: #000066; font-weight: bold;">,</span> onSave<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: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> saveScore<span style="color: #000000;">&#40;</span>score<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=int%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:int.html"><span style="color: #004993;">int</span></a><span style="color: #000066; font-weight: bold;">,</span> onSaveCallback<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=function%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:function.html"><span style="color: #004993;">Function</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><br />
<span style="color: #009900; font-style: italic;">// saving score...</span><br />
<span style="color: #009900; font-style: italic;">// once done:</span><br />
onSaveCallback<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><br />
<span style="color: #009900; font-style: italic;">// This is the function that gets past into saveScore</span><br />
<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> onSave<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: #000000;">&#125;</span></div></div>
<p>Okay okay, now here is the problem at hand. What if the callback function was optional? You could write it 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="white-space:nowrap"><span style="color: #009900; font-style: italic;">// onSaveCallback is now optional with a default value of null</span><br />
<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> saveScore<span style="color: #000000;">&#40;</span>score<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=int%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:int.html"><span style="color: #004993;">int</span></a><span style="color: #000066; font-weight: bold;">,</span> onSaveCallback<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=function%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:function.html"><span style="color: #004993;">Function</span></a>=<span style="color: #0033ff; font-weight: bold;">null</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 />
onSaveCallback<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>Not so fast! If the callback function is not specified and gets set to null, Flash will throw an error since you cannot call null as a function like this: null().<br />
Well, you could do a conditional check:</p>
<div class="codecolorer-container actionscript3 twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="actionscript3 codecolorer" style="white-space:nowrap"><span style="color: #009900; font-style: italic;">// onSaveCallback is now optional with a default value of null</span><br />
<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> saveScore<span style="color: #000000;">&#40;</span>score<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=int%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:int.html"><span style="color: #004993;">int</span></a><span style="color: #000066; font-weight: bold;">,</span> onSaveCallback<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=function%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:function.html"><span style="color: #004993;">Function</span></a>=<span style="color: #0033ff; font-weight: bold;">null</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: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span>onSaveCallback<span style="color: #000000;">&#41;</span> onSaveCallback<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>This way we can check to see if onSaveCallback does not equal null. Well, this angers the Flash compiler and it will throw the below message:<br />
<strong><span style="color: red;">Warning: 3553: Function value used where type Boolean was expected.  Possibly the parentheses () are missing after this function reference.</span></strong><br />
This is because Flash is confused that you are trying to evaluate a function as a Boolean instead of using it normally as a function. So, how can we evaluate if the function is not null without throwing a Flash warning? Well, I scowered the internet and could not find a best practice for Flash. After a discussion with my readers, the best solution here is to do a strict type check to null as shown below:</p>
<div class="codecolorer-container actionscript3 twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="actionscript3 codecolorer" style="white-space:nowrap"><span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> saveScore<span style="color: #000000;">&#40;</span>score<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=int%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:int.html"><span style="color: #004993;">int</span></a><span style="color: #000066; font-weight: bold;">,</span> onSaveCallback<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=function%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:function.html"><span style="color: #004993;">Function</span></a>=<span style="color: #0033ff; font-weight: bold;">null</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: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span> onSaveCallback <span style="color: #000066; font-weight: bold;">!</span>== <span style="color: #0033ff; font-weight: bold;">null</span> <span style="color: #000000;">&#41;</span> onSaveCallback<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>Well there you have it- let me know if this works for you!</p>


<p>Related posts:<ol><li><a href='http://www.jadbox.com/2009/07/haxe-2-04-surprises-and-yawns/' rel='bookmark' title='Permanent Link: haXe 2.04 &#8211; Surprises and Yawns'>haXe 2.04 &#8211; Surprises and Yawns</a> <small>Over the weekend, we finally had a new release of...</small></li>
<li><a href='http://www.jadbox.com/2009/04/flashmvc-update-addresultlistener/' rel='bookmark' title='Permanent Link: FlashMVC Update: addResultListeners'>FlashMVC Update: addResultListeners</a> <small> I have just finished up making another addition to...</small></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.jadbox.com/2009/02/as3-optional-callback-method-warning/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>ActionScript Reference for Android!</title>
		<link>http://www.jadbox.com/2009/02/actionscript-for-android/</link>
		<comments>http://www.jadbox.com/2009/02/actionscript-for-android/#comments</comments>
		<pubDate>Sun, 01 Feb 2009 22:17:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Flash/Flex/AIR]]></category>
		<category><![CDATA[Showcase]]></category>
		<category><![CDATA[as3]]></category>

		<guid isPermaLink="false">http://www.jadbox.com/?p=839</guid>
		<description><![CDATA[After seeing that someone wrote an ActionScript reference application for the iPhone called ActionScript 3 API Reference for iPhone, I decided to take matters into my own hands and make the same application for the Android platform which the t-mobile G1 works on. The Android OS is a fantastic platform for a developer as I [...]


Related posts:<ol><li><a href='http://www.jadbox.com/2009/10/adobe-max09-aftermath/' rel='bookmark' title='Permanent Link: Adobe MAX09 Aftermath'>Adobe MAX09 Aftermath</a> <small> Overall, what we learned at Adobe Max this year...</small></li>
<li><a href='http://www.jadbox.com/2009/03/further-reading-on-design-patterns/' rel='bookmark' title='Permanent Link: Further Reading on Design Patterns'>Further Reading on Design Patterns</a> <small>As a followup on my Wednesday lecture on design patterns,...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-840" title="ActionScript Reference for Android" src="http://www.jadbox.com/wp-content/uploads/2009/02/icon.png" alt="ActionScript Reference for Android" width="69" height="66" />After seeing that someone wrote an ActionScript reference application for the iPhone called <a href="http://www.mikechambers.com/as3iphone/" target="_blank">ActionScript 3 API Reference for iPhone</a>, I decided to take matters into my own hands and make the same application for the Android platform which the t-mobile G1 works on. The Android OS is a fantastic platform for a developer as I made this whole application over just two weekends. For the first release, I included a view to see all classes and a class search functionality. You can now download this from the Market on your Android phone! You can find it under the Application &#8211; Reference section, and it&#8217;s called <em>ActionScript Reference</em>. See the below screenshots&#8230;</p>
<p><strong>Classes View:</strong><br />
<img class="size-full wp-image-841" title="screen1" src="http://www.jadbox.com/wp-content/uploads/2009/02/screen1.gif" alt="screen1" width="319" height="480" /></p>
<p><strong>Class Information View:</strong><br />
<img class="alignnone size-full wp-image-841" title="screen2" src="http://www.jadbox.com/wp-content/uploads/2009/02/screen2.gif" alt="screen2" width="319" height="480" /></p>
<p>For more information on Android: <a href="http://www.android.com/">http://www.android.com/</a></p>


<p>Related posts:<ol><li><a href='http://www.jadbox.com/2009/10/adobe-max09-aftermath/' rel='bookmark' title='Permanent Link: Adobe MAX09 Aftermath'>Adobe MAX09 Aftermath</a> <small> Overall, what we learned at Adobe Max this year...</small></li>
<li><a href='http://www.jadbox.com/2009/03/further-reading-on-design-patterns/' rel='bookmark' title='Permanent Link: Further Reading on Design Patterns'>Further Reading on Design Patterns</a> <small>As a followup on my Wednesday lecture on design patterns,...</small></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.jadbox.com/2009/02/actionscript-for-android/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>FlashVars for EVERYONE!</title>
		<link>http://www.jadbox.com/2009/01/flashvars-for-everyone/</link>
		<comments>http://www.jadbox.com/2009/01/flashvars-for-everyone/#comments</comments>
		<pubDate>Mon, 26 Jan 2009 16:49:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Flash/Flex/AIR]]></category>
		<category><![CDATA[Game Development]]></category>
		<category><![CDATA[Showcase]]></category>
		<category><![CDATA[as3]]></category>

		<guid isPermaLink="false">http://www.jadbox.com/?p=810</guid>
		<description><![CDATA[When building utilities that can be used with both Flash and Flex, there are two common hurdles that developers run into. The first one is that Flex does not pull FlashVars the same way that Flash does. This means for ActionScript utilities that rely on html inserted variables will need to be separated into two [...]


Related posts:<ol><li><a href='http://www.jadbox.com/2009/04/flashmvc-update-addresultlistener/' rel='bookmark' title='Permanent Link: FlashMVC Update: addResultListeners'>FlashMVC Update: addResultListeners</a> <small> I have just finished up making another addition to...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-819" title="flashvarscat" src="http://www.jadbox.com/wp-content/uploads/2009/01/flashvarscat.jpg" alt="flashvarscat" width="230" height="230" />When building utilities that can be used with both Flash and Flex, there are two common hurdles that developers run into. The first one is that Flex does not pull FlashVars the same way that Flash does. This means for ActionScript utilities that rely on html inserted variables will need to be separated into two separate files or need to have flashvars passed into the utility from the outside. Another hurdle is that Flash does not have a global reference to Stage- instead it can only be accessed through display children of stage. This is problematic for utilities that work with Stage as they can only get there reference of stage when it&#8217;s manually passed into the utility as a parameter which can result in an ugly web of stage references being passed around.</p>
<p>However, I finally got the time to develop a workaround that solves both problems with classes FlashVars and StageReference. The tricky part of this implementation was building a utility that could use the class Application but not reference it when it was being built from Flash since it would cause the compiler to fail from the invalid class reference. I worked around this issue by grabbing Application by getDefinitionByName so that the Flash compiler wouldn&#8217;t fail since it was a weak reference.</p>
<p>With Flash, use StageReference.stage = stage in Frame 1 or in your document class&#8217;s constructor. This will give you the global reference to stage and also allow the new class FlashVars to pull flashvars automatically when compiled in a Flash project.</p>
<p>The custom class FlashVars is used in this fashion:</p>
<div class="codecolorer-container actionscript3 twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="actionscript3 codecolorer" style="white-space:nowrap"><span style="color: #6699cc; font-weight: bold;">var</span> myFlashvar<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> = FlashVars<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">parameters</span><span style="color: #000000;">&#91;</span><span style="color: #990000;">&quot;myFlashvar&quot;</span><span style="color: #000000;">&#93;</span><span style="color: #000066; font-weight: bold;">;</span></div></div>
<p>or</p>
<div class="codecolorer-container actionscript3 twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="actionscript3 codecolorer" style="white-space:nowrap"><span style="color: #6699cc; font-weight: bold;">var</span> myFlashvar<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> = FlashVars<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">parameters</span><span style="color: #000066; font-weight: bold;">.</span>myFlashvar<span style="color: #000066; font-weight: bold;">;</span></div></div>
<p><strong>This usage is exactly the same from Flash and Flex!</strong> No more having to switch from loaderInfo.parameters to Application.application.parameters when porting utilities between Flash and Flex.</p>
<p><strong>Download</strong> (includes StageReference): <strong><a href="http://www.jadbox.com/wp-content/uploads/2009/01/flashvars.zip">flashvars.zip</a></strong></p>
<p><span id="more-810"></span></p>
<p><em>Icon spoofed from <a href="http://icanhascheezburger.com/">icanhascheezburger.com</a>.</em></p>


<p>Related posts:<ol><li><a href='http://www.jadbox.com/2009/04/flashmvc-update-addresultlistener/' rel='bookmark' title='Permanent Link: FlashMVC Update: addResultListeners'>FlashMVC Update: addResultListeners</a> <small> I have just finished up making another addition to...</small></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.jadbox.com/2009/01/flashvars-for-everyone/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
