<?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: Utility Functions For Classes</title>
	<atom:link href="http://jacksondunstan.com/articles/512/feed" rel="self" type="application/rss+xml" />
	<link>http://jacksondunstan.com/articles/512</link>
	<description>Mastering AS3</description>
	<lastBuildDate>Thu, 29 Jul 2010 17:30:45 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: NoriSte</title>
		<link>http://jacksondunstan.com/articles/512/comment-page-1#comment-471</link>
		<dc:creator>NoriSte</dc:creator>
		<pubDate>Mon, 04 Jan 2010 15:41:50 +0000</pubDate>
		<guid isPermaLink="false">http://jacksondunstan.com/?p=512#comment-471</guid>
		<description>See @ this code in the document class:

var movieClip : MovieClip = new MovieClip();
var obj : Object = {};
obj.myFunction = function(){};			
			
trace( Object( myFunction ).constructor ); //myFunction is a function of the document class
trace( Object( movieClip.play ).constructor );
trace( Object( obj.myFunction ).constructor );


Flash traces this:
[class MethodClosure]
[class MethodClosure]
[class Function]</description>
		<content:encoded><![CDATA[<p>See @ this code in the document class:</p>
<p>var movieClip : MovieClip = new MovieClip();<br />
var obj : Object = {};<br />
obj.myFunction = function(){};			</p>
<p>trace( Object( myFunction ).constructor ); //myFunction is a function of the document class<br />
trace( Object( movieClip.play ).constructor );<br />
trace( Object( obj.myFunction ).constructor );</p>
<p>Flash traces this:<br />
[class MethodClosure]<br />
[class MethodClosure]<br />
[class Function]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jackson</title>
		<link>http://jacksondunstan.com/articles/512/comment-page-1#comment-469</link>
		<dc:creator>jackson</dc:creator>
		<pubDate>Wed, 30 Dec 2009 18:27:21 +0000</pubDate>
		<guid isPermaLink="false">http://jacksondunstan.com/?p=512#comment-469</guid>
		<description>First of all, mine is longer than yours partly because mine includes more features. The &lt;tt&gt;try/catch&lt;/tt&gt; block alone adds several lines, as does the &lt;tt&gt;null&lt;/tt&gt; check. The purpose of these is to catch errors and return &lt;tt&gt;null&lt;/tt&gt; rather than propagating them. I also fall back to &lt;tt&gt;getDisplayObjectClass&lt;/tt&gt;. Other than that, my version is quite short. I&#039;m not striving for performance in these functions as you would typically not use them in a performance-critical area of code. Instead, you would cache their result.

Other than that, your &lt;tt&gt;constructor&lt;/tt&gt; field version does seem to work. I&#039;m puzzled though- what is the purpose of your check against &lt;tt&gt;[class MethodClosure]&lt;/tt&gt;? Is &lt;tt&gt;MethodClosure&lt;/tt&gt; a class you&#039;ve written and would like to treat specially?</description>
		<content:encoded><![CDATA[<p>First of all, mine is longer than yours partly because mine includes more features. The <tt>try/catch</tt> block alone adds several lines, as does the <tt>null</tt> check. The purpose of these is to catch errors and return <tt>null</tt> rather than propagating them. I also fall back to <tt>getDisplayObjectClass</tt>. Other than that, my version is quite short. I&#8217;m not striving for performance in these functions as you would typically not use them in a performance-critical area of code. Instead, you would cache their result.</p>
<p>Other than that, your <tt>constructor</tt> field version does seem to work. I&#8217;m puzzled though- what is the purpose of your check against <tt>[class MethodClosure]</tt>? Is <tt>MethodClosure</tt> a class you&#8217;ve written and would like to treat specially?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: NoriSte</title>
		<link>http://jacksondunstan.com/articles/512/comment-page-1#comment-467</link>
		<dc:creator>NoriSte</dc:creator>
		<pubDate>Wed, 30 Dec 2009 16:21:32 +0000</pubDate>
		<guid isPermaLink="false">http://jacksondunstan.com/?p=512#comment-467</guid>
		<description>I use this my own simple function

&lt;pre lang=&quot;actionscript3&quot;&gt;
public function getClass ( obj : * ) : Class
	{
		var con : * = Object( obj ).constructor;
		
		if( con.toString() == &quot;[class MethodClosure]&quot; )
			con = Function;		

		return con as Class;
	}
&lt;/pre&gt;

But the your one is longer than mine; I&#039;m here for asking you if I&#039;m loosing anything using my poor-code function... perhaps is slower in performance? (but I haven&#039;t tested, these are only assumptions) or my getClass has some faults? I&#039;ve been used it for a long time and it has caused me no one problem until now :-)</description>
		<content:encoded><![CDATA[<p>I use this my own simple function</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> getClass <span style="color: #000000;">&#40;</span> obj <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #004993;">Class</span>
    <span style="color: #000000;">&#123;</span>
        <span style="color: #6699cc; font-weight: bold;">var</span> con <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #000000; font-weight: bold;">*</span> = <span style="color: #004993;">Object</span><span style="color: #000000;">&#40;</span> obj <span style="color: #000000;">&#41;</span>.<span style="color: #004993;">constructor</span>;
&nbsp;
        <span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span> con.<span style="color: #004993;">toString</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> == <span style="color: #990000;">&quot;[class MethodClosure]&quot;</span> <span style="color: #000000;">&#41;</span>
            con = <span style="color: #004993;">Function</span>;        
&nbsp;
        <span style="color: #0033ff; font-weight: bold;">return</span> con <span style="color: #0033ff; font-weight: bold;">as</span> <span style="color: #004993;">Class</span>;
    <span style="color: #000000;">&#125;</span></pre></div></div>

<p>But the your one is longer than mine; I&#8217;m here for asking you if I&#8217;m loosing anything using my poor-code function&#8230; perhaps is slower in performance? (but I haven&#8217;t tested, these are only assumptions) or my getClass has some faults? I&#8217;ve been used it for a long time and it has caused me no one problem until now :-)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jackson</title>
		<link>http://jacksondunstan.com/articles/512/comment-page-1#comment-437</link>
		<dc:creator>jackson</dc:creator>
		<pubDate>Wed, 09 Dec 2009 22:06:28 +0000</pubDate>
		<guid isPermaLink="false">http://jacksondunstan.com/?p=512#comment-437</guid>
		<description>Good catch! It must have been left over from a previous implementation. I&#039;ve removed it and updated the article. Thanks!</description>
		<content:encoded><![CDATA[<p>Good catch! It must have been left over from a previous implementation. I&#8217;ve removed it and updated the article. Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dVyper</title>
		<link>http://jacksondunstan.com/articles/512/comment-page-1#comment-436</link>
		<dc:creator>dVyper</dc:creator>
		<pubDate>Wed, 09 Dec 2009 09:18:23 +0000</pubDate>
		<guid isPermaLink="false">http://jacksondunstan.com/?p=512#comment-436</guid>
		<description>Nice functions :-)

Just a note that it doesn&#039;t seem like you need the &quot;var c:Class;&quot; line in your getClassByName function.</description>
		<content:encoded><![CDATA[<p>Nice functions :-)</p>
<p>Just a note that it doesn&#8217;t seem like you need the &#8220;var c:Class;&#8221; line in your getClassByName function.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jackson</title>
		<link>http://jacksondunstan.com/articles/512/comment-page-1#comment-434</link>
		<dc:creator>jackson</dc:creator>
		<pubDate>Mon, 07 Dec 2009 17:35:53 +0000</pubDate>
		<guid isPermaLink="false">http://jacksondunstan.com/?p=512#comment-434</guid>
		<description>I too came to the same &lt;a href=&quot;/articles/398&quot; rel=&quot;nofollow&quot;&gt;solution&lt;/a&gt; involving a &lt;tt&gt;switch&lt;/tt&gt;, except I went all the way up to 20 parameters. I guess that would be another &lt;tt&gt;Class&lt;/tt&gt;-related utility function.</description>
		<content:encoded><![CDATA[<p>I too came to the same <a href="/articles/398" rel="nofollow">solution</a> involving a <tt>switch</tt>, except I went all the way up to 20 parameters. I guess that would be another <tt>Class</tt>-related utility function.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Piergiorgio Niero</title>
		<link>http://jacksondunstan.com/articles/512/comment-page-1#comment-433</link>
		<dc:creator>Piergiorgio Niero</dc:creator>
		<pubDate>Mon, 07 Dec 2009 13:08:48 +0000</pubDate>
		<guid isPermaLink="false">http://jacksondunstan.com/?p=512#comment-433</guid>
		<description>Yep, AS3 lacks a good set of functions to get information over classes and reflect object.
recently I experimented a bit on reflection and it has been very frustrating not to be able to create a flexible factory without workarounding as3 limitations.

I wrote a post ( http://twurl.nl/omcds2 ) and opened a feature request ( http://twurl.nl/hh84o7 ) to make things easier in next future, let&#039;s hope adobe will reflect on flash :)

my 2 cents,
pigiuz</description>
		<content:encoded><![CDATA[<p>Yep, AS3 lacks a good set of functions to get information over classes and reflect object.<br />
recently I experimented a bit on reflection and it has been very frustrating not to be able to create a flexible factory without workarounding as3 limitations.</p>
<p>I wrote a post ( <a href="http://twurl.nl/omcds2" rel="nofollow">http://twurl.nl/omcds2</a> ) and opened a feature request ( <a href="http://twurl.nl/hh84o7" rel="nofollow">http://twurl.nl/hh84o7</a> ) to make things easier in next future, let&#8217;s hope adobe will reflect on flash :)</p>
<p>my 2 cents,<br />
pigiuz</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Classes and Courses in Pattaya, Thailand &#124; Pattaya Escort Review ,Pataya Escort comment and Guideline</title>
		<link>http://jacksondunstan.com/articles/512/comment-page-1#comment-431</link>
		<dc:creator>Classes and Courses in Pattaya, Thailand &#124; Pattaya Escort Review ,Pataya Escort comment and Guideline</dc:creator>
		<pubDate>Mon, 07 Dec 2009 09:38:18 +0000</pubDate>
		<guid isPermaLink="false">http://jacksondunstan.com/?p=512#comment-431</guid>
		<description>[...] Utility Functions For Classes « JacksonDunstan.com [...]</description>
		<content:encoded><![CDATA[<p>[...] Utility Functions For Classes « JacksonDunstan.com [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
