<?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>Flash Moments</title>
	<atom:link href="http://flashmoments.novelastudios.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://flashmoments.novelastudios.com</link>
	<description>ActionScript, Flash, and Flex</description>
	<lastBuildDate>Mon, 30 Aug 2010 03:27:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Process</title>
		<link>http://flashmoments.novelastudios.com/programming-practice/process/#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://flashmoments.novelastudios.com/programming-practice/process/#comments</comments>
		<pubDate>Mon, 30 Aug 2010 03:27:20 +0000</pubDate>
		<dc:creator>johntimothybailey</dc:creator>
				<category><![CDATA[Programming Practice]]></category>
		<category><![CDATA[Rants]]></category>
		<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[General Programming]]></category>
		<category><![CDATA[Suggestion]]></category>

		<guid isPermaLink="false">http://flashmoments.novelastudios.com/?p=163</guid>
		<description><![CDATA[Process is like any philosophy: You have one even if you say you don&#8217;t care about it or think it causes more weight to consider it. In the case of not caring, process is more likely to be one of a disaster and stress similar to any philosophy that has no care and consideration &#8220;If stand]]></description>
			<content:encoded><![CDATA[<p>Process is like any philosophy: You have one even if you say you don&#8217;t care about it or think it causes more weight to consider it.</p>
<div id="_mcePaste">In the case of not caring, process is more likely to <strong><em>be</em></strong> one of a disaster and stress similar to any philosophy that has no care and consideration</div>
<div id="_mcePaste">&#8220;If stand for nothing, you fall [ON] anything&#8221;</div>
<img src="http://flashmoments.novelastudios.com/?ak_action=api_record_view&id=163&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://flashmoments.novelastudios.com/programming-practice/process/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AIR &#8211; Spark Button Repeat &#8211; Doesn&#8217;t Work</title>
		<link>http://flashmoments.novelastudios.com/bugs/air-spark-button-repeat-work/#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://flashmoments.novelastudios.com/bugs/air-spark-button-repeat-work/#comments</comments>
		<pubDate>Thu, 15 Jul 2010 03:45:38 +0000</pubDate>
		<dc:creator>johntimothybailey</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Flex 4]]></category>
		<category><![CDATA[Flex SDK]]></category>
		<category><![CDATA[bugs]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[discussion wanted]]></category>
		<category><![CDATA[Spark Framework]]></category>

		<guid isPermaLink="false">http://flashmoments.novelastudios.com/?p=159</guid>
		<description><![CDATA[Does anyone have experience with making the Spark Button component have autoRepeat work with AIR SDK 4 &#8211; Release &#8211; 4.0.0.14159 http://bugs.adobe.com/jira/browse/SDK-26965]]></description>
			<content:encoded><![CDATA[<p>Does anyone have experience with making the Spark Button component have <em>autoRepeat</em> work with AIR SDK 4 &#8211; Release &#8211; 4.0.0.14159</p>
<p><a href="http://bugs.adobe.com/jira/browse/SDK-26965" target="_blank">http://bugs.adobe.com/jira/browse/SDK-26965</a></p>
<img src="http://flashmoments.novelastudios.com/?ak_action=api_record_view&id=159&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://flashmoments.novelastudios.com/bugs/air-spark-button-repeat-work/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Power of Separated Logic: Opening the Door</title>
		<link>http://flashmoments.novelastudios.com/flex/power-separated-logic-opening-door/#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://flashmoments.novelastudios.com/flex/power-separated-logic-opening-door/#comments</comments>
		<pubDate>Thu, 10 Jun 2010 04:56:11 +0000</pubDate>
		<dc:creator>johntimothybailey</dc:creator>
				<category><![CDATA[Flex 4]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[Design Patterns]]></category>
		<category><![CDATA[Spark Framework]]></category>

		<guid isPermaLink="false">http://flashmoments.novelastudios.com/?p=149</guid>
		<description><![CDATA[I have to give the Adobe Flash team big props on the new Spark framework&#8217;s focus on separated logic. Not only does it enhance my productivity and sanity, but it has opened wide the door for and encouraged the Flex community to create vast reusable code in ways that Flex 3 had problems encouraging developers]]></description>
			<content:encoded><![CDATA[<p>I have to give the Adobe Flash team big props on the new Spark framework&#8217;s focus on separated logic. Not only does it enhance my productivity and sanity, but it has opened wide the door for and encouraged the Flex community to create vast reusable code in ways that Flex 3 had problems encouraging developers to do.<br />
For instance, the Spark separated layout structure with a DI slant has already saved time and encouraged so many layout concepts that are <strong>no longer component based</strong> solutions (<a href="http://saturnboy.com/2009/10/flow-layout/">example</a>). The community is now able to focus on solving small solutions and then combining them into greater solution for a given project!</p>
<p>I <em>expect</em> to see more focused classes coming soon.</p>
<p>UPDATE <span style="color: #808080;">(June 10, &#8217;10)</span>:<br />
The focus on solution driven instead of component has allowed Adobe to have features like Layout Mirroring (<a href="http://blogs.adobe.com/flexdoc/2010/05/layout_mirroring.html" target="_blank">link</a>). This further demonstrates the power of developing a DI driven framework. I encourage more of us to architect this way. OH MAN, did I really suggest us to architect like Adobe?!</p>
<img src="http://flashmoments.novelastudios.com/?ak_action=api_record_view&id=149&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://flashmoments.novelastudios.com/flex/power-separated-logic-opening-door/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>BackgroundAlpha: Why contentBackgroundAlpha?</title>
		<link>http://flashmoments.novelastudios.com/flex/flex-4/backgroundalpha-contentbackgroundalpha/#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://flashmoments.novelastudios.com/flex/flex-4/backgroundalpha-contentbackgroundalpha/#comments</comments>
		<pubDate>Sun, 06 Jun 2010 02:36:28 +0000</pubDate>
		<dc:creator>johntimothybailey</dc:creator>
				<category><![CDATA[Discussion Wanter]]></category>
		<category><![CDATA[Flex 4]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[discussion wanted]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[Spark Framework]]></category>

		<guid isPermaLink="false">http://flashmoments.novelastudios.com/?p=101</guid>
		<description><![CDATA[Situation: I was working with the Spark (Flex4) TextArea component. I wanted the background to no longer be visible or just simply alpha set to zero. I expected I could set a stylesheet property backgroundAlpha to zero. However, that didn&#8217;t work and there wasn&#8217;t even a property on the component called that. I dug in]]></description>
			<content:encoded><![CDATA[<p><strong>Situation:</strong> I was working with the Spark (Flex4) TextArea component. I wanted the background to no longer be visible or just simply alpha set to zero. I expected I could set a stylesheet property <em>backgroundAlpha</em> to zero. However, that didn&#8217;t work and there wasn&#8217;t even a property on the component called that. I dug in the source to find it and realized it is really <em>contentBackgroundAlpha.</em> Why? I see <em>borderAlpha</em> and expect to follow the same convention! I do not see <em>contentBorderAlpha</em>.</p>
<p><strong>Why break a convention? </strong><br />
<strong>Why use </strong><em><strong>contentBackgroundAlpha </strong></em><strong>when </strong><em><strong>borderAlpha</strong></em><strong> is present and there is not already a </strong><em><strong>backgroundAlpha</strong></em><strong>?!</strong></p>
<img src="http://flashmoments.novelastudios.com/?ak_action=api_record_view&id=101&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://flashmoments.novelastudios.com/flex/flex-4/backgroundalpha-contentbackgroundalpha/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Parsing Algorithms &#8211; Creational Patterns</title>
		<link>http://flashmoments.novelastudios.com/architectural-pattern/parsing-algorithms-creational-patterns/#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://flashmoments.novelastudios.com/architectural-pattern/parsing-algorithms-creational-patterns/#comments</comments>
		<pubDate>Sat, 27 Mar 2010 18:57:56 +0000</pubDate>
		<dc:creator>johntimothybailey</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Architectural Pattern]]></category>
		<category><![CDATA[Programming Architecture]]></category>
		<category><![CDATA[Programming Practice]]></category>
		<category><![CDATA[Rants]]></category>
		<category><![CDATA[Recommendations]]></category>
		<category><![CDATA[Architecture]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[Design Patterns]]></category>
		<category><![CDATA[General Programming]]></category>
		<category><![CDATA[rant]]></category>
		<category><![CDATA[Suggestion]]></category>

		<guid isPermaLink="false">http://flashmoments.novelastudios.com/?p=85</guid>
		<description><![CDATA[This is as much a recommendation as a rant, so pardon me while I do both Situation Open-source project or foundational classes for use within your organization that contains methods for parsing data. Background Often, I&#8217;ve run into issues where I am using an open-source library (public or private) and I need to add extra]]></description>
			<content:encoded><![CDATA[<p><em><span style="color: #888888;">This is as much a recommendation as a rant, so pardon me while I do both <img src='http://flashmoments.novelastudios.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </span></em></p>
<p><strong>Situation<br />
</strong>Open-source project or foundational classes for use within your organization that contains methods for parsing data.</p>
<p><strong>Background<br />
</strong>Often, I&#8217;ve run into issues where I am using an open-source library (public or private) and I need to add extra logic to a creational algorithm(s) and cannot or cannot easily do so. This is what has sparked me to write this post, because I am increasingly seeing these types of issues.</p>
<p><strong>Recommendation<br />
</strong>When creating algorithms that create objects from other objects (eg models and serialization) , please use offload the logic to accessible and easily modifiable methods. In Design Pattern terms, I&#8217;m requesting and ranting that the Factory Method Pattern, Strategy Pattern, or something similar be used. This only compounds in importance when there are several objects created in a single method!  &lt;&#8211; That right there is arguably bad practice in general for large projects.</p>
<p><strong>Example<br />
<span style="font-weight: normal;"><em><span style="color: #808080;">NOTE</span></em></span><span style="font-weight: normal;"><em><span style="color: #808080;">: Showing a simple example seems to not show the problem, but I&#8217;ll try. For a better example, please refer to &#8220;Real-Life Example&#8221; below.</span></em></span></strong></p>
<p><strong> </strong></p>
<p><strong>Mapping XML properties to models within a project.</strong></p>
<pre lang="Actionscript">protected updateList():void
{
var header:Header = new Header;
header.title = _xml.header.@title;
header.lang = _xml.header.@lang;
header.colors = _xml.header.colors.toArray();

var body:Body = _body;
var child:XML;
for (var i:Number = 0; i &lt; _xml.body.item.length(); ++i)
{
child = _xml.body.item[i];
body.getItemAt(i).text = child.@text;
}
}</pre>
<p><strong><span style="font-weight: normal;"><br />
</span></strong></p>
<p><strong>Real-Life Example<br />
<em><span style="color: #333333;">NOTE:</span></em><span style="font-weight: normal;"> I do not mean to pick on or criticize the fine work done by the peeps working on the <a title="OpenVideoPlayer Project" href="openvideoplayer.sourceforge.net/#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed">OpenVideoPlayer Project</a> and MUST EMPHASIZE that the project is very useful and saves time. This merely serves as an easy example to show. Moreover, I&#8217;ve written my fair share of problematic code along these lines too.</span></strong></p>
<p><strong> </strong></p>
<ul>
<li><span style="font-weight: normal;"><a href="https://sourceforge.net/tracker/?func=detail&amp;aid=2977117&amp;group_id=243060&amp;atid=1121331">https://sourceforge.net/tracker/?func=detail&amp;aid=2977117&amp;group_id=243060&amp;atid=1121331</a></span></li>
</ul>
<img src="http://flashmoments.novelastudios.com/?ak_action=api_record_view&id=85&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://flashmoments.novelastudios.com/architectural-pattern/parsing-algorithms-creational-patterns/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tween Library Preferences and Strategy Patterns</title>
		<link>http://flashmoments.novelastudios.com/actionscript/tween-library-preferences-strategy-patterns/#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://flashmoments.novelastudios.com/actionscript/tween-library-preferences-strategy-patterns/#comments</comments>
		<pubDate>Mon, 18 Jan 2010 03:48:52 +0000</pubDate>
		<dc:creator>johntimothybailey</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Programming Architecture]]></category>
		<category><![CDATA[Programming Practice]]></category>
		<category><![CDATA[Architecture]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[Design Patterns]]></category>
		<category><![CDATA[Strategy Pattern]]></category>

		<guid isPermaLink="false">http://flashmoments.novelastudios.com/?p=60</guid>
		<description><![CDATA[Problem: When it comes to Tween libraries, it&#8217;s either a project&#8217;s requirements and/or developer personal preferences that can conflict in selecting a library. Honestly, the library shouldn&#8217;t matter. The importance is that the objects are tweened. This is especially important when it comes to open-source projects, as the issue only compounds where it&#8217;s much more]]></description>
			<content:encoded><![CDATA[<p><strong>Problem</strong>:<br />
When it comes to Tween libraries, it&#8217;s either a project&#8217;s requirements and/or developer personal preferences that can conflict in selecting a library. Honestly, <span style="text-decoration: underline;">the library shouldn&#8217;t matter</span>. <span style="text-decoration: underline;">The importance is that the objects are tweened</span>. This is especially important when it comes to open-source projects, as the issue only compounds where it&#8217;s much more likely that both personal preferences and project requirements will both be the issue with the open-source project.</p>
<p><strong>Solution:</strong> Use the Strategy Pattern</p>
<p><strong>Example</strong><em> (real-life example)</em>: <a title="Duncan Reid's Blog" href="http://blog.hy-brid.com/" target="_blank">Duncan Reid</a> created a <a title="Duncan Reid's ToolTip Class" href="http://blog.hy-brid.com/flash/25/simple-as3-tooltip/" target="_blank">ToolTip UI class</a> for ActionScript3. The problem I ran into was that fl.transitions.Tween was being used and I was working on an AS3 application that is using the now <a href="http://blog.greensock.com/tweenlite/" target="_blank">Greensock&#8217;s TweenLite</a>. The solution that Duncan and I discussed was to use a Strategy Pattern to decouple the Tween library from the ToolTip class itself and offload the reference onto implementation. In other words, by utilizing the Strategy Pattern, it allows the developer to decide which tweening library he/she would prefer to use. For Duncan Reid&#8217;s ToolTip UI I did the following:</p>
<ul>
<li>Added New Files:
<ul>
<li><em>com.hybrid.ui.strategies.IToolTipTweenStrategy</em></li>
<li><em>com.hybrid.ui.strategies.ToolTipTweenStrategy</em> &#8211; The only place where <em>fl.transitions.Tween</em> is being used/referenced</li>
</ul>
</li>
<li>ToolTip now has a required constructor parameter tweenStrategy which will accept anything implementing the IToolTipTweenStrategy</li>
</ul>
<p>This now means that the ToolTip UI class depends on one thing &#8211; the Tween Strategy. In fact, the strategy could be set to null (not given to the ToolTip), then no tweening would take place. Instead, the tooltip would just display or hide immediately. As such, the required construction param could be made optional (ie default set to null).</p>
<p>In action this simply looks like</p>
<pre lang="Actionscript">  new ToolTip(new com.hybrid.ui.strategies.ToolTipTweenStrategy)
  //OR
  new ToolTip(new com.novelastudios.ui.strategies.ToolTipTweenStrategy)</pre>
<p><strong>Source Files / Source Examples</strong> <em>(using Duncan Reid&#8217;s ToolTip UI)</em></p>
<ul>
<li>Example of dynamic strategy changing ( <a title="ToolTip Tween Strategy Visual Demo" href="http://sources.novelastudios.com/flash/tooltip/ToolTipExample.html" target="_blank">visual demo</a> / <a href="http://sources.novelastudios.com/flash/tooltip/srcview/index.html" target="_blank">source</a> )
<ul>
<li>Click the Radio Buttons at the top of the visual demo to switch between the different strategies.</li>
</ul>
</li>
<li>Implementing it into Duncan&#8217;s original example
<ul>
<li>Using fl.transitions.Tween ( <a href="http://sources.novelastudios.com/flash/tooltip/ToolTip_Fl_Tween.html" target="_blank">visual demo</a> / source <a href="http://sources.novelastudios.com/flash/tooltip/srcview/source/ToolTip_Fl_Tween.fla" target="_blank">.fla</a> | <a href="http://sources.novelastudios.com/flash/tooltip/srcview/source/ToolTip_Fl_Tween.as" target="_blank">.as</a> )</li>
<li>Using com.greensocks.TweenLite ( <a href="http://sources.novelastudios.com/flash/tooltip/ToolTip_Greensock_Tween.html" target="_blank">visual demo </a>/ source <a href="http://sources.novelastudios.com/flash/tooltip/srcview/source/ToolTip_Greensock_Tween.fla" target="_blank">.fla</a> | <a href="http://sources.novelastudios.com/flash/tooltip/srcview/source/ToolTip_Greensock_Tween.as" target="_blank">.as</a> )</li>
</ul>
</li>
</ul>
<p><strong>Note</strong><br />
The above source is not officially supported / maintained by Duncan Reid and as such I recommend that this simply be used as an example and refer you to his site and source code for production use.</p>
<p><strong>Additional Information</strong><br />
For more information on the Strategy Pattern with ActionScript3 checkout the following:</p>
<ul>
<li><a title="Simple Explanation" href="http://ntt.cc/2008/10/07/gang-of-four-gof-design-patterns-in-actionscript-strategy.html" target="_blank">Brief Explanation</a></li>
<li><a title="Bill Sanders' Explanation of the Strategy Pattern" href="http://www.as3dp.com/2008/11/09/actionscript-30-strategy-design-pattern-under-no-conditionals/" target="_blank">Bill Sanders&#8217; Explanation</a></li>
<li><a title="Sean Moore's Explanation" href="http://www.insideria.com/2008/11/exploring-the-strategy-design.html" target="_blank">Sean Moore&#8217;s Explanation</a></li>
</ul>
<img src="http://flashmoments.novelastudios.com/?ak_action=api_record_view&id=60&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://flashmoments.novelastudios.com/actionscript/tween-library-preferences-strategy-patterns/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>The Genius of Programming</title>
		<link>http://flashmoments.novelastudios.com/programming-practice/the-genius-of-programming/#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://flashmoments.novelastudios.com/programming-practice/the-genius-of-programming/#comments</comments>
		<pubDate>Wed, 13 Jan 2010 04:36:00 +0000</pubDate>
		<dc:creator>johntimothybailey</dc:creator>
				<category><![CDATA[Programming Architecture]]></category>
		<category><![CDATA[Programming Practice]]></category>
		<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[General Programming]]></category>

		<guid isPermaLink="false">http://flashmoments.novelastudios.com/?p=51</guid>
		<description><![CDATA[This post is simply a quote from my brother-in-law Forrest Kyle, which he kindly spent time writing out what he said to me on the phone while we discussed architectural practices. I wanted to share this, because I believe it is so well put. In programming, genius rarely manifests itself in some radical new idea,]]></description>
			<content:encoded><![CDATA[<p>This post is simply a quote from my brother-in-law <a href="http://forrestkyle.com/">Forrest Kyle</a>, which he kindly spent time writing out what he said to me on the phone while we discussed architectural practices. I wanted to share this, because I believe it is so well put.</p>
<blockquote><p>In programming, genius rarely manifests itself in some radical new idea, or some blazing new algorithm that redefines the parameters of what is possible.  Often, genius is the visible result of a forceful and determined intensity of focus placed upon mundane details, and making sure software is fundamentally correct.  A good sign of a genius programmer is one who is willing to work closely with details that are “beneath him” if it serves the greater good of program efficiency and correctness.</p>
<p>Don’t allow yourself to make a design decision for which you can’t articulate a verbal defense.  Imagine yourself explaining why you made your design choices to a panel of super geniuses.  If you find yourself at a loss for words, it is likely that future users and developers of your program will find themselves at a loss for patience.</p>
<p>A source file is more than just a set of instructions for your computer; it is a formal engineering schematic and must be crafted in such a way that communication with other developers is as deeply ingrained in the presentation as the function of the program itself.  You are not writing source files for yourself, you are writing them for current and future coworkers.</p>
<p>Programmers who don’t feel the need to write clear, helpful documentation are like cats that don’t feel the need to use the litter box.</p>
<p>-Forrest Kyle</p></blockquote>
<p>In closing, this really is not just a great explanation of solid programming, but of communication and thought out action.</p>
<img src="http://flashmoments.novelastudios.com/?ak_action=api_record_view&id=51&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://flashmoments.novelastudios.com/programming-practice/the-genius-of-programming/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Invoking Constructors</title>
		<link>http://flashmoments.novelastudios.com/architectural-pattern/invoking-constructors/#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://flashmoments.novelastudios.com/architectural-pattern/invoking-constructors/#comments</comments>
		<pubDate>Thu, 26 Nov 2009 18:04:08 +0000</pubDate>
		<dc:creator>johntimothybailey</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Architectural Pattern]]></category>
		<category><![CDATA[Programming Practice]]></category>
		<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Suggestion]]></category>

		<guid isPermaLink="false">http://flashmoments.novelastudios.com/?p=38</guid>
		<description><![CDATA[RJ Regenold and I were discussing last night how we both strongly believe constructors should have extremely limited algorithms that simply invoke protected methods. For instance, PureMVC&#8217;s Facade initializes the instance in the constructor package org.puremvc.as3.multicore.patterns.facade { import org.puremvc.as3.multicore.core.*; import org.puremvc.as3.multicore.interfaces.*; import org.puremvc.as3.multicore.patterns.observer.*; public function Facade( key:String ) { if (instanceMap[ key ] != null)]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.binarylionstudios.com/" target="_self">RJ Regenold</a> and I were discussing last night how we both strongly believe constructors should have extremely limited algorithms that simply invoke protected methods.</p>
<p>For instance, PureMVC&#8217;s Facade initializes the instance in the constructor</p>
<pre lang="Actionscript">package org.puremvc.as3.multicore.patterns.facade
{
	import org.puremvc.as3.multicore.core.*;
	import org.puremvc.as3.multicore.interfaces.*;
	import org.puremvc.as3.multicore.patterns.observer.*;

	public function Facade( key:String )
        {
	     if (instanceMap[ key ] != null) throw Error(MULTITON_MSG);
	     initializeNotifier( key );
	     instanceMap[ multitonKey ] = this;
	     initializeFacade();
	}
}
</pre>
<pre lang="Actionscript">package org.puremvc.as3.multicore.patterns.facade
{
	import org.puremvc.as3.multicore.core.*;
	import org.puremvc.as3.multicore.interfaces.*;
	import org.puremvc.as3.multicore.patterns.observer.*;

	public function Facade( key:String )
        {
	     if (instanceMap[ key ] != null) throw Error(MULTITON_MSG);
	     initializeNotifier( key );
	     initializeInstance();
	     initializeFacade();
	}

        protected function initializeInstance():void
        {
             instanceMap[ multitonKey ] = this;
        }
}
</pre>
<p>I would even argue that the Error checking / validation takes place in an init of some kind as well.</p>
<p>Another example is as follows<br />
Instead of doing,</p>
<pre lang="Actionscript">package
{
	import flash.display.Sprite;

	public class ViewUI extends Sprite
	{
		public function ViewUI()
		{
			super();
			width = 100;
			height = 200;
		}
	}
}
</pre>
<p>Do this</p>
<pre lang="Actionscript">package
{
	import flash.display.Sprite;

	public class ViewUI extends Sprite
	{
		public function ViewUI()
		{
			super();
			init();
		}

		protected function init():void
		{
			width = 100;
			height = 200;
		}
	}
}
</pre>
<p>This practice becomes increasingly important in open-source projects. Moreover, this example may be limited but consider more complex constructors that you&#8217;ve seen or written yourself. The construction process should be divided into segments when possible.</p>
<p>UPDATE ( 01.13.10 ): <a href="http://www.as3dp.com/2010/01/06/class-constructor-function-should-do-no-real-work-getting-agile-part-i/#more-2322">Bill Sanders recently posted a good article about this exact topic</a>!</p>
<img src="http://flashmoments.novelastudios.com/?ak_action=api_record_view&id=38&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://flashmoments.novelastudios.com/architectural-pattern/invoking-constructors/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Rasterize a Transformed Vector without Pixelation</title>
		<link>http://flashmoments.novelastudios.com/flex-3/rasterize-a-transformed-vector-without-pixelation/#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://flashmoments.novelastudios.com/flex-3/rasterize-a-transformed-vector-without-pixelation/#comments</comments>
		<pubDate>Tue, 10 Nov 2009 18:16:00 +0000</pubDate>
		<dc:creator>johntimothybailey</dc:creator>
				<category><![CDATA[Flex 3]]></category>
		<category><![CDATA[Graphics]]></category>
		<category><![CDATA[bugs]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[workaround]]></category>

		<guid isPermaLink="false">http://flashmoments.novelastudios.com/?p=17</guid>
		<description><![CDATA[How does one rasterize a transformed vector capturing it&#8217;s new dimensions without pixelation? Note: This follows my previous post Matrix Not Synchronized Challenge: To render a bitmap of a transformed vector display object without pixelation. Specifically, after a mx.controls.Text is transformed, a bitmap snapshot is needed to be taken of the new object including the]]></description>
			<content:encoded><![CDATA[<p><span style="color: #000000;"><strong>How does one rasterize a transformed vector capturing it&#8217;s new dimensions without pixelation?</strong></span></p>
<p><strong><em>Note</em></strong>: This follows my previous post <a href="http://flashmoments.novelastudios.com/?p=16#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed">Matrix Not Synchronized</a></p>
<p><strong><em>Challenge</em></strong>: To render a bitmap of a transformed vector display object without pixelation. Specifically, after a mx.controls.Text is transformed, a bitmap snapshot is needed to be taken of the new object including the dimensions.  I should note that the reason I am needing to get a bitmap snapshot is do to some shaping to the text.</p>
<p><strong><em>Problem</em></strong>: However, doing so results in pixelation or resamples / renders the original dimensions of the transformed Text. It appears that flash.display.BitmapData::draw cannot get the new transformed display. In other words,  when a flash.display.InteractiveObject is scaled on the x axis (or any axis) using transform.matrix, flash.display.BitmapData::draw cannot capture the new dimensions of the display object.</p>
<p><strong><em>Example</em></strong>: <a href="http://sources.novelastudios.com/flash/matrix_adustments/MatriciesAndDimensions.html#">http://sources.novelastudios.com/flash/matrix_adustments/MatriciesAndDimensions.html#</a><br />
When the application creation complete is fired a snapshot is made. Change the matrix width (transform.matrix.a) and then re-render a snapshot / bitmap. Notice it retains the original, non-transformed values. Therefore and considering it is a rastered snapshot, when the snapshot/bitmap is scaled it becomes pixelated. Example version was 1.1.0.0 that should this problem. Version 1.2.0.0 is a workaround for now showing the workaround.</p>
<p><strong><em>Workaround</em></strong>: I give credit to Guy Stables (needs a link) and Alex Harui (http://blogs.adobe.com/aharui).  Essentially, the workaround is as follows:</p>
<ol>
<li><span style="color: #000000;"><span class="Apple-style-span">The InteractiveObject (<em>we&#8217;ll call our target</em>) needs to be placed in a container. <em>In this example mx.controls.Text is placed inside a mx.core.UIComponent. </em></span></span></li>
<li><span style="color: #000000;"><span class="Apple-style-span">The matrix transform is then applied to the target (<em>eg mx.controls.Text</em>)</span></span></li>
<li><span style="color: #000000;"><span class="Apple-style-span">The dimensions of the container (<em>eg the UIComponent that contains the Text/target</em>) are then set to the  target&#8217;s pixelBounds dimensions.</span></span></li>
<li><span style="color: #000000;"><span class="Apple-style-span"> Finally, take the snapshot bitmap of the container (<em>the UIComponent</em>).</span></span></li>
</ol>
<p><span style="color: #000000;">For a demonstration see the latest version 1.2.0.0 of the example.</span></p>
<p><strong><em>More Information:</em></strong><br />
Also found at <a href="http://forums.adobe.com/thread/521432">http://forums.adobe.com/thread/521432</a></p>
<img src="http://flashmoments.novelastudios.com/?ak_action=api_record_view&id=17&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://flashmoments.novelastudios.com/flex-3/rasterize-a-transformed-vector-without-pixelation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Matrix Not Synchronized</title>
		<link>http://flashmoments.novelastudios.com/graphics/matrix-not-synchronized/#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://flashmoments.novelastudios.com/graphics/matrix-not-synchronized/#comments</comments>
		<pubDate>Mon, 02 Nov 2009 23:37:00 +0000</pubDate>
		<dc:creator>johntimothybailey</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Graphics]]></category>
		<category><![CDATA[bugs]]></category>

		<guid isPermaLink="false">http://flashmoments.novelastudios.com/?p=16</guid>
		<description><![CDATA[I&#8217;m short on time right now and just want to post this Basically, matrix transforms do not update dimensions, rotations, and coordinates of UIComponents / InteractiveObjects. Take a look at http://sources.novelastudios.com/flash/matrix_adustments/MatriciesAdjustments.html Adjust the width and notice that when you switch over to the Pixel Tab the width never updates. Don&#8217;t believe me, then do a]]></description>
			<content:encoded><![CDATA[<div><span style="color: #000000;"><em>I&#8217;m short on time right now and just want to post this</em></span></div>
<div><span style="color: #000000;">Basically, matrix transforms do not update dimensions, rotations, and coordinates of UIComponents / InteractiveObjects.</span></div>
<div><span style="color: #000000;">Take a look at <a href="http://sources.novelastudios.com/flash/matrix_adustments/MatriciesAdjustments.html">http://sources.novelastudios.com/flash/matrix_adustments/MatriciesAdjustments.html</a></span></div>
<div><span style="color: #000000;">Adjust the width and notice that when you switch over to the Pixel Tab the width never updates.</span></div>
<div><span style="color: #000000;">Don&#8217;t believe me, then do a demo yourself.</span></div>
<p><span style="color: #000000;">Create a UIComponent transform the matrix&#8217;s a value and then inspect the width. Notice that there is no change</span></p>
<p><span style="color: #000000;"><span style="color: #000000;"><strong><em>Note: With UIComponents you can change the explicitWidth when the transform takes place to perform a workaround. However, that&#8217;s not the point.</em></strong></span></span></p>
<p><span style="color: #000000;">@Adobe Include event dispatching for matrix transforms!</span></p>
<img src="http://flashmoments.novelastudios.com/?ak_action=api_record_view&id=16&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://flashmoments.novelastudios.com/graphics/matrix-not-synchronized/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
