<?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"
	>

<channel>
	<title>The Flash Art of War</title>
	<atom:link href="http://flashartofwar.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://flashartofwar.com</link>
	<description>The Oldest Flash Military Treatise in the World</description>
	<pubDate>Thu, 15 May 2008 13:15:32 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<item>
		<title>Express Installer Utility</title>
		<link>http://flashartofwar.com/2008/05/15/express-installer-utility/</link>
		<comments>http://flashartofwar.com/2008/05/15/express-installer-utility/#comments</comments>
		<pubDate>Thu, 15 May 2008 12:00:02 +0000</pubDate>
		<dc:creator>FlashBum</dc:creator>
		
		<category><![CDATA[Strategic Attack]]></category>

		<guid isPermaLink="false">http://flashartofwar.com/?p=101</guid>
		<description><![CDATA[When doing the home page for Heavy.com we came across a &#8220;special&#8221; bug with our Flash detection script. Apparently some people who were running FireFox and Flash Player 9.0.xx+ were not able to make it through the detection script. The issue seemed to be that the browser would throw the wrong player version to JS [...]]]></description>
			<content:encoded><![CDATA[<p>When doing the home page for <a href="http://heavy.com">Heavy.com</a> we came across a &#8220;special&#8221; bug with our Flash detection script. Apparently some people who were running FireFox and Flash Player 9.0.xx+ were not able to make it through the detection script. The issue seemed to be that the browser would throw the wrong player version to JS and JS would fail to load the site (like it should do by prompting you to upgrade) but this was happening to people who had the correct version of the player. We caught this bug in QA before launching the site but here is the class I used to get around this problem.</p>
<p><span id="more-101"></span></p>
<div class="codesnip-container" >
<div class="codesnip">package <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">import</span> flash.<span class="me1">events</span>.<span class="me1">EventDispatcher</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">import</span> flash.<span class="kw3">system</span>.<span class="kw3">Capabilities</span>;&nbsp; &nbsp; &nbsp; &nbsp;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">dynamic</span> <span class="kw3">public</span> <span class="kw2">class</span> ExpressInstallerUtility <span class="kw3">extends</span> EventDispatcher <span class="br0">&#123;</span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw3">static</span> const INIT : <span class="kw3">String</span> = <span class="st0">&#8220;init&#8221;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">private</span> <span class="kw3">static</span> <span class="kw2">var</span> __instance : ExpressInstallerUtility;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">private</span> <span class="kw2">var</span> eventDispatcher : EventDispatcher;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">function</span> ExpressInstallerUtility<span class="br0">&#40;</span>enforcer : SingletonEnforcer<span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; eventDispatcher = <span class="kw2">new</span> EventDispatcher<span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw3">static</span> <span class="kw2">function</span> <span class="kw3">get</span> instance<span class="br0">&#40;</span><span class="br0">&#41;</span> : ExpressInstallerUtility <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span>ExpressInstallerUtility.__instance == <span class="kw2">null</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ExpressInstallerUtility.__instance = <span class="kw2">new</span> ExpressInstallerUtility<span class="br0">&#40;</span><span class="kw2">new</span> SingletonEnforcer<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> ExpressInstallerUtility.__instance;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="coMULTI">/**<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * Returns the full Player version from the Capabilities class.<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * @return String: MAC 9,0,115,0<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; */</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">function</span> <span class="kw3">get</span> player_version<span class="br0">&#40;</span><span class="br0">&#41;</span> : <span class="kw3">String</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="kw3">Capabilities</span>.<span class="kw3">version</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="coMULTI">/**<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * Returns the OS.<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * @return String: MAC<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; */</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">function</span> <span class="kw3">get</span> <span class="kw3">os</span><span class="br0">&#40;</span><span class="br0">&#41;</span> : <span class="kw3">String</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> player_version.<span class="kw3">split</span><span class="br0">&#40;</span><span class="st0">&#8221; &#8220;</span><span class="br0">&#41;</span><span class="br0">&#91;</span><span class="nu0">0</span><span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="coMULTI">/**<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * Returns the version.<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * @return String: 9,0,115,0<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; */</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">function</span> <span class="kw3">get</span> <span class="kw3">version</span><span class="br0">&#40;</span><span class="br0">&#41;</span> : <span class="kw3">String</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> player_version.<span class="kw3">split</span><span class="br0">&#40;</span><span class="st0">&#8221; &#8220;</span><span class="br0">&#41;</span><span class="br0">&#91;</span><span class="nu0">1</span><span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="coMULTI">/**<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * Returns version as an Array.<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * @return Array: version<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; */</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">function</span> <span class="kw3">get</span> version_array<span class="br0">&#40;</span><span class="br0">&#41;</span> : <span class="kw3">Array</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="kw3">version</span>.<span class="kw3">split</span><span class="br0">&#40;</span><span class="st0">&#8220;,&#8221;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="coMULTI">/**<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * Compares min version to the current player&#8217;s version.<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * @param min_version:String = &quot;9,0,115,0&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; */</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">function</span> has_version<span class="br0">&#40;</span>min_version : <span class="kw3">String</span><span class="br0">&#41;</span> : <span class="kw3">Boolean</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> current_version : <span class="kw3">Array</span> = version_array;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> min_version_array : <span class="kw3">Array</span> = min_version.<span class="kw3">split</span><span class="br0">&#40;</span><span class="st0">&#8220;,&#8221;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> compare<span class="br0">&#40;</span>current_version, min_version_array<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="coMULTI">/**<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * Compares two versions of the player and returns if the current player is ok.<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * @param current_version: Array of the player version.<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * @param min_version: Array of the min version to test for.<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * @return Boolean: True = Good to go, False = current player is to low<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; */</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; internal <span class="kw2">function</span> compare<span class="br0">&#40;</span>current_version : <span class="kw3">Array</span>, min_version : <span class="kw3">Array</span><span class="br0">&#41;</span> : <span class="kw3">Boolean</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> n1 : <span class="kw3">Number</span> = <span class="nu0">0</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> n2 : <span class="kw3">Number</span> = <span class="nu0">0</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> pad : <span class="kw3">Array</span> = <span class="br0">&#91;</span><span class="nu0">10000000000</span>, <span class="nu0">100000</span>, <span class="nu0">10</span>, <span class="nu0">0</span><span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">for</span> <span class="br0">&#40;</span><span class="kw2">var</span> i : <span class="kw3">Number</span> = current_version.<span class="kw3">length</span> - <span class="nu0">1</span>;i &gt;= <span class="nu0">0</span>; i&#8211;<span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; n1 += <span class="kw3">parseInt</span><span class="br0">&#40;</span>current_version<span class="br0">&#91;</span>i<span class="br0">&#93;</span><span class="br0">&#41;</span> * pad<span class="br0">&#91;</span>i<span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">for</span> <span class="br0">&#40;</span><span class="kw2">var</span> j : <span class="kw3">Number</span> = min_version.<span class="kw3">length</span> - <span class="nu0">1</span>;j &gt;= <span class="nu0">0</span>; j&#8211;<span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; n2 += <span class="kw3">parseInt</span><span class="br0">&#40;</span>min_version<span class="br0">&#91;</span>j<span class="br0">&#93;</span><span class="br0">&#41;</span> * pad<span class="br0">&#91;</span>j<span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> n1 &gt;= n2;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
<span class="br0">&#125;</span></p>
<p><span class="kw2">class</span> SingletonEnforcer <span class="br0">&#123;</span><br />
<span class="br0">&#125;</span></div>
</div>
<p>There is nothing really special about this class. It basically adds some new functions to allow you to check for a &#8220;min&#8221; version vs the installed version. Why use this? Well the way adobe has you do a version detection is to use an AS 1 version 7 (ish) swf to do the detection. Since JS got hung up on the browsers that had the mismatched version of 9.0.xx we decided to add the check into the main app and only call the express install if the app said we had to.</p>
<p>So what happens is that if JS detects that you have version 9.X + it goes right into the app. Anything below is handled the old way with express install and JS. So once you are in the app I use something like this to make sure you have everything you need to run the homepage swf.</p>
<div class="codesnip-container" >
<div class="codesnip"><span class="kw2">var</span> min_version:<span class="kw3">String</span> = <span class="st0">&#8220;9,0,115&#8243;</span>; <span class="co1">// This should come in from flash vars</span></p>
<p><span class="kw1">if</span><span class="br0">&#40;</span>ExpressInstallerUtility.<span class="me1">instance</span>.<span class="me1">has_version</span><span class="br0">&#40;</span>min_version<span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// Start App</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><span class="kw1">else</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// Tell JS that it needs to do the express install</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ExternalInterface.<span class="kw3">call</span><span class="br0">&#40;</span>_js_express_install, _js_parent_id<span class="br0">&#41;</span>;<br />
<span class="br0">&#125;</span></div>
</div>
<p>So what we have here is a simple test from the ExpressInstallerUtility for the correct version from a passed in min version. If it passes, great start the app but if not we call a JS function to force an express install and have the user upgrade to the right version.</p>
<p>Interesting enough no to many people have run into this issue before and honestly it only happend a few times in QA but we were able to reporduce it consistantly where FireFox would have the most up to date player yet JS was unable to get the correct version from the browser. Maybe this class is something you should keep in you back pocket for a rainy day.</p>
<p>So what is so special about our home page that we needed to use 9.0.115? Well outside of wanting to use H.264 for our video it would appear that when you upgrade the Flash IDE it automatically forces you to build for 9.0.115. If you use the video component or net stream object and try running your swf in a lower version they don&#8217;t work or show up at all. We originally scoped it out to work for 9.0.45 but since Adobe is forcing h.264 down our throats (and that is not a bad thing) they neglected to make it clear that a simple software upgrade would lock us into a player with lower penetration then they were marketing. I wish I could stop posting about this and the ever changing Flash Player upgrades we have endured but it really leaves a bad taste in your mouth when you have to explain to you boss or client you are locked into something with no way to build to a specific player version in the Flash IDE right before launching.</p>
]]></content:encoded>
			<wfw:commentRss>http://flashartofwar.com/2008/05/15/express-installer-utility/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Flash Player 10 - beta?</title>
		<link>http://flashartofwar.com/2008/05/15/flash-player-10-beta/</link>
		<comments>http://flashartofwar.com/2008/05/15/flash-player-10-beta/#comments</comments>
		<pubDate>Thu, 15 May 2008 05:44:33 +0000</pubDate>
		<dc:creator>FlashBum</dc:creator>
		
		<category><![CDATA[Waging War]]></category>

		<guid isPermaLink="false">http://flashartofwar.com/?p=107</guid>
		<description><![CDATA[Came across this post today from flashguru.com that talks about Flash Player 10. Aparently an early release of the Flash 10 Player is available from Adobe today. Here are some really cool features I wanted to highlight from Adobe&#8217;s Site.

Visual Performance Improvements
Flash Player 10 builds on the dramatic script execution performance improvements introduced in Flash [...]]]></description>
			<content:encoded><![CDATA[<p>Came across this <a href="http://www.flashguru.co.uk/astro-flash-player-10-available-now">post</a> today from <a href="http://www.flashguru.co.uk">flashguru.com</a> that talks about Flash Player 10. Aparently an <a href="http://labs.adobe.com/technologies/flashplayer10/">early release</a> of the Flash 10 Player is available from Adobe today. Here are some <a href="http://labs.adobe.com/technologies/flashplayer10/releasenotes.html#features">really cool features</a> I wanted to highlight from Adobe&#8217;s Site.</p>
<p><span id="more-107"></span></p>
<p><strong>Visual Performance Improvements</strong><br />
Flash Player 10 builds on the dramatic script execution performance improvements introduced in Flash Player 9 with the new ActionScript 3.0 Virtual Machine (AVM2) by enhancing the equally important visual performance of your RIAs and rich media experiences.  Leveraging the power of the GPU for blitting and compositing reduces the load on the CPU and can provide a performance boost to many graphically intense applications, resulting in more fluid, realistic and responsive user experiences.</p>
<p><strong>GPU Compositing</strong> — Combining images, filters, and video in your SWF just got faster.  Your video card can be used to do compositing on all raster content.  Utilizing the hardware processing power of the graphics card, GPU compositing accelerates compositing calculations of bitmaps, filters, blend modes, and video overlays faster than would be performed in software on the CPU.  GPU compositing is applied when specified in the HTML parameters provided appropriate graphics hardware is available. If the hardware does not provide required capability, Flash Player will fall back to the software rendering without user interaction.  Hardware compositing takes advantage of the tremendous memory bandwidth and computational horsepower of the GPU, reducing the load on the CPU, and can provide a performance boost to many graphically intense applications, resulting in more fluid, realistic and responsive user experiences. Open GL 2.0 video card with GLSL capabilities required to use this feature. When in use with the beta, a green square will appear in the upper left corner when accelerated.</p>
<p><strong>GPU Blitting</strong> — Paint SWFs into the browser using your video card by choosing this new HTML parameter. Your content can run faster and give you the freedom to do more.  Developers can enable or disable GPU surfacing to perform hardware blitting for each SWF within a web page without having to recompile the SWF. GPU surfacing extends the hardware-scaled fullscreen view introduced in Flash Player 9 Update 3 and applies it to the browser window so that the pixels drawn to the browser go through the GPU, resulting in improved performance and reduced CPU demand, rendering video- or image-intensive applications faster.</p>
<p><strong>Anti-Aliasing Engine</strong> (Saffron 3.1) — An update to the Saffron anti-aliasing text engine increases performance and quality of anti-aliased text, particularly for Asian character rendering.  Support for stroke fonts reduces memory requirements.</p>
<p><strong>Vector Data Type</strong> — Flash Player 10 and ActionScript 3.0 add support for a new data type called Vector that is an ECMAScript 4 proposed language addition that is similar to an Array but requires that all elements be of the same type.  By having a consistent type, performance on Vectors is significantly higher than Arrays.  Vectors work as a parameterized type.</p>
<p>For a full list <a href="http://labs.adobe.com/technologies/flashplayer10/releasenotes.html#features">look here</a>. This is going to open up a new word of visual programming in Flash. I am really looking forward to playing around with this stuff. Luckily what I am working on at Heavy requires lots of bitmap manipulation so its good to see Adobe is really taking this stuff to the next level. Adobe, when do we get to play?</p>
]]></content:encoded>
			<wfw:commentRss>http://flashartofwar.com/2008/05/15/flash-player-10-beta/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Helper Class</title>
		<link>http://flashartofwar.com/2008/05/13/helper-class/</link>
		<comments>http://flashartofwar.com/2008/05/13/helper-class/#comments</comments>
		<pubDate>Tue, 13 May 2008 13:46:36 +0000</pubDate>
		<dc:creator>FlashBum</dc:creator>
		
		<category><![CDATA[Strategic Attack]]></category>

		<guid isPermaLink="false">http://flashartofwar.com/?p=96</guid>
		<description><![CDATA[Sometime you need a little class to act as a Utility but still allow for for instance specific configuration. In one class your util may need to do X and in another Y but the functions and methods need to be the same for both classes. In the past I use to develop Singleton or [...]]]></description>
			<content:encoded><![CDATA[<p>Sometime you need a little class to act as a Utility but still allow for for instance specific configuration. In one class your util may need to do X and in another Y but the functions and methods need to be the same for both classes. In the past I use to develop Singleton or Static utility classes but this situation breaks my design pattern. How do I handle these one off customizable utilities? I create helpers.</p>
<p><span id="more-96"></span></p>
<p>For me a helper class is a class instance similar to a utility with options to customize its internal values. Here is one example of a helper class I am now using in my Settings Utility.</p>
<div class="codesnip-container" >
<div class="codesnip">package <br />
<span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="coMULTI">/** (c) Copyright 2008 Heavy, Inc.&nbsp; All Rights Reserved.<br />
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;*<br />
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;* Original Author:&nbsp; Jesse Freeman<br />
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;*<br />
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;* Revisions <br />
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;* &nbsp; &nbsp; 0.1&nbsp; Initial version 05-08-2008<br />
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;*<br />
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;**/</span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">import</span> flash.<span class="me1">utils</span>.<span class="me1">Dictionary</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">class</span> XMLTypeHelper<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw3">static</span> const <span class="kw3">STRING</span>:String = <span class="st0">&#8220;string&#8221;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw3">static</span> const <span class="kw3">NUMBER</span>:<span class="kw3">String</span> = <span class="st0">&#8220;number&#8221;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw3">static</span> const <span class="kw3">ARRAY</span>:<span class="kw3">String</span> = <span class="st0">&#8220;array&#8221;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw3">static</span> const <span class="kw3">BOOLEAN</span>:<span class="kw3">String</span> = <span class="st0">&#8220;boolean&#8221;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw3">static</span> const ASSOCIATE_ARRAY:<span class="kw3">String</span> = <span class="st0">&#8220;associate_array&#8221;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw3">static</span> const DICTIONARY:<span class="kw3">String</span> = <span class="st0">&#8220;dictionary&#8221;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw3">static</span> const <span class="kw3">COLOR</span>:<span class="kw3">String</span> = <span class="st0">&#8220;color&#8221;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">var</span> unknown_type_handler:<span class="kw2">Function</span> = <span class="kw2">null</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">function</span> XMLTypeHelper<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">trace</span><span class="br0">&#40;</span><span class="st0">&#8220;Alert: New XMLTypeHelper has been created.&#8221;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">function</span> get_type<span class="br0">&#40;</span><span class="kw3">data</span>:<span class="kw3">String</span>, <span class="kw3">type</span>:<span class="kw3">String</span><span class="br0">&#41;</span>:*<span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">switch</span><span class="br0">&#40;</span><span class="kw3">type</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;<span class="kw1">case</span> <span class="kw3">STRING</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="kw1">return</span> <span class="kw3">data</span>.<span class="kw3">toString</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="kw1">break</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;<span class="kw1">case</span> <span class="kw3">NUMBER</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="kw1">return</span> <span class="kw3">Number</span><span class="br0">&#40;</span><span class="kw3">data</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="kw1">break</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;<span class="kw1">case</span> <span class="kw3">ARRAY</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="kw2">var</span> temp_array:<span class="kw3">Array</span> = <span class="kw3">data</span>.<span class="kw3">toString</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="kw3">split</span><span class="br0">&#40;</span><span class="st0">&#8220;,&#8221;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="kw1">return</span> temp_array;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="kw1">break</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;<span class="kw1">case</span> <span class="kw3">BOOLEAN</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="kw1">return</span> string_to_boolean<span class="br0">&#40;</span><span class="kw3">data</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="kw1">break</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;<span class="kw1">case</span> ASSOCIATE_ARRAY:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp; &nbsp; <span class="kw1">return</span> parse_complex_array<span class="br0">&#40;</span><span class="kw3">data</span>,ASSOCIATE_ARRAY<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp; &nbsp; <span class="kw1">break</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;<span class="kw1">case</span> DICTIONARY:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp; &nbsp; <span class="kw1">return</span> parse_complex_array<span class="br0">&#40;</span><span class="kw3">data</span>,DICTIONARY<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp; &nbsp; <span class="kw1">break</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;<span class="kw1">case</span> <span class="kw3">COLOR</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp; &nbsp; <span class="kw1">return</span> <span class="kw3">Number</span><span class="br0">&#40;</span><span class="kw3">data</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp; &nbsp; <span class="kw1">break</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;<span class="kw2">default</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="kw1">if</span><span class="br0">&#40;</span>unknown_type_handler != <span class="kw2">null</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> unknown_type_handler<span class="br0">&#40;</span><span class="kw3">data</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="kw1">else</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="kw3">data</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="kw1">break</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">function</span> parse_complex_array<span class="br0">&#40;</span><span class="kw3">data</span>:<span class="kw3">String</span>, return_type:<span class="kw3">String</span>,data_delimiter:<span class="kw3">String</span> = <span class="st0">&#8220;,&#8221;</span> ,prop_delimiter:<span class="kw3">String</span> = <span class="st0">&#8220;:&#8221;</span><span class="br0">&#41;</span>:*<span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> data_container:*;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// Switch Statement</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">switch</span> <span class="br0">&#40;</span>return_type<span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">case</span> ASSOCIATE_ARRAY:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; data_container = <span class="kw2">new</span> <span class="kw3">Array</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">break</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">case</span> DICTIONARY:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; data_container = <span class="kw2">new</span> Dictionary<span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">break</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> <span class="kw3">list</span>:<span class="kw3">Array</span> = <span class="kw3">data</span>.<span class="kw3">split</span><span class="br0">&#40;</span>data_delimiter<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> total:<span class="kw3">Number</span> = <span class="kw3">list</span>.<span class="kw3">length</span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">for</span> <span class="br0">&#40;</span><span class="kw2">var</span> i : <span class="kw3">Number</span> = <span class="nu0">0</span>; i &lt; total; i++<span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> prop:<span class="kw3">Array</span> = <span class="kw3">list</span><span class="br0">&#91;</span>i<span class="br0">&#93;</span>.<span class="kw3">split</span><span class="br0">&#40;</span>prop_delimiter<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; data_container<span class="br0">&#91;</span>prop<span class="br0">&#91;</span><span class="nu0">0</span><span class="br0">&#93;</span><span class="br0">&#93;</span> = prop<span class="br0">&#91;</span><span class="nu0">1</span><span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> data_container;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="coMULTI">/**<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; */</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">function</span> string_to_boolean<span class="br0">&#40;</span>value:<span class="kw3">String</span><span class="br0">&#41;</span>:<span class="kw3">Boolean</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="br0">&#40;</span>value == <span class="st0">&#8220;true&#8221;</span><span class="br0">&#41;</span> ? <span class="kw2">true</span> : <span class="kw2">false</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
<span class="br0">&#125;</span></div>
</div>
<p>So this is a really simple class. It basically converts values read in from an XML file and converts them into typed valued base on the attribute type. Nothing really special here, in fact I was using something similar to this set of functions in my <a href="http://flashartofwar.com/2007/07/13/as-3-settings-utility/">AS 3 Setting Utility</a>. So why break this out into is own class?</p>
<p>Part of writing truly OOP code is being able to break out reusable functions into other classes. Also now with all this code taken out of the setting utility I can keep adding to it and have the logic in one self contained place outside of the class that needs it. I can also configure this class&#8217;s instance based on the situation it is needed in.</p>
<p>Now there is a special property called public var unknown_type_handler:Function = null;. This allows you to map a custom function to be called when the util doesn&#8217;t know what the data&#8217;s type should be. Here is an example of how to use it.</p>
<div class="codesnip-container" >
<div class="codesnip"><span class="kw2">var</span> typer = <span class="kw2">new</span> XMLTypeHelper<span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; typer.<span class="me1">unknown_type_handler</span> = special_type_converter;</p>
<p>. . .</p>
<p><span class="me1">internal</span> <span class="kw2">function</span> special_type_converter<span class="br0">&#40;</span><span class="kw3">data</span>:*<span class="br0">&#41;</span>:*<span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">switch</span><span class="br0">&#40;</span><span class="kw3">data</span>.@<span class="kw3">type</span>.<span class="kw3">toString</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">case</span> <span class="st0">&#8220;Option A&#8221;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp; &nbsp; <span class="kw1">return</span> <span class="kw2">null</span> <span class="co1">// Handle Option A Here;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp; &nbsp; <span class="kw1">break</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;<span class="kw1">case</span> <span class="st0">&#8220;Option B&#8221;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp; &nbsp; <span class="kw1">return</span> <span class="kw2">null</span> <span class="co1">// Handle Option B Here;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp; &nbsp; <span class="kw1">break</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></div>
</div>
<p>One last thing I am proud of in this class is the converter to Associated Array and Dictionary. When you supply xml that is comma delimited with colons dividing prop name and value, this class will give you back a parsed Array or Dictionary. Here is an example of what the data node would look like:</p>
<div class="codesnip-container" >
<div class="codesnip"><span class="sc3"><span class="re1">&lt;item</span> <span class="re0">type</span>=<span class="st0">&#8220;dictionary&#8221;</span><span class="re2">&gt;</span></span>hello:world,this_is:great<span class="sc3"><span class="re1">&lt;/item<span class="re2">&gt;</span></span></span></div>
</div>
<p>This class is still under the microscope at Heavy so in it&#8217;s final state I expect it to be a little cleaner, and less buggy (if any exist let me know). I&#8217;ll be posting more of my Helper Classes as soon as I get stable. So far I have several that range from creating 9 slices from bitmaps to class finders and a few others. Hope you enjoy!</p>
<p>Oh, and make sure you visit <a href="http://heavy.com">Heavy.com</a> to see more of my work and click on a few ads to keep the lights on in my office.</p>
]]></content:encoded>
			<wfw:commentRss>http://flashartofwar.com/2008/05/13/helper-class/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Nice Flex Site</title>
		<link>http://flashartofwar.com/2008/05/11/nice-flex-site/</link>
		<comments>http://flashartofwar.com/2008/05/11/nice-flex-site/#comments</comments>
		<pubDate>Sun, 11 May 2008 17:00:03 +0000</pubDate>
		<dc:creator>FlashBum</dc:creator>
		
		<category><![CDATA[Laying Plans]]></category>

		<guid isPermaLink="false">http://flashartofwar.com/?p=99</guid>
		<description><![CDATA[I have not been a big fan of Flex sites. For the most part they all look alike and the component framework lets developers get away with creating something and not needed to have a single design bone in their body. My opinion changed after I found this site grooveshark.com. This link goes to the [...]]]></description>
			<content:encoded><![CDATA[<p>I have not been a big fan of Flex sites. For the most part they all look alike and the component framework lets developers get away with creating something and not needed to have a single design bone in their body. My opinion changed after I found this site <a href="http://listen.grooveshark.com/">grooveshark.com</a>. This link goes to the lite player but the <a href="http://listen.grooveshark.com/">main site</a> is worth a look over too.
<p>
<span id="more-99"></span></p>
<p align="center"><a href='http://flashartofwar.com/wp-content/uploads/2008/05/grooveshark.jpg' rel="lightbox"><br />
<img src="http://flashartofwar.com/wp-content/uploads/2008/05/grooveshark-150x150.jpg" alt="This is a screen shot of the Flex App" title="grooveshark lite" width="150" height="150" class="aligncenter size-thumbnail wp-image-100" /></a><br/><small>Here is a screen of the app.</small></p>
<p>I have finally been inspired to break out a Flex 3 project and try my hand at it. To bad I still can&#8217;t get over the ~200k+ of added wight the Flex Framework adds to your app. Sorry Adobe, letting the <a href="http://www.onflex.org/ted/2008/01/flex-3-framework-caching.php">player cache the framework</a> on people&#8217;s computer still doesn&#8217;t make it better.</p>
<p>On a side note, after showing the site to <a href="http://www.hiddentrak.com/">Myles</a> he pointed me out to a few resources that have &#8220;skined&#8221; UI components for Flex. <a href="http://www.yswfblog.com/blog/2007/12/13/yahoo-and-flex-feel-good-in-your-own-skin/">This one</a> from Yahoo looks like what <a href="http://www.grooveshark.com/">Grooveshark</a> based their design off of. Here is another <a href="http://www.scalenine.com/">link</a> to some more great Flex skins.</p>
]]></content:encoded>
			<wfw:commentRss>http://flashartofwar.com/2008/05/11/nice-flex-site/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Letter Particle Generator</title>
		<link>http://flashartofwar.com/2008/05/10/letter-particle-generator/</link>
		<comments>http://flashartofwar.com/2008/05/10/letter-particle-generator/#comments</comments>
		<pubDate>Sat, 10 May 2008 16:33:30 +0000</pubDate>
		<dc:creator>FlashBum</dc:creator>
		
		<category><![CDATA[Strategic Attack]]></category>

		<guid isPermaLink="false">http://flashartofwar.com/?p=94</guid>
		<description><![CDATA[A little while back a friend of mine asked me to help him put the finishing touches on a jewelry site he was having built. They wanted to take the existing AS 2 site and connect it to my FlashBaker Admin panel and clean up a few things as well. Since I detest AS 2 [...]]]></description>
			<content:encoded><![CDATA[<p>A little while back a friend of mine asked me to help him put the finishing touches on a <a href="http://typeoflove.com">jewelry site</a> he was having built. They wanted to take the existing AS 2 site and connect it to my FlashBaker Admin panel and clean up a few things as well. Since I detest AS 2 at this point I felt it would be better to just port the entire site over to AS 3. While I did that, I overhauled this Letter Particle Effect that was being used on the site. I thought I would release the source code to the particle system and hopefully drum up some traffic to his site <a href="http://TypeOfLove.com">TypeOfLove.com</a>.</p>
<p><span id="more-94"></span></p>
<p>So you can see the full effect on <a href="http://TypeOfLove.com">typeoflove.com</a>. Warning that the site is still alittle buggy. I had to port the entire thing over in a few days so it is still missing that &#8220;FlashBum&#8221; polish I normally put into a site. Here is an image of the effect.</p>
<p><img src='http://flashartofwar.com/wp-content/uploads/2008/05/tol_detail_1.jpg' alt='TOL Letter Detail 1' /></p>
<p>So I thought for this round instead of posting all 6 classes of code I let you download the <a href="/wp-content/uploads/2008/05/faow_letters_source.zip">source files</a> and let you play around with it on your own. For those interested, I will highlight a few of the important parts of the code and discuss a little about this partical system and what you can do to customize it. Here is a sample of the demo swf:</p>
<p>
<object type="application/x-shockwave-flash" width="450" height="400">
<param name="movie" value="/wp-content/uploads/2008/05/letters.swf" />
<embed src="/wp-content/uploads/2008/05/letters.swf" type="application/x-shockwave-flash" width="450" height="400" >
</object>
</p>
<p>Lets start with how you create a &#8220;generator&#8221;. In this example there is one class (controller) that manages instances of particles (Letters and Dust) and has the power to start and stop them. In the source file, if you look in the FLA you will see this code:</p>
<div class="codesnip-container" >
<div class="codesnip"><span class="kw3">import</span> com.<span class="me1">tol</span>.<span class="me1">letters</span>.*;</p>
<p><span class="kw2">var</span> config:GeneratorConfig = <span class="kw2">new</span> GeneratorConfig<span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; config.<span class="kw3">width</span> = <span class="nu0">400</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; config.<span class="kw3">height</span> = <span class="nu0">300</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; config.<span class="me1">letters</span> = <span class="kw2">new</span> <span class="kw3">Array</span><span class="br0">&#40;</span><span class="st0">&#8220;a&#8221;</span>, <span class="st0">&#8220;b&#8221;</span>, <span class="st0">&#8220;c&#8221;</span>, <span class="st0">&#8220;d&#8221;</span>, <span class="st0">&#8220;e&#8221;</span>, <span class="st0">&#8220;f&#8221;</span>, <span class="st0">&#8220;g&#8221;</span>, <span class="st0">&#8220;h&#8221;</span>, <span class="st0">&#8220;i&#8221;</span>, <span class="st0">&#8220;j&#8221;</span>, <span class="st0">&#8220;k&#8221;</span>, <span class="st0">&#8220;l&#8221;</span>, <span class="st0">&#8220;m&#8221;</span>, <span class="st0">&#8220;n&#8221;</span>, <span class="st0">&#8220;o&#8221;</span>, <span class="st0">&#8220;p&#8221;</span>, <span class="st0">&#8220;q&#8221;</span>, <span class="st0">&#8220;r&#8221;</span>, <span class="st0">&#8220;s&#8221;</span>, <span class="st0">&#8220;t&#8221;</span>, <span class="st0">&#8220;u&#8221;</span>, <span class="st0">&#8220;v&#8221;</span>, <span class="st0">&#8220;w&#8221;</span>, <span class="st0">&#8220;x&#8221;</span>, <span class="st0">&#8220;y&#8221;</span>, <span class="st0">&#8220;z&#8221;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; config.<span class="me1">max_particles</span> = <span class="nu0">25</span>;</p>
<p><span class="kw2">var</span> gen:Generator = <span class="kw2">new</span> Generator<span class="br0">&#40;</span>config<span class="br0">&#41;</span>;<br />
addChild<span class="br0">&#40;</span>gen<span class="br0">&#41;</span>;</p>
<p>gen.<span class="kw3">start</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;</div>
</div>
<p>As you can see the generator needs a config class. Some of the important properties to look at are the width, height, and charactes. The characters array allows you to create particals out of any text character. This is the display of the paticals. There are two type of particals, Letters and Dust. A letter partical is the base partical class. It generates a display randomly from the list of characters. Once the display is set, it then begins to move itself based on a predetruming set of variables and random multipliers. Lets look at this a little further.</p>
<p>Letters need to do the following things:</p>
<ul>
<li>Move from x0 (Start) to x1 (End).</li>
<li>When it reaches x1 it needs to restart back at x0.</li>
<li>It needs to be a random size, alpha, and rotation.</li>
<li>As it move its needs to not only rotate but also grow or shrink in size and move in a curve. (letters are designed to move like leafs in the wind.</li>
</ul>
<p>Dust is an extension of the letter particle. It has the same kind of display and uses the same character list. The only difference is the following:</p>
<ul>
<li>Dust is always a fixed size and rotation.</li>
<li>Dust moves from straight and has no curve or arc.</li>
<li>Dust moves a lot faster then Letters, it is more like a bullet across the screen.</li>
</ul>
<p>So all the particals have a custom config file that has specal setting for each type of partical. This allows you to customize the speed, rotation, character of each and let the class handle any custom logic needed to run. The Generator is unaware of the specifics of the partical, it just needs to know how to turn it on and off. And so the partical engine is a nice modular collection of code following some basic (hacked in) OOP ideas.</p>
<p>Here is a sample of the 3 main functions to move, rotate and scale the particals
<div class="codesnip-container" >
<div class="codesnip"><span class="coMULTI">/**<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; *&nbsp; &nbsp; &nbsp; Moves partical based on a its speed.<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; */</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; protected <span class="kw2">function</span> move<span class="br0">&#40;</span><span class="br0">&#41;</span>:<span class="kw3">void</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> distancex = _target_x - x;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> move_x = distancex/<span class="nu0">2</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>x &gt; <span class="nu0">890</span> || x &lt; <span class="nu0">0</span><span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _x_speed *= -.<span class="nu0">3</span>;&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>y &lt; <span class="nu0">500</span> || y &gt; <span class="nu0">0</span><span class="br0">&#41;</span> &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _y_speed *= -.<span class="nu0">07</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>x &gt; <span class="nu0">920</span> || y &lt; <span class="nu0">2</span> || y &gt; <span class="nu0">500</span> || _display.<span class="me1">alpha</span> &lt; <span class="nu0">0</span><span class="br0">&#41;</span>&nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; disappear<span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>x &gt; <span class="nu0">750</span> || y &gt;<span class="nu0">490</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _display.<span class="me1">alpha</span> -= .<span class="nu0">10</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// Update X,Y</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; x += move_x/_x_speed;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; y += _y_speed;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="coMULTI">/**<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; *&nbsp; &nbsp; &nbsp; Increments the partical&#8217;s rotation.<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; */</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; protected <span class="kw2">function</span> rotate<span class="br0">&#40;</span>value:<span class="kw3">Number</span><span class="br0">&#41;</span>:<span class="kw3">void</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rotation += value;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="coMULTI">/**<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; *&nbsp; &nbsp; &nbsp; Calculates size of the partical<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; */</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; protected <span class="kw2">function</span> <span class="kw3">size</span><span class="br0">&#40;</span><span class="br0">&#41;</span>:<span class="kw3">void</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>_display.<span class="me1">scaleX</span> &lt; <span class="nu0">100</span><span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _display.<span class="me1">scaleX</span> += .<span class="nu0">03</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _display.<span class="me1">scaleY</span> += .<span class="nu0">02</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><span class="kw1">else</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _display.<span class="me1">scaleX</span> -= .<span class="nu0">02</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _display.<span class="me1">scaleY</span> -= .<span class="nu0">01</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></div>
</div>
<p>What is next? If this was something I had built from the ground up I would have broken things down a little further. It is always better to type classes to a interface or abstract class. Here I probably would have done both. There should be an IPartical interface along with a base partical class I would probably call AbstractPartical. The generator would have its particals types to the Interface, and the Letters and Dust would extend off of the AbstractPartical Class. Things like this are overkill in a small &#8220;static&#8221; website environment with predefined rules but if I wanted to change this up or reuse it in another project the extra effort to use Abstarct Classes and Interface would really pay off.</p>
<p>Also the way I handle the movement loop blows. I am not a big fan of enterframe loops at this stage of the game but when you need to get something up and running ASAP they are a good cop out. It is always important to weigh out the cost of what you are doing verses the time you have to do it in. I noticed a slight performance hit on the motion and I think that I could have done a better job of making things move faster and require less processor.</p>
<p>I find particle systems really interesting and fun to play with. Its amazing how you can take something so simple and get it to yield such complicated visual effects. The master of Flash Particals in my opinion is <a href="http://www.sebleedelisle.com/">Seb Lee-Delisle</a><sup><a href="#footnote-1-94" id="footnote-link-1-94" class="footnote-link footnote-identifier-link" title="Self proclaimed Flash ambassador for Brighton">1</a></sup> over at <a href="http://www.pluginmedia.net/">Plug-In Media</a>. The man is a mad genius and I had the please of not only being at his presentation at <a href="http://flashbelt.com">FlashBelt</a> last year but also got in a few <a href="http://www.flickr.com/photos/19291087@N00/575466500/in/photostream/">drinks/karaoke songs</a><sup><a href="#footnote-2-94" id="footnote-link-2-94" class="footnote-link footnote-identifier-link" title="I am in the middle in the hat and Seb is on my left (Right of the photo) in green along with everyone else from the conference">2</a></sup>. Take a look at his <a href="http://www.sebleedelisle.com/">blog</a> if you want to learn more about some of the cool effects you can achieve in Flash with particles.</p>
<ol start="1" class="footnotes"><li id="footnote-1-94" class="footnote">Self proclaimed Flash ambassador for Brighton [<a href="#footnote-link-1-94" class="footnote-link footnote-back-link">&#8617;</a>]</li><li id="footnote-2-94" class="footnote">I am in the middle in the hat and Seb is on my left (Right of the photo) in green along with everyone else from the conference [<a href="#footnote-link-2-94" class="footnote-link footnote-back-link">&#8617;</a>]</li></ol>]]></content:encoded>
			<wfw:commentRss>http://flashartofwar.com/2008/05/10/letter-particle-generator/feed/</wfw:commentRss>
		</item>
		<item>
		<title>flashlog.txt for trace();</title>
		<link>http://flashartofwar.com/2008/05/03/flashlogtxt-for-trace/</link>
		<comments>http://flashartofwar.com/2008/05/03/flashlogtxt-for-trace/#comments</comments>
		<pubDate>Sat, 03 May 2008 21:43:01 +0000</pubDate>
		<dc:creator>FlashBum</dc:creator>
		
		<category><![CDATA[Laying Plans]]></category>

		<guid isPermaLink="false">http://flashartofwar.com/?p=89</guid>
		<description><![CDATA[In this post I talked about how I see trace comments in my console (on Mac OS X) and a few people were interested in how I set that up. Here is some info to help you out.

Before you do anything make sure you install the Debug Player for Flash 9.0.xxx (what ever the version [...]]]></description>
			<content:encoded><![CDATA[<p>In this <a href="http://flashartofwar.com/?p=88">post</a> I talked about how I see trace comments in my console (on Mac OS X) and a few people were interested in how I set that up. Here is some info to help you out.</p>
<p><span id="more-89"></span></p>
<p>Before you do anything make sure you install the <a href="http://www.adobe.com/support/flashplayer/downloads.html">Debug Player for Flash 9.0.xxx</a> (what ever the version is this week). You will see the link for it down the page a little under <b>Adobe Flash Player 9 — Debugger Versions</b>. If you do not have this installed you will not be able get any of this to work. Here is a screen shot to show you how you will know if you the Debug Player installed.</p>
<p><img src='http://flashartofwar.com/wp-content/uploads/2008/05/debugger.jpg' alt='Debugger Player' /></p>
<p><small>When you right click on any Flash SWF in your browser you should see the words &#8220;<b>debugger</b>&#8221; in the context menu.</small></p>
<p>Once I had the Debug Player installed, I set all this up with <a href="http://macromates.com/">Textmate</a> and the excellent bundle from <a href="http://blog.simongregory.com/10/textmate-actionscript-3-and-flex-bundles/">here</a>. Here are a few screens from the debug the options you need to click on to get it working.
<p>
<img src='http://flashartofwar.com/wp-content/uploads/2008/05/as3_debug_1.jpg' alt='as3_debug_1.jpg' /></p>
<p><small>This is the bundle I am using, you can download it <a href="http://blog.simongregory.com/10/textmate-actionscript-3-and-flex-bundles">here</a></small></p>
<p><img src='http://flashartofwar.com/wp-content/uploads/2008/05/as3_debug_2.jpg' alt='as3_debug_2.jpg' /></p>
<p><small>These are the debug options. I clicked on all of them starting with &#8220;Format fsch&#8230;&#8221;, &#8220;Install mm.cfg&#8221;, then &#8220;Opne flashlog.txt&#8230;&#8221;</small></p>
<p>Also you should check out this really great <a href="http://blog.flexexamples.com/2007/08/26/debugging-flex-applications-with-mmcfg-and-flashlogtxt/">post</a> from <a href="http://blog.flexexamples.com">http://blog.flexexamples.com</a>. It does an excelent job of walking you through how to manually set this up on a Mac and a PC.</p>
<p>Here is a screen from my Mac Console window reading off of the flashlog.txt file. Its not at fast as the Flash IDE output window but for day to day development it is a life saver.</p>
<p><img src='http://flashartofwar.com/wp-content/uploads/2008/05/console_log.jpg' alt='Console Log Trace Outputs' /></p>
<p><small>Nice, look at all those cool traces!</small></p>
<p>One last thing, I found this <a href="http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_19323">link</a> on google by <a href="http://www.google.com/search?client=safari&#038;rls=en-us&#038;q=mm.cfg&#038;ie=UTF-8&#038;oe=UTF-8">searching for &#8220;mm.cfg&#8221;</a> and it talks about trouble shooting.</p>
]]></content:encoded>
			<wfw:commentRss>http://flashartofwar.com/2008/05/03/flashlogtxt-for-trace/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Random Coolness</title>
		<link>http://flashartofwar.com/2008/05/01/random-coolness/</link>
		<comments>http://flashartofwar.com/2008/05/01/random-coolness/#comments</comments>
		<pubDate>Thu, 01 May 2008 15:02:53 +0000</pubDate>
		<dc:creator>FlashBum</dc:creator>
		
		<category><![CDATA[Laying Plans]]></category>

		<guid isPermaLink="false">http://flashartofwar.com/?p=88</guid>
		<description><![CDATA[I use the Flash Debug Player and have set it up to output all traces out to the console on the mac to help with all my debugging. This is great to see traces outside of the Flash IDE without the need of any extra software or custom built solution. I tend to leave it [...]]]></description>
			<content:encoded><![CDATA[<p>I use the Flash Debug Player and have set it up to output all traces out to the console on the mac to help with all my debugging. This is great to see traces outside of the Flash IDE without the need of any extra software or custom built solution. I tend to leave it open a lot and when I visit other Flash sites I wind up seeing any traces that had not been removed. Well this morning while I was just surfing the web I went back to my console and saw this:</p>
<p><span id="more-88"></span></p>
<div class="codesnip-container" >
<div class="codesnip">Showplayer initializing&#8230;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;__&#8212;__<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _-&nbsp; &nbsp; &nbsp; &nbsp;_&#8211;______<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;__&#8211;<span class="br0">&#40;</span> /&nbsp; &nbsp; &nbsp;\<span class="br0">&#41;</span>XXXXXXXXXXXXX_<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#8211;XXX<span class="br0">&#40;</span>&nbsp; &nbsp;O&nbsp; &nbsp;O&nbsp; <span class="br0">&#41;</span>XXXXXXXXXXXXXXX-<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /XXX<span class="br0">&#40;</span>&nbsp; &nbsp; &nbsp; &nbsp;U&nbsp; &nbsp; &nbsp;<span class="br0">&#41;</span>&nbsp; &nbsp; &nbsp; &nbsp; XXXXXXX\<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /XXXXX<span class="br0">&#40;</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#41;</span>&#8211;_&nbsp; XXXXXXXXXXX\<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/XXXXX/ <span class="br0">&#40;</span>&nbsp; &nbsp; &nbsp; O&nbsp; &nbsp; &nbsp;<span class="br0">&#41;</span>&nbsp; &nbsp;XXXXXX&nbsp; &nbsp;\XXXX\<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;XXXXX/&nbsp; &nbsp;/&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; XXXXXX&nbsp; &nbsp;\_ \XXXX&#8212;-<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;XXXXXX__/&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; XXXXXX&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\_&#8212;-&nbsp; -<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#8212;___&nbsp; XXX__/&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; XXXXXX&nbsp; &nbsp; &nbsp; \_&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#8212;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#8211;&nbsp; &#8211;__/&nbsp; &nbsp;___/\ XXXXXX&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /&nbsp; ___&#8212;=<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;-_&nbsp; &nbsp; ___/&nbsp; &nbsp; XXXXXX&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&#8216;&#8212; XXXXXX<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#8211;<span class="es0">\X</span>XX<span class="es0">\X</span>XXXXX&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /XXXXX<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="es0">\X</span>XXXXXXX&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /XXXXX/<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="es0">\X</span>XXXX&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _/XXXXX/<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="es0">\X</span>XXX&#8211;__/&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; __&#8211; XXXX/<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#8211;XXXXXXX&#8212;&#8212;&#8212;&#8212;&#8212;&nbsp; XXXXX&#8211;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="es0">\X</span>XXXXXXXXXXXXXXXXXXXXXX-<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8211;XXXXXXXXXXXXXXXXXX-<br />
render 115 </span></div>
</div>
<p>Unfortunately I don&#8217;t remember what I was looking at but who ever the developer that added this into the traces is my hero! Got me thinking of how to keep traces in some of my apps to add notes to other developers as a running joke. Anyone else do stuff like this?</p>
]]></content:encoded>
			<wfw:commentRss>http://flashartofwar.com/2008/05/01/random-coolness/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Useless Getters/Setters</title>
		<link>http://flashartofwar.com/2008/04/26/useless-getterssetters/</link>
		<comments>http://flashartofwar.com/2008/04/26/useless-getterssetters/#comments</comments>
		<pubDate>Sat, 26 Apr 2008 14:18:51 +0000</pubDate>
		<dc:creator>FlashBum</dc:creator>
		
		<category><![CDATA[Strategic Attack]]></category>

		<guid isPermaLink="false">http://flashartofwar.com/?p=86</guid>
		<description><![CDATA[Part of building my new Framework revolves around optimization (Code, Size, and Speed). One of the quickest optimizations I have done is removing all the useless getters and setters and instead replace them with public vars.

I use to be a big believer in always using a getter/setter to access class variables. In my mind it [...]]]></description>
			<content:encoded><![CDATA[<p>Part of building my new Framework revolves around optimization (Code, Size, and Speed). One of the quickest optimizations I have done is removing all the useless getters and setters and instead replace them with public vars.</p>
<p><span id="more-86"></span></p>
<p>I use to be a big believer in always using a getter/setter to access class variables. In my mind it kept the class protected from other classes and allowed me to bake in additional logic into the getters/setters to validate the data passed into them. Well when I went back over my code and saw I had dozens of these things that simply exposed a private variable and did little else I realized how much of a wast that really was.</p>
<p>For a few years I never used a single public variable, now I find myself going back and once I remove the getters and setters, I can simply turn the private variables into a public one and the code rarely needs any more re factoring. Lets see an example:</p>
<p>This is my AS 3 Config class I posted a little while ago <a href="http://flashartofwar.com/?p=66">here</a>.</p>
<div class="codesnip-container" >
<div class="codesnip">package com.<span class="me1">jessefreeman</span>.<span class="me1">configs</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">import</span> flash.<span class="me1">events</span>.<span class="me1">EventDispatcher</span>;&nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="coMULTI">/**<br />
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * @author jessefreeman<br />
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * Use this as a base class for any configuration objects. It has built in support for a few basic values but should be extended to meet the needs of your application.<br />
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; */</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">class</span> AbstractConfig <span class="kw3">extends</span> EventDispatcher <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="coMULTI">/** Some Default variables **/</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; protected <span class="kw2">var</span> <span class="kw3">_name</span> : <span class="kw3">String</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; protected <span class="kw2">var</span> <span class="kw3">_x</span> : <span class="kw3">Number</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; protected <span class="kw2">var</span> <span class="kw3">_y</span> : <span class="kw3">Number</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; protected <span class="kw2">var</span> <span class="kw3">_width</span> : <span class="kw3">Number</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; protected <span class="kw2">var</span> <span class="kw3">_height</span> : <span class="kw3">Number</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; protected <span class="kw2">var</span> <span class="kw3">_alpha</span> : <span class="kw3">Number</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; protected <span class="kw2">var</span> <span class="kw3">_rotation</span> : <span class="kw3">Number</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; protected <span class="kw2">var</span> _debug : <span class="kw3">Boolean</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="coMULTI">/**<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * Get function for _name.<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * @return _name : String<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; */</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">function</span> <span class="kw3">get</span> <span class="kw3">name</span> <span class="br0">&#40;</span><span class="br0">&#41;</span> : <span class="kw3">String</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="kw3">_name</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="coMULTI">/**<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * Set function for _name. <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * @param value : String<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; */</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">function</span> <span class="kw3">set</span> <span class="kw3">name</span> <span class="br0">&#40;</span>value : <span class="kw3">String</span><span class="br0">&#41;</span>:<span class="kw3">void</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">_name</span> = value;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="coMULTI">/**<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * Get function for _x.<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * @return _x : Number<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; */</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">function</span> <span class="kw3">get</span> x <span class="br0">&#40;</span><span class="br0">&#41;</span> : <span class="kw3">Number</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="kw3">_x</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="coMULTI">/**<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * Set function for _x. <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * @param value : Number<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; */</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">function</span> <span class="kw3">set</span> x <span class="br0">&#40;</span>value : <span class="kw3">Number</span><span class="br0">&#41;</span>:<span class="kw3">void</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">_x</span> = value;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="coMULTI">/**<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * Get function for _y.<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * @return _y : Number<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; */</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">function</span> <span class="kw3">get</span> y <span class="br0">&#40;</span><span class="br0">&#41;</span> : <span class="kw3">Number</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="kw3">_y</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="coMULTI">/**<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * Set function for _y. <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * @param value : Number<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; */</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">function</span> <span class="kw3">set</span> y <span class="br0">&#40;</span>value : <span class="kw3">Number</span><span class="br0">&#41;</span>:<span class="kw3">void</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">_y</span> = value;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="coMULTI">/**<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * Get function for _width.<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * @return _width : Number<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; */</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">function</span> <span class="kw3">get</span> <span class="kw3">width</span> <span class="br0">&#40;</span><span class="br0">&#41;</span> : <span class="kw3">Number</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="kw3">_width</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="coMULTI">/**<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * Set function for _width. <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * @param value : Number<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; */</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">function</span> <span class="kw3">set</span> <span class="kw3">width</span> <span class="br0">&#40;</span>value : <span class="kw3">Number</span><span class="br0">&#41;</span>:<span class="kw3">void</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">_width</span> = value;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="coMULTI">/**<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * Get function for _height.<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * @return _height : Number<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; */</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">function</span> <span class="kw3">get</span> <span class="kw3">height</span> <span class="br0">&#40;</span><span class="br0">&#41;</span> : <span class="kw3">Number</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="kw3">_height</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="coMULTI">/**<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * Set function for _height. <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * @param value : Number<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; */</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">function</span> <span class="kw3">set</span> <span class="kw3">height</span> <span class="br0">&#40;</span>value : <span class="kw3">Number</span><span class="br0">&#41;</span>:<span class="kw3">void</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">_height</span> = value;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="coMULTI">/**<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * Get function for _alpha.<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * @return _alpha : Number<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; */</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">function</span> <span class="kw3">get</span> alpha <span class="br0">&#40;</span><span class="br0">&#41;</span> : <span class="kw3">Number</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="kw3">_alpha</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="coMULTI">/**<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * Set function for _alpha. <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * @param value : Number<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; */</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">function</span> <span class="kw3">set</span> alpha <span class="br0">&#40;</span>value : <span class="kw3">Number</span><span class="br0">&#41;</span>:<span class="kw3">void</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">_alpha</span> = value;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="coMULTI">/**<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * Get function for _rotation.<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * @return _rotation : Number<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; */</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">function</span> <span class="kw3">get</span> rotation <span class="br0">&#40;</span><span class="br0">&#41;</span> : <span class="kw3">Number</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="kw3">_rotation</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="coMULTI">/**<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * Set function for _rotation. <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * @param value : Number<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; */</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">function</span> <span class="kw3">set</span> rotation <span class="br0">&#40;</span>value : <span class="kw3">Number</span><span class="br0">&#41;</span>:<span class="kw3">void</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">_rotation</span> = value;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="coMULTI">/**<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * Get function for _debug.<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * @return _debug : Boolean<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; */</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">function</span> <span class="kw3">get</span> debug <span class="br0">&#40;</span><span class="br0">&#41;</span>: <span class="kw3">Boolean</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> _debug;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="coMULTI">/**<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * Set function for _debug. <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * @param value : Boolean<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; */</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">function</span> <span class="kw3">set</span> debug <span class="br0">&#40;</span>value: <span class="kw3">Boolean</span><span class="br0">&#41;</span>:<span class="kw3">void</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _debug = value;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="coMULTI">/**<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * Constructor<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; */</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">function</span> AbstractConfig<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//Add custom logic here if needed</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
<span class="br0">&#125;</span></div>
</div>
<h3>vs</h3>
<p>This is the config class I am now using:</p>
<div class="codesnip-container" >
<div class="codesnip">package com.<span class="me1">jessefreeman</span>.<span class="me1">configs</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">class</span> AbstractConfig <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">var</span> <span class="kw3">name</span> : <span class="kw3">String</span> = <span class="st0">&#8220;untitled&#8221;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">var</span> x : <span class="kw3">Number</span> = <span class="nu0">0</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">var</span> y : <span class="kw3">Number</span> = <span class="nu0">0</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">var</span> <span class="kw3">width</span> : <span class="kw3">Number</span> = <span class="nu0">0</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">var</span> <span class="kw3">height</span> : <span class="kw3">Number</span> = <span class="nu0">0</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">var</span> alpha : <span class="kw3">Number</span> = <span class="nu0">1</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">var</span> rotation : <span class="kw3">Number</span> = <span class="nu0">0</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">var</span> debug : <span class="kw3">Boolean</span> = <span class="kw2">false</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">var</span> base_url:<span class="kw3">String</span> = <span class="st0">&#8220;/&#8221;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="coMULTI">/**<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * Constructor<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; */</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">public</span> <span class="kw2">function</span> AbstractConfig<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// Does nothing</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
<span class="br0">&#125;</span></div>
</div>
<p>Big difference right? Sometimes the hardest part of optimizing is knowing where and when to &#8220;edit&#8221; your code. Here is a link to a <a href="http://blogs.adobe.com/aharui/2007/10/actionscript_readwrite_perform_1.html">really good article</a> about the speeds of accessing variables from classes and how they range from getters/setters, sealed, dynamic and proxy classes.</p>
]]></content:encoded>
			<wfw:commentRss>http://flashartofwar.com/2008/04/26/useless-getterssetters/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Google Analytics Bug?</title>
		<link>http://flashartofwar.com/2008/04/24/google-analytics-bug/</link>
		<comments>http://flashartofwar.com/2008/04/24/google-analytics-bug/#comments</comments>
		<pubDate>Thu, 24 Apr 2008 06:12:45 +0000</pubDate>
		<dc:creator>FlashBum</dc:creator>
		
		<category><![CDATA[Laying Plans]]></category>

		<guid isPermaLink="false">http://flashartofwar.com/?p=82</guid>
		<description><![CDATA[There has got to be something wrong with this, how can 74% of traffic be coming from the 9.0 player? There is no such thing as a flat 9.0 Player, take a look:

This is a screen shot from showing the breakdown of FlashPlayer versions:
Click on image to see full stats
I would say ok, maybe this [...]]]></description>
			<content:encoded><![CDATA[<p>There has got to be something wrong with this, how can 74% of traffic be coming from the 9.0 player? There is no such thing as a flat 9.0 Player, take a look:</p>
<p><span id="more-82"></span></p>
<p>This is a screen shot from showing the breakdown of FlashPlayer versions:</p>
<p align="center"><a href='http://flashartofwar.com/wp-content/uploads/2008/04/fp_9_traffic.jpg' title='Flash Player 9 Chart'><img src='http://flashartofwar.com/wp-content/uploads/2008/04/fp9_chart.jpg' alt='Flash Player 9 Chart' /></a><br/><small>Click on image to see full stats</small></p>
<p>I would say ok, maybe this has something to do with a combination of all the Flash 9.x.xxx Players but even if you add them up they don&#8217;t come close to the total for &#8220;Flash Player 9&#8243;. So how can I accurately gauge the visitor&#8217;s player version with this apparent oversight in tracking?</p>
<p>I also would like to take this rant to ask Adobe to please stop releasing incremental builds of the Flash Player. Player 9.0.115 was tough pill to swallow but damn, now I have to look out for 9.0.124? At what point did creating Flash apps become like CSS on different browsers. We are now building for specific versions of the player and its fucking lots of people up! When will <a href="http://flashartofwar.com/?p=7">the madness</a> end?</p>
]]></content:encoded>
			<wfw:commentRss>http://flashartofwar.com/2008/04/24/google-analytics-bug/feed/</wfw:commentRss>
		</item>
		<item>
		<title>FlexBuilder 3 vs FDT 3</title>
		<link>http://flashartofwar.com/2008/04/24/flexbuilder-3-vs-fdt-3/</link>
		<comments>http://flashartofwar.com/2008/04/24/flexbuilder-3-vs-fdt-3/#comments</comments>
		<pubDate>Thu, 24 Apr 2008 05:46:51 +0000</pubDate>
		<dc:creator>FlashBum</dc:creator>
		
		<category><![CDATA[Waging War]]></category>

		<guid isPermaLink="false">http://flashartofwar.com/?p=81</guid>
		<description><![CDATA[After 3 years I have finally given up on FDT.

For all the amazing code hinting I would get out of FDT and real time error checking I just couldn&#8217;t live with the speed and memory requirements any longer. I am using a 2.6 ghz MacBook Pro with 4 gigs of ram. There is no reason [...]]]></description>
			<content:encoded><![CDATA[<p>After 3 years I have finally given up on <a href="http://fdt.powerflasher.com/">FDT</a>.</p>
<p><span id="more-81"></span></p>
<p>For all the amazing code hinting I would get out of FDT and real time error checking I just couldn&#8217;t live with the speed and memory requirements any longer. I am using a 2.6 ghz MacBook Pro with 4 gigs of ram. There is no reason why I should see a beach ball while I type, or when I open an application, or even when the workspace is constantly rebuilding itself. For all the stuff I love in FDT the final death blow was a recent bug that popped up with my FDT + Flex SDK building combo. I keep getting a Java error or Eclipse <a href="http://en.wikipedia.org/wiki/Spinning_wait_cursor">BeachBalls</a> and crashes. This is recent, but is only the icing on a cake of crap I put up with because I was basically to lazy to type out my own variables and import packages.</p>
<p>So what am I using now? I am 90% into <a href="http://www.adobe.com/products/flex/features/flex_builder/">FlexBuilder</a>. I swore I would never make the plunge but after a week of developing I feel just as productive and more in touch with the core language again. I am trying to not rely so much on the code completion unless I really need it.</p>
<p>I also tried <a href="http://macromates.com/">TextMate</a> but found it to be way to basic. I admit I should be using an editor that is even more light weight with no code completion but while building my new frame work, when lots of classes are in flux and are being moved around, TextMate just couldn&#8217;t cut it. Refactoring has always been one of Eclipse&#8217;s strong points. Plus with TextMates lack of a &#8220;visual&#8221; SVN/CVS repository manager, I feel compelled to stay within the Eclipse system.</p>
<p>So what is so good about FlexBuilder? Well here are a few of my observations:</p>
<ul>
<li>Its fast. I mean damn fast. I always thought Eclipse was the underlining problem with FDT but I was so wrong. When you use the standalone FlexBuilder it is super fast. The key to this speed is that no validation is done until you hit save. Then you get error checking with a special twist. Its seems to be incrementally compiling with every save so when you compile, it instantly opens.</li>
<li>Support for code completion. I still get a basic level of code completion. Good for jogging my memory but not as much of a crutch as FDT. I feel like the system guides me now as opposed to me solely relying on the code completion, variable generation, and class templates.</li>
<li>Plugin support. I still get to add in some of my favorite plugins such as <a href="http://www.xmlbuddy.com/">XMLBuddy</a> and <a href="http://subclipse.tigris.org/">SVN</a>.</li>
<li>And did I mention its fast. I didn&#8217;t even have to allocate more memory to FlexBuilder. It ran fine in default and my laptop&#8217;s fan wasn&#8217;t constantly running.</li>
<li>I still get to use my SVN/CVS tools such as repository exploring, compare, replace, and one hell of a file merge.</li>
<li>Re-factoring is easier. FDT still holds the title for easy re-factoring and since FlexBuilder was all about &#8220;re-factoring&#8221; I thought I was in for a treat. It does work when renaming classes and I like the advanced tab that shows you all the classes that will be changed. Also the Find all is a big help as well.</li>
<li>Workspace auto refreshes. I can&#8217;t tell you how much I hate that FDT&#8217;s workspace is always out of sync. From committing files to adding new ones on the files system, FlexBuilder keeps up. I don&#8217;t think I have ever touched the refresh option in the project. In FDT every time I wanted to do something file related I hit that refresh just to be safe. </li>
</ul>
<p>Unfortunately life isn&#8217;t always roses in the FlexBuilder. Adobe still has a lot of work to do to bring it up to speed with FDT and help compete:</p>
<ul>
<li>WTF, no templates? The most basic core part of FDT was templates, they made everything so much faster and consistent. No luck, although on a mac I have a little helper to &#8220;substitute&#8221; those templates. I have been using <a href="http://smileonmymac.com/textexpander/">TextExpander</a> but its not perfect and I am not happy.</li>
<li>Something is missing, its still a pain in the ass to set up projects. Right now I am using the AS 3 Project Template instead of the Flex Project. Why doesn&#8217;t the AS 3 project come with a default src folder like the Flex one. Small oversight but its one extra step I need to do in the project setup to get it configured the way I need it.</li>
<li>Linked libraries are a pain to set up. why do I have to jump through so many hoops for a simple linked library to run. Again I thought this was an Eclipse issue but it turns out FlexBuilder sets them up the same exact way FDT does but in FlexBuilder I have to go through 4 more steps to do it.</li>
<li>bin-debug folder sucks. Maybe I just don&#8217;t understand yet but why is that the default build path when I can&#8217;t add/edit files in there because its considered a &#8220;derived&#8221; folder. I like that the wrapper HTML is auto generated but I don&#8217;t see where I can set up all my other files to be like that such as my config XMLs, Graphics, and other swfs. Bad workflow, and also the directory is ignored in SVN so when you add stuff to it, it doesn&#8217;t committed. Again something I may not understand just yet.</li>
</ul>
<p>So it looks like there is more Bad then Good, why do I still like it? Maybe its the old girlfriend<sup><a href="#footnote-1-81" id="footnote-link-1-81" class="footnote-link footnote-identifier-link" title="Wayne and Garth&#8217;s hobbies include &#8230; avoiding Wayne&#8217;s ex-girlfriend Stacy, (whom he refers to as a &#8220;psycho hose beast&#8221;)&#8230; - Wikipedia ">1</a></sup> you just can&#8217;t get over. Flash and me have always had this love hate relationship. I feel this need to have some pain in my development in order to feel that I have built something monumental. I don&#8217;t mind a little pain as long as its over quickly. I would gladly give up FDT to just have an editor that was a few seconds faster. Speed is everything; code hinting + auto compile + low memory = good tool. The other stuff is fluff anyways and if the developers at Adobe put a little extra effort into the next version, we should see all of the stuff that is missing now. Its not like it can&#8217;t be done, I have seen everything I want in FDT.</p>
<p>Now if only the guys who make FDT could give me a setting to make the validator only kick in after I save, and not make it real time, I would gladly shell out the $600+ again for the plugin. The jackpot would probably be a standalone FDT editor based on eclipse without all the Java Editor BS. Something light weight and portable/standalone like FlexBuilder.</p>
<p>Competition is good. Adobe needs to be reminded that they are not the only game in town. Also, Flash CS 3 is now almost obsolete for me. I have no use for the IDE. I can&#8217;t tell you how happy I am to be done with that piece of crap. You would think after 6+ years they could have made a better IDE. Sorry, low blow to Adobe (Macromedia) but I do not have a single fond memory of using the IDE. I could write a book on how much using Flash 4-MX + 8 + CS 3 sucked.</p>
<ol start="1" class="footnotes"><li id="footnote-1-81" class="footnote">Wayne and Garth&#8217;s hobbies include &#8230; <strong>avoiding Wayne&#8217;s ex-girlfriend Stacy, (whom he refers to as a &#8220;psycho hose beast&#8221;)</strong>&#8230; - <a href="http://en.wikipedia.org/wiki/Wayne's_World_(film)">Wikipedia </a> [<a href="#footnote-link-1-81" class="footnote-link footnote-back-link">&#8617;</a>]</li></ol>]]></content:encoded>
			<wfw:commentRss>http://flashartofwar.com/2008/04/24/flexbuilder-3-vs-fdt-3/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
