<?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: ActionScript 3 : Get a Class Reference by Class Name</title>
	<atom:link href="http://www.mikechambers.com/blog/2006/06/22/actionscript-3-get-a-class-reference-by-class-name/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mikechambers.com/blog/2006/06/22/actionscript-3-get-a-class-reference-by-class-name/</link>
	<description>code = joy</description>
	<lastBuildDate>Tue, 15 May 2012 17:58:44 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
	<item>
		<title>By: Ben</title>
		<link>http://www.mikechambers.com/blog/2006/06/22/actionscript-3-get-a-class-reference-by-class-name/comment-page-1/#comment-29512</link>
		<dc:creator>Ben</dc:creator>
		<pubDate>Fri, 30 Dec 2011 11:31:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.mikechambers.com/blog/?p=1025#comment-29512</guid>
		<description><![CDATA[Mike Chambers you are a hero. The pixel-perfect collision code was, well, perfect and now this! Thank-you.]]></description>
		<content:encoded><![CDATA[<p>Mike Chambers you are a hero. The pixel-perfect collision code was, well, perfect and now this! Thank-you.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rudolfs</title>
		<link>http://www.mikechambers.com/blog/2006/06/22/actionscript-3-get-a-class-reference-by-class-name/comment-page-1/#comment-26761</link>
		<dc:creator>Rudolfs</dc:creator>
		<pubDate>Mon, 13 Jun 2011 14:35:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.mikechambers.com/blog/?p=1025#comment-26761</guid>
		<description><![CDATA[The solution for custom class is something like this -&gt;

registerType(path.to.MyClass);
var myClass:Class = getDefinitionByName(&quot;MyClass&quot;);

function registerType(clazz:Class):void
{
// NOP - passing it is enough for it to be linked into the SWF.
}]]></description>
		<content:encoded><![CDATA[<p>The solution for custom class is something like this -&gt;</p>
<p>registerType(path.to.MyClass);<br />
var myClass:Class = getDefinitionByName(&#8220;MyClass&#8221;);</p>
<p>function registerType(clazz:Class):void<br />
{<br />
// NOP &#8211; passing it is enough for it to be linked into the SWF.<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mírmiken</title>
		<link>http://www.mikechambers.com/blog/2006/06/22/actionscript-3-get-a-class-reference-by-class-name/comment-page-1/#comment-25043</link>
		<dc:creator>Mírmiken</dc:creator>
		<pubDate>Mon, 24 Jan 2011 17:22:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.mikechambers.com/blog/?p=1025#comment-25043</guid>
		<description><![CDATA[All the solutions provided to the getDefinitionByName() issue involves the name of the target class. In case that you are developing a module, that&#039;s going to by use by another aplication who is only going to tell you the name (or adress) oh the class, and therefore, the module doesn&#039;t know the class. The only thing it can count on is the complete name of the class. There are any solution???

Sorry about my english]]></description>
		<content:encoded><![CDATA[<p>All the solutions provided to the getDefinitionByName() issue involves the name of the target class. In case that you are developing a module, that&#8217;s going to by use by another aplication who is only going to tell you the name (or adress) oh the class, and therefore, the module doesn&#8217;t know the class. The only thing it can count on is the complete name of the class. There are any solution???</p>
<p>Sorry about my english</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Akhil</title>
		<link>http://www.mikechambers.com/blog/2006/06/22/actionscript-3-get-a-class-reference-by-class-name/comment-page-1/#comment-24853</link>
		<dc:creator>Akhil</dc:creator>
		<pubDate>Tue, 11 Jan 2011 08:29:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.mikechambers.com/blog/?p=1025#comment-24853</guid>
		<description><![CDATA[Can i can give properties and methods to a targetpath?
like [object Stage].[object MainTimeline].[objct movieclip].textfield...]]></description>
		<content:encoded><![CDATA[<p>Can i can give properties and methods to a targetpath?<br />
like [object Stage].[object MainTimeline].[objct movieclip].textfield&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hank</title>
		<link>http://www.mikechambers.com/blog/2006/06/22/actionscript-3-get-a-class-reference-by-class-name/comment-page-1/#comment-20469</link>
		<dc:creator>Hank</dc:creator>
		<pubDate>Thu, 22 Apr 2010 20:41:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.mikechambers.com/blog/?p=1025#comment-20469</guid>
		<description><![CDATA[badass code! 

this &#039;getDefinitionByName&#039; method literally saved me hours of repetitive code writing time, I just created one custom function that retrieved all the different class names and pass them right through!

thanks!]]></description>
		<content:encoded><![CDATA[<p>badass code! </p>
<p>this &#8216;getDefinitionByName&#8217; method literally saved me hours of repetitive code writing time, I just created one custom function that retrieved all the different class names and pass them right through!</p>
<p>thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Richard Eastbury</title>
		<link>http://www.mikechambers.com/blog/2006/06/22/actionscript-3-get-a-class-reference-by-class-name/comment-page-1/#comment-18984</link>
		<dc:creator>Richard Eastbury</dc:creator>
		<pubDate>Mon, 22 Mar 2010 16:14:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.mikechambers.com/blog/?p=1025#comment-18984</guid>
		<description><![CDATA[If your referencing a class using a string you must include the package name in that String. So if you packages is called com then 

var stringTest:String = &quot;com.&quot; + theStringForTheClass;

var ref:Class = getDefinitionByName(stringTest) as Class;

var test = new ref();]]></description>
		<content:encoded><![CDATA[<p>If your referencing a class using a string you must include the package name in that String. So if you packages is called com then </p>
<p>var stringTest:String = &#8220;com.&#8221; + theStringForTheClass;</p>
<p>var ref:Class = getDefinitionByName(stringTest) as Class;</p>
<p>var test = new ref();</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Veeru</title>
		<link>http://www.mikechambers.com/blog/2006/06/22/actionscript-3-get-a-class-reference-by-class-name/comment-page-1/#comment-18805</link>
		<dc:creator>Veeru</dc:creator>
		<pubDate>Thu, 11 Mar 2010 08:53:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.mikechambers.com/blog/?p=1025#comment-18805</guid>
		<description><![CDATA[How about to use the event handlers and item renders in the UI components added using reflection concept.

Can we load UI based on a xml compleletly by this reflection alone with out writing any code for handlers and other stuffs.

Thanks in advance,
Veeru]]></description>
		<content:encoded><![CDATA[<p>How about to use the event handlers and item renders in the UI components added using reflection concept.</p>
<p>Can we load UI based on a xml compleletly by this reflection alone with out writing any code for handlers and other stuffs.</p>
<p>Thanks in advance,<br />
Veeru</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: gregbown</title>
		<link>http://www.mikechambers.com/blog/2006/06/22/actionscript-3-get-a-class-reference-by-class-name/comment-page-1/#comment-18344</link>
		<dc:creator>gregbown</dc:creator>
		<pubDate>Fri, 29 Jan 2010 00:31:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.mikechambers.com/blog/?p=1025#comment-18344</guid>
		<description><![CDATA[Great tip! Thank you! I used this to instantiate movie clips in an application that gets the names from XML. Since I have no idea how many backgrounds the designers may want.

public function init(name:String):void {
var ref:Class = getDefinitionByName(name) as Class;
var background:MovieClip = new ref as MovieClip;
addChild(background as DisplayObject);
}]]></description>
		<content:encoded><![CDATA[<p>Great tip! Thank you! I used this to instantiate movie clips in an application that gets the names from XML. Since I have no idea how many backgrounds the designers may want.</p>
<p>public function init(name:String):void {<br />
var ref:Class = getDefinitionByName(name) as Class;<br />
var background:MovieClip = new ref as MovieClip;<br />
addChild(background as DisplayObject);<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: code handyman</title>
		<link>http://www.mikechambers.com/blog/2006/06/22/actionscript-3-get-a-class-reference-by-class-name/comment-page-1/#comment-17850</link>
		<dc:creator>code handyman</dc:creator>
		<pubDate>Wed, 18 Nov 2009 19:05:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.mikechambers.com/blog/?p=1025#comment-17850</guid>
		<description><![CDATA[senocular to the rescue!  For me what this did was allow me to create a bunch of &quot;filter classes&quot; that I can apply and basically abstract the look of button classes away from their functionality, and some member of our team can manage the filter classes independently of the button class, except for registering the variables.  

Suggestion for Adobe is simply adding a switch to the .* wildcard like myClasses.*-ForceAll or something.  Then we, the coders could decide instead of Adobe deciding for us whether or not to have classes in our code, although that would clearly pave the way for some pretty sloppy stuff and I can see why they would be leery as flash already gets a bad rap because of crummy flash code out there.]]></description>
		<content:encoded><![CDATA[<p>senocular to the rescue!  For me what this did was allow me to create a bunch of &#8220;filter classes&#8221; that I can apply and basically abstract the look of button classes away from their functionality, and some member of our team can manage the filter classes independently of the button class, except for registering the variables.  </p>
<p>Suggestion for Adobe is simply adding a switch to the .* wildcard like myClasses.*-ForceAll or something.  Then we, the coders could decide instead of Adobe deciding for us whether or not to have classes in our code, although that would clearly pave the way for some pretty sloppy stuff and I can see why they would be leery as flash already gets a bad rap because of crummy flash code out there.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Harold Brenes</title>
		<link>http://www.mikechambers.com/blog/2006/06/22/actionscript-3-get-a-class-reference-by-class-name/comment-page-1/#comment-16224</link>
		<dc:creator>Harold Brenes</dc:creator>
		<pubDate>Sat, 09 May 2009 23:20:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.mikechambers.com/blog/?p=1025#comment-16224</guid>
		<description><![CDATA[Pardon me, it seems that the comments strip away any text containing html-style tags.

The example provided is supposed to be:

[includes]
   [symbol]yourpackage.YourClass[/symbol]
   [symbol]yourpackage.YourOtherClass[/symbol]&gt;
[/include]

Note that the node is not a child of [compiler] the node.


Of course, substitute &#039;[&#039; brackets with the html-style tag ones, as you would use in your xml coonfig file.]]></description>
		<content:encoded><![CDATA[<p>Pardon me, it seems that the comments strip away any text containing html-style tags.</p>
<p>The example provided is supposed to be:</p>
<p>[includes]<br />
   [symbol]yourpackage.YourClass[/symbol]<br />
   [symbol]yourpackage.YourOtherClass[/symbol]&gt;<br />
[/include]</p>
<p>Note that the node is not a child of [compiler] the node.</p>
<p>Of course, substitute &#8216;[&#8216; brackets with the html-style tag ones, as you would use in your xml coonfig file.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
