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

<channel>
	<title>Blog Pav Blog &#187; CS4</title>
	<atom:link href="http://www.pavley.com/tag/cs4/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.pavley.com</link>
	<description>“A great leap in the dark” – Thomas Hobbes</description>
	<lastBuildDate>Thu, 05 Jan 2012 05:02:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Worst Ever Paragraph in a Technical Doc</title>
		<link>http://www.pavley.com/2009/08/02/worst-ever-paragraph-in-a-technical-doc/</link>
		<comments>http://www.pavley.com/2009/08/02/worst-ever-paragraph-in-a-technical-doc/#comments</comments>
		<pubDate>Sun, 02 Aug 2009 15:40:42 +0000</pubDate>
		<dc:creator>pav</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[AS 3.0 Components]]></category>
		<category><![CDATA[CS4]]></category>
		<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://www.pavley.com/?p=34</guid>
		<description><![CDATA[I&#8217;m working on my Flash game framework. Progress, which I admit is slow, requires a good understanding of the Flash CS4 Component model. I embarked on this project a few weeks ago without realizing 3 things: The CS4 Component Model is very different from the CS3 model. There is very little good documentation for CS4 [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m working on my Flash game framework. Progress, which I admit is slow, requires a good understanding of the <a href="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/">Flash CS4 Component</a> model. I embarked on this project a few weeks ago without realizing 3 things:</p>
<ol>
<li>The CS4 Component Model is very different from the CS3 model.</li>
<li>There is very little good documentation for CS4 Components.</li>
<li>Flash and CS4 Components have become the step children of Flex and it&#8217;s entirely different, incompatible component model.</li>
</ol>
<p> <img src='http://www.pavley.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>I&#8217;m not sure why the CS3 Component Model had to go. The major change seems to be that CS3 Comps were based on a subclass of <a href="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/MovieClip.html">MovieClip</a> while CS4 Comps are based on a subclass of <a href="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/Sprite.html">Sprite</a>. This change in inheritance has some great technical advantages but even more practical disadvantages.</p>
<p>MovieClip is a heavy weight object with lots of functionality. It&#8217;s a great starting point for components because you have all of Flash&#8217;s frame-based animation at your command. Sprite is a superclass of MovieClip and hard-coded to a single frame. Sprite is a great idea, since a many elements in a Flash game are static. Using Sprite-based components means less overhead for the Flash engine to grind through. Sprite-based components are less overhead for the programmer too: Since Flash plays any MovieClip by default you don&#8217;t need to include frame management code in a CS4 Component.</p>
<p>That&#8217;s all good. Here&#8217;s the bad:</p>
<p>CS4 Components can not share the same stage with CS3 Components. You have to choose one or the other!</p>
<p>There are 5 less Adobe-authored CS4 Components than CS3. Some of my favorites were not ported to CS4 including Accordion, Tree, and Window. I can still use the original CS3 set of components but not in the same application with CS4 components.</p>
<p><code>/cry</code></p>
<p>A quick search of <a href="http://flashden.net/">FlashDen</a> lists 236 CS3 components and only 51 CS4 components. This means to me Adobe has been doing a poor job of evangelizing the benefits of CS4 Components or that the benefits aren&#8217;t worth the effort. Or, as I suspect, all of the above.</p>
<p>CS4 components can be compiled so that their code is hidden. <em>I hate that.</em> I hope I don&#8217;t need to argue the open source model here. But someone at adobe should read the <a href="http://en.wikipedia.org/wiki/Open_source">Wikipedia entry</a>. I know developers who want to make money from their Flash components probably demanded this feature. I want to grab these follow capitalists by the shoulders, look them square in the eye, and say &#8220;There is a better way!&#8221; Look to the <a href="http://www.cpan.org/">Perl community</a>! Look to the <a href="http://www.ruby-lang.org/en/">Ruby community</a>! Look to the <a href="http://www.php.net/">PHP community</a>! None of our brothers and sisters are starving there! Hiding your code leads to a lack of adoption, a lack of quality, and the illusion that you can sit on your butt and no longer have to innovate.</p>
<p>For me, the single biggest problem with the CS4 component model is the scarcity of quality documentation. The books and sites devoted to CS3 components are too numerous to mention. I found only one decent article on Adobe&#8217;s <a href="http://www.adobe.com/devnet/">DevNet</a> about CS4 Components: <a href="http://www.adobe.com/devnet/flash/articles/creating_as3_components.html">Creating ActionScript 3.0 components in Flash</a> by Jeff Kamerer. It&#8217;s a very comprehensive article, points out many of the problematic design details that need to be considered when authoring CS4 components, but it&#8217;s rambling and needs much editing.</p>
<p>In fact it contains one of the worst paragraphs I&#8217;ve ever read in years of reading technical documentation:</p>
<blockquote><p>You&#8217;ll find ActionScript metadata throughout all component code: in ActionScript 2.0 and ActionScript 3.0, in Flash and in Flex. ActionScript metadata comes between square brackets. It has a name that is followed by a list of name/value pairs enclosed in parentheses. For example, here is metadata with the name Inspectable and a single name/value pair, defaultValue/Label: <code>[Inspectable(defaultValue="Label")]</code></p></blockquote>
<p>Confusing yes?</p>
<p>What the author means to say (and I don&#8217;t blame him, I blame the nameless Adobe technical editor who should have fixed this) is that metadata is enclosed in square brackets and defined by a name and a string value or a list of key/value pairs. The example given is the most confusing part of this paragraph: It would be much clearer if a general example was used like <code>[Name(key="value")]</code>. By using a specific example he makes us hunt for the general hidden in the details. The example uses &#8220;defaultValue&#8221; as the key and confuses us with the word &#8220;value&#8221; on the left (the value is on the right). By using the string &#8220;Label&#8221; for the value the example confuses us with a synonym for a name on the right (the name, or key, goes on the left).</p>
<p>Unless I&#8217;m so confused I got it wrong.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pavley.com/2009/08/02/worst-ever-paragraph-in-a-technical-doc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

