<?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"
	>
<channel>
	<title>Comments on: Getting the Class of an object in AS3</title>
	<atom:link href="http://www.actionscriptfreelancer.com/getting-the-class-of-an-object-in-as3/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.actionscriptfreelancer.com/getting-the-class-of-an-object-in-as3/</link>
	<description>Professional and reliable Actionscript development</description>
	<pubDate>Fri, 12 Mar 2010 00:52:46 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: scott ackerman</title>
		<link>http://www.actionscriptfreelancer.com/getting-the-class-of-an-object-in-as3/#comment-382</link>
		<dc:creator>scott ackerman</dc:creator>
		<pubDate>Mon, 22 Feb 2010 18:23:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.actionscriptdeveloper.co.uk/getting-the-class-of-an-object-in-as3/#comment-382</guid>
		<description>Many thanks. Exactly what I was looking for.</description>
		<content:encoded><![CDATA[<p>Many thanks. Exactly what I was looking for.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joe</title>
		<link>http://www.actionscriptfreelancer.com/getting-the-class-of-an-object-in-as3/#comment-353</link>
		<dc:creator>Joe</dc:creator>
		<pubDate>Thu, 12 Nov 2009 18:23:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.actionscriptdeveloper.co.uk/getting-the-class-of-an-object-in-as3/#comment-353</guid>
		<description>Dave, great post, and Gabriel Mariani, great addition. I was double checking that I had this right and thought I would share:

var a:Array = new Array();
var aClass:Class = Object(a).constructor;
var aClassByUtils:Class = flash.utils.getDefinitionByName("Array") as Class;

trace("by consctuctor: " + aClass);
trace("by utils: " + aClassByUtils);
trace("(aClass == Array): " + (aClass == Array));
trace("(aClassByUtils == Array): " + (aClassByUtils == Array));
trace("(aClass == aClassByUtils): " + (aClass == aClassByUtils));</description>
		<content:encoded><![CDATA[<p>Dave, great post, and Gabriel Mariani, great addition. I was double checking that I had this right and thought I would share:</p>
<p>var a:Array = new Array();<br />
var aClass:Class = Object(a).constructor;<br />
var aClassByUtils:Class = flash.utils.getDefinitionByName(&#8221;Array&#8221;) as Class;</p>
<p>trace(&#8221;by consctuctor: &#8221; + aClass);<br />
trace(&#8221;by utils: &#8221; + aClassByUtils);<br />
trace(&#8221;(aClass == Array): &#8221; + (aClass == Array));<br />
trace(&#8221;(aClassByUtils == Array): &#8221; + (aClassByUtils == Array));<br />
trace(&#8221;(aClass == aClassByUtils): &#8221; + (aClass == aClassByUtils));</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cody Munger</title>
		<link>http://www.actionscriptfreelancer.com/getting-the-class-of-an-object-in-as3/#comment-301</link>
		<dc:creator>Cody Munger</dc:creator>
		<pubDate>Thu, 03 Sep 2009 21:24:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.actionscriptdeveloper.co.uk/getting-the-class-of-an-object-in-as3/#comment-301</guid>
		<description>don't forget the required includes for this snippet

import flash.utils.getDefinitionByName;
import flash.utils.getQualifiedClassName;

I was surprised that this functionality isn't built into the Object class.</description>
		<content:encoded><![CDATA[<p>don&#8217;t forget the required includes for this snippet</p>
<p>import flash.utils.getDefinitionByName;<br />
import flash.utils.getQualifiedClassName;</p>
<p>I was surprised that this functionality isn&#8217;t built into the Object class.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gabriel Mariani</title>
		<link>http://www.actionscriptfreelancer.com/getting-the-class-of-an-object-in-as3/#comment-257</link>
		<dc:creator>Gabriel Mariani</dc:creator>
		<pubDate>Mon, 18 May 2009 14:09:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.actionscriptdeveloper.co.uk/getting-the-class-of-an-object-in-as3/#comment-257</guid>
		<description>Or you could save yourself the use of expensive functions and use this:

public function getClass(obj:Object):Class {
	return Object(obj).constructor;
}</description>
		<content:encoded><![CDATA[<p>Or you could save yourself the use of expensive functions and use this:</p>
<p>public function getClass(obj:Object):Class {<br />
	return Object(obj).constructor;<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: shaun</title>
		<link>http://www.actionscriptfreelancer.com/getting-the-class-of-an-object-in-as3/#comment-240</link>
		<dc:creator>shaun</dc:creator>
		<pubDate>Mon, 23 Mar 2009 07:11:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.actionscriptdeveloper.co.uk/getting-the-class-of-an-object-in-as3/#comment-240</guid>
		<description>Awesome! Bookmarked this a while back.. needed it today :)</description>
		<content:encoded><![CDATA[<p>Awesome! Bookmarked this a while back.. needed it today <img src='http://www.actionscriptfreelancer.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ihsan</title>
		<link>http://www.actionscriptfreelancer.com/getting-the-class-of-an-object-in-as3/#comment-237</link>
		<dc:creator>Ihsan</dc:creator>
		<pubDate>Sun, 15 Mar 2009 21:49:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.actionscriptdeveloper.co.uk/getting-the-class-of-an-object-in-as3/#comment-237</guid>
		<description>Hi Michael,
To find parent class of an objects class use:
&lt;code&gt;
static function getSuperClass(o: Object): Object {
var n: String = getQualifiedSuperclassName(o);
	if(n == null)return(null);
	return(getDefinitionByName(n));
}
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Hi Michael,<br />
To find parent class of an objects class use:<br />
<code><br />
static function getSuperClass(o: Object): Object {<br />
var n: String = getQualifiedSuperclassName(o);<br />
	if(n == null)return(null);<br />
	return(getDefinitionByName(n));<br />
}<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://www.actionscriptfreelancer.com/getting-the-class-of-an-object-in-as3/#comment-236</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Tue, 10 Mar 2009 16:36:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.actionscriptdeveloper.co.uk/getting-the-class-of-an-object-in-as3/#comment-236</guid>
		<description>Thank You!
Saved my day ;)</description>
		<content:encoded><![CDATA[<p>Thank You!<br />
Saved my day <img src='http://www.actionscriptfreelancer.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: devdave</title>
		<link>http://www.actionscriptfreelancer.com/getting-the-class-of-an-object-in-as3/#comment-221</link>
		<dc:creator>devdave</dc:creator>
		<pubDate>Thu, 12 Feb 2009 10:49:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.actionscriptdeveloper.co.uk/getting-the-class-of-an-object-in-as3/#comment-221</guid>
		<description>Hey Michael,

This will only return the real class - to get the base class you'll need to use flash.utils.describeType and then use E4X to get the XML node containing the base class (or something like that).  If only the parent class is contained in describeType you might have to recurse down a tree of describeType calls until you reach the base.

Hope that helps,

Dave</description>
		<content:encoded><![CDATA[<p>Hey Michael,</p>
<p>This will only return the real class - to get the base class you&#8217;ll need to use flash.utils.describeType and then use E4X to get the XML node containing the base class (or something like that).  If only the parent class is contained in describeType you might have to recurse down a tree of describeType calls until you reach the base.</p>
<p>Hope that helps,</p>
<p>Dave</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: michael</title>
		<link>http://www.actionscriptfreelancer.com/getting-the-class-of-an-object-in-as3/#comment-219</link>
		<dc:creator>michael</dc:creator>
		<pubDate>Wed, 11 Feb 2009 23:25:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.actionscriptdeveloper.co.uk/getting-the-class-of-an-object-in-as3/#comment-219</guid>
		<description>hello man,
thank you very much for this snippet,is there a similar way to get base class?

i'd like to know if something i exported to AS from library is a movieclip, when i test it with this function it returns the custom class name i assigned.

thanks and wonderful work
michael</description>
		<content:encoded><![CDATA[<p>hello man,<br />
thank you very much for this snippet,is there a similar way to get base class?</p>
<p>i&#8217;d like to know if something i exported to AS from library is a movieclip, when i test it with this function it returns the custom class name i assigned.</p>
<p>thanks and wonderful work<br />
michael</p>
]]></content:encoded>
	</item>
</channel>
</rss>
