

<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Code Hinting Regardless of Naming Conventions</title>
	<atom:link href="http://www.quip.net/blog/2007/flash/actionscript-20/code-hinting-regardless-of-naming-conventions/feed" rel="self" type="application/rss+xml" />
	<link>http://www.quip.net/blog/2007/flash/actionscript-20/code-hinting-regardless-of-naming-conventions</link>
	<description>Luck is the residue of good design.</description>
	<lastBuildDate>Tue, 20 Mar 2012 15:33:23 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: David Stiller</title>
		<link>http://www.quip.net/blog/2007/flash/actionscript-20/code-hinting-regardless-of-naming-conventions#comment-21233</link>
		<dc:creator>David Stiller</dc:creator>
		<pubDate>Fri, 02 Mar 2007 15:07:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.quip.net/blog/2007/flash/actionscript-20/code-hinting-regardless-of-naming-conventions#comment-21233</guid>
		<description>Tiemen,

Library organization is subjective, of course.  :)  I happen to find Library folders useful, but I can understand wanting to see everything at a glance.  I tend to name symbols from macro to micro.  For example, a volume slider might have a knob and a track, and both are nested inside the slider symbol itself.  I would probably call the slider &quot;slider,&quot; the knob &quot;slider knob,&quot; and the track &quot;slider track&quot; &#8212; that way they stack in proximity in the Library.</description>
		<content:encoded><![CDATA[<p>Tiemen,</p>
<p>Library organization is subjective, of course.  <img src='http://www.quip.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />   I happen to find Library folders useful, but I can understand wanting to see everything at a glance.  I tend to name symbols from macro to micro.  For example, a volume slider might have a knob and a track, and both are nested inside the slider symbol itself.  I would probably call the slider &#8220;slider,&#8221; the knob &#8220;slider knob,&#8221; and the track &#8220;slider track&#8221; &mdash; that way they stack in proximity in the Library.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tiemen</title>
		<link>http://www.quip.net/blog/2007/flash/actionscript-20/code-hinting-regardless-of-naming-conventions#comment-20088</link>
		<dc:creator>Tiemen</dc:creator>
		<pubDate>Thu, 22 Feb 2007 21:03:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.quip.net/blog/2007/flash/actionscript-20/code-hinting-regardless-of-naming-conventions#comment-20088</guid>
		<description>&lt;blockquote&gt;In your code sample, variable_name refers to a MovieClip instance. Since you don’t seem to be using ActionScript to instantiate this object — as have with the “instance_name” clip — I can only assume you put the “variable_name” clip on the Stage by hand and gave it an instance name.&lt;/blockquote&gt;

No I didn&#039;t. I just apparantly didn&#039;t know how to set it up properly. And the same goes for the _level thingie. (as I also did wrong in the &quot;Is _root Evil?&quot; entry; that&#039;s why I couldn&#039;t get it to work)

But back to naming: Of course (me?...right) I know that symbol names do not matter, actionscriptwise- but just in practice, when I&#039;m creating movieclips inside movieclips, inside buttons, inside movieclips... - I find it hard to stick to names that 1. stay together in the library (preferably without having to use folders) and describe the symbol in a strong fashion..</description>
		<content:encoded><![CDATA[<blockquote><p>In your code sample, variable_name refers to a MovieClip instance. Since you don’t seem to be using ActionScript to instantiate this object — as have with the “instance_name” clip — I can only assume you put the “variable_name” clip on the Stage by hand and gave it an instance name.</p></blockquote>
<p>No I didn&#8217;t. I just apparantly didn&#8217;t know how to set it up properly. And the same goes for the _level thingie. (as I also did wrong in the &#8220;Is _root Evil?&#8221; entry; that&#8217;s why I couldn&#8217;t get it to work)</p>
<p>But back to naming: Of course (me?&#8230;right) I know that symbol names do not matter, actionscriptwise- but just in practice, when I&#8217;m creating movieclips inside movieclips, inside buttons, inside movieclips&#8230; &#8211; I find it hard to stick to names that 1. stay together in the library (preferably without having to use folders) and describe the symbol in a strong fashion..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Stiller</title>
		<link>http://www.quip.net/blog/2007/flash/actionscript-20/code-hinting-regardless-of-naming-conventions#comment-20033</link>
		<dc:creator>David Stiller</dc:creator>
		<pubDate>Thu, 22 Feb 2007 15:11:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.quip.net/blog/2007/flash/actionscript-20/code-hinting-regardless-of-naming-conventions#comment-20033</guid>
		<description>Tiemen,

Symbol names are authoring conveniences only.  Whatever a symbol is called in the Library is invisible to ActionScript.  The only exception in AS1 and AS2 is Linkage ID, which can be added to a Library asset by right-clicking / Command-clicking.  Linkage ID lets you &quot;pull&quot; an asset from the Library at runtime, using, say, &lt;code&gt;MovieClip.attachMovie()&lt;/code&gt;.

Variable names and instance names are functionally identical.  If you give a symbol an instance name in the Property inspector, that instance name effectively becomes a variable for you automatically.  Variables point to instances of objects.  Instance names are simply variables.

In your code sample, &lt;code&gt;variable_name&lt;/code&gt; refers to a &lt;code&gt;MovieClip&lt;/code&gt; instance.  Since you don&#039;t seem to be using ActionScript to &lt;em&gt;instantiate&lt;/em&gt; this object &#8212; as have with the &quot;instance_name&quot; clip &#8212; I can only assume you put the &quot;variable_name&quot; clip on the Stage by hand and gave it an instance name.

The reason you&#039;re having trouble with the &quot;instance_name&quot; clip is that you&#039;re trying to pass in a level as the second parameter of that &lt;code&gt;createEmptyMovieClip&lt;/code&gt; call.  That second parameter requires a depth (not the same as a level:  level&#039;s &lt;em&gt;have&lt;/em&gt; depths).

Looks like you want to use ...

&lt;pre&gt;&lt;code&gt;_level1.createEmptyMovieClip(&quot;instance_name&quot;, 0);&lt;/code&gt;&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Tiemen,</p>
<p>Symbol names are authoring conveniences only.  Whatever a symbol is called in the Library is invisible to ActionScript.  The only exception in AS1 and AS2 is Linkage ID, which can be added to a Library asset by right-clicking / Command-clicking.  Linkage ID lets you &#8220;pull&#8221; an asset from the Library at runtime, using, say, <code>MovieClip.attachMovie()</code>.</p>
<p>Variable names and instance names are functionally identical.  If you give a symbol an instance name in the Property inspector, that instance name effectively becomes a variable for you automatically.  Variables point to instances of objects.  Instance names are simply variables.</p>
<p>In your code sample, <code>variable_name</code> refers to a <code>MovieClip</code> instance.  Since you don&#8217;t seem to be using ActionScript to <em>instantiate</em> this object &mdash; as have with the &#8220;instance_name&#8221; clip &mdash; I can only assume you put the &#8220;variable_name&#8221; clip on the Stage by hand and gave it an instance name.</p>
<p>The reason you&#8217;re having trouble with the &#8220;instance_name&#8221; clip is that you&#8217;re trying to pass in a level as the second parameter of that <code>createEmptyMovieClip</code> call.  That second parameter requires a depth (not the same as a level:  level&#8217;s <em>have</em> depths).</p>
<p>Looks like you want to use &#8230;</p>
<pre><code>_level1.createEmptyMovieClip("instance_name", 0);</code></pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tiemen</title>
		<link>http://www.quip.net/blog/2007/flash/actionscript-20/code-hinting-regardless-of-naming-conventions#comment-20001</link>
		<dc:creator>Tiemen</dc:creator>
		<pubDate>Thu, 22 Feb 2007 10:57:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.quip.net/blog/2007/flash/actionscript-20/code-hinting-regardless-of-naming-conventions#comment-20001</guid>
		<description>I prefer suffices to prefixes, simply because the prefixes accidentally creates weird words that distract from the actual object :P The mcDonalds syndrome :)

That works great for naming variables but I&#039;m confused about the use of variable names, instance names and symbol names.

Take this example:

&lt;code&gt;var mcl:MovieClipLoader = new MovieClipLoader();&lt;/code&gt;
&lt;code&gt;var variable_name:MovieClip = this.createEmptyMovieClip(&quot;instance_name&quot;, _level1)&lt;/code&gt;

&lt;code&gt;mcl.addListener(this)&lt;/code&gt;
&lt;code&gt;mcl.loadClip(&quot;1.jpg&quot;, instance_name)&lt;/code&gt;
&lt;code&gt;mcl.loadClip(&quot;2.jpg&quot;, variable_name)&lt;/code&gt;

You&#039;ll find it loads 2.jpg, but the debugger outputs this:

&lt;code&gt;Level #0: Frame=1&lt;/code&gt;
&lt;code&gt;  Movie Clip: Frame=1 Target=&quot;_level0.instance_name&quot;&lt;/code&gt;

Isn&#039;t that confusing?

For this sake I name my corresponding variables, instances and symbols exactly the same. But I wish wouldn&#039;t have to.</description>
		<content:encoded><![CDATA[<p>I prefer suffices to prefixes, simply because the prefixes accidentally creates weird words that distract from the actual object <img src='http://www.quip.net/blog/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' />  The mcDonalds syndrome <img src='http://www.quip.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>That works great for naming variables but I&#8217;m confused about the use of variable names, instance names and symbol names.</p>
<p>Take this example:</p>
<p><code>var mcl:MovieClipLoader = new MovieClipLoader();</code><br />
<code>var variable_name:MovieClip = this.createEmptyMovieClip("instance_name", _level1)</code></p>
<p><code>mcl.addListener(this)</code><br />
<code>mcl.loadClip("1.jpg", instance_name)</code><br />
<code>mcl.loadClip("2.jpg", variable_name)</code></p>
<p>You&#8217;ll find it loads 2.jpg, but the debugger outputs this:</p>
<p><code>Level #0: Frame=1</code><br />
<code>  Movie Clip: Frame=1 Target="_level0.instance_name"</code></p>
<p>Isn&#8217;t that confusing?</p>
<p>For this sake I name my corresponding variables, instances and symbols exactly the same. But I wish wouldn&#8217;t have to.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

