<?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: Super Is (Really) Optional!</title>
	<atom:link href="http://jacksondunstan.com/articles/189/feed" rel="self" type="application/rss+xml" />
	<link>http://jacksondunstan.com/articles/189</link>
	<description>Mastering AS3</description>
	<lastBuildDate>Mon, 14 May 2012 17:02:12 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: ThatSnail</title>
		<link>http://jacksondunstan.com/articles/189/comment-page-1#comment-18104</link>
		<dc:creator>ThatSnail</dc:creator>
		<pubDate>Mon, 19 Dec 2011 21:28:29 +0000</pubDate>
		<guid isPermaLink="false">http://jacksondunstan.com/?p=189#comment-18104</guid>
		<description>Makes me question the stability of AS3 a little more.  Granted, I think it&#039;s bad practice to not inherit the parent&#039;s structure, so I&#039;m not very convinced of the use for this.  Still a neat find.</description>
		<content:encoded><![CDATA[<p>Makes me question the stability of AS3 a little more.  Granted, I think it&#8217;s bad practice to not inherit the parent&#8217;s structure, so I&#8217;m not very convinced of the use for this.  Still a neat find.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jackson</title>
		<link>http://jacksondunstan.com/articles/189/comment-page-1#comment-36</link>
		<dc:creator>jackson</dc:creator>
		<pubDate>Wed, 16 Sep 2009 20:42:02 +0000</pubDate>
		<guid isPermaLink="false">http://jacksondunstan.com/?p=189#comment-36</guid>
		<description>No problem at all, thank you for the comment. I wrapped your code in the formatting blocks:

&lt;pre lang=&quot;actionscript3&quot;&gt;
...
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>No problem at all, thank you for the comment. I wrapped your code in the formatting blocks:</p>
<p>&lt;pre lang=&quot;actionscript3&quot;&gt;<br />
&#8230;<br />
&lt;/pre&gt;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jackson</title>
		<link>http://jacksondunstan.com/articles/189/comment-page-1#comment-35</link>
		<dc:creator>jackson</dc:creator>
		<pubDate>Wed, 16 Sep 2009 20:39:58 +0000</pubDate>
		<guid isPermaLink="false">http://jacksondunstan.com/?p=189#comment-35</guid>
		<description>Yep, I mentioned this in the last paragraph of the article:

&lt;blockquote&gt;
Since constructors are a good place to put initialization code, beware that you’re skipping all of what is assumed to have been necessary to instantiate the class. This may be dangerous, so use it only when you’re really sure that the constructor is not relied on.
&lt;/blockquote&gt;

It&#039;s definitely a technique for rare circumstances. Actually, I can&#039;t think of much of any reason to ever use it. I really only wrote the article because I accidentally did it while doing some AS3 coding. Your example shows exactly why you want to make sure that your &lt;tt&gt;super()&lt;/tt&gt; call actually gets made. Thanks for the comment!</description>
		<content:encoded><![CDATA[<p>Yep, I mentioned this in the last paragraph of the article:</p>
<blockquote><p>
Since constructors are a good place to put initialization code, beware that you’re skipping all of what is assumed to have been necessary to instantiate the class. This may be dangerous, so use it only when you’re really sure that the constructor is not relied on.
</p></blockquote>
<p>It&#8217;s definitely a technique for rare circumstances. Actually, I can&#8217;t think of much of any reason to ever use it. I really only wrote the article because I accidentally did it while doing some AS3 coding. Your example shows exactly why you want to make sure that your <tt>super()</tt> call actually gets made. Thanks for the comment!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Boucher</title>
		<link>http://jacksondunstan.com/articles/189/comment-page-1#comment-34</link>
		<dc:creator>Michael Boucher</dc:creator>
		<pubDate>Wed, 16 Sep 2009 20:39:44 +0000</pubDate>
		<guid isPermaLink="false">http://jacksondunstan.com/?p=189#comment-34</guid>
		<description>This is an interesting find though and it appears that functions within Parent still work without the super call.

Nice post and sorry for the ugly code paste above.</description>
		<content:encoded><![CDATA[<p>This is an interesting find though and it appears that functions within Parent still work without the super call.</p>
<p>Nice post and sorry for the ugly code paste above.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Boucher</title>
		<link>http://jacksondunstan.com/articles/189/comment-page-1#comment-33</link>
		<dc:creator>Michael Boucher</dc:creator>
		<pubDate>Wed, 16 Sep 2009 20:35:35 +0000</pubDate>
		<guid isPermaLink="false">http://jacksondunstan.com/?p=189#comment-33</guid>
		<description>Unfortunately there is an added side effect to this. Since super is not called the Parent is not instantiated and thus any inherited properties are not set. Take this for instance.

&lt;pre lang=&quot;actionscript3&quot;&gt;
package
{
	public class Parent
	{
		
		public var message:String = &quot;Super Message&quot;;
		
		public function Parent()
		{
			trace(&quot;I am the super class&quot;);
		}

	}
}


package
{
	public class Child extends Parent
	{
		
		protected var doSuper:Boolean = false;
		
		public function Child()
		{
			if ( this.doSuper )
			{
				super();
			}
			
			trace(&quot;I am sub: &quot;+this.message);
		}
		
	}
}
&lt;/pre&gt;

trace:
I am sub: null
From Main: null</description>
		<content:encoded><![CDATA[<p>Unfortunately there is an added side effect to this. Since super is not called the Parent is not instantiated and thus any inherited properties are not set. Take this for instance.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #9900cc; font-weight: bold;">package</span>
<span style="color: #000000;">&#123;</span>
    <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> Parent
    <span style="color: #000000;">&#123;</span>
&nbsp;
        <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">message</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">String</span> = <span style="color: #990000;">&quot;Super Message&quot;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
        <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> Parent<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#123;</span>
            <span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;I am the super class&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
        <span style="color: #000000;">&#125;</span>
&nbsp;
    <span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span>
&nbsp;
&nbsp;
<span style="color: #9900cc; font-weight: bold;">package</span>
<span style="color: #000000;">&#123;</span>
    <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> Child <span style="color: #0033ff; font-weight: bold;">extends</span> Parent
    <span style="color: #000000;">&#123;</span>
&nbsp;
        <span style="color: #0033ff; font-weight: bold;">protected</span> <span style="color: #6699cc; font-weight: bold;">var</span> doSuper<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Boolean</span> = <span style="color: #0033ff; font-weight: bold;">false</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
        <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> Child<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#123;</span>
            <span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span> <span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000066; font-weight: bold;">.</span>doSuper <span style="color: #000000;">&#41;</span>
            <span style="color: #000000;">&#123;</span>
                <span style="color: #0033ff; font-weight: bold;">super</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
            <span style="color: #000000;">&#125;</span>
&nbsp;
            <span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;I am sub: &quot;</span><span style="color: #000066; font-weight: bold;">+</span><span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">message</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
        <span style="color: #000000;">&#125;</span>
&nbsp;
    <span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>trace:<br />
I am sub: null<br />
From Main: null</p>
]]></content:encoded>
	</item>
</channel>
</rss>

