<?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>Thu, 11 Mar 2010 21:22:56 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<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>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>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>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>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>
	<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-16223</link>
		<dc:creator>Harold Brenes</dc:creator>
		<pubDate>Sat, 09 May 2009 23:14:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.mikechambers.com/blog/?p=1025#comment-16223</guid>
		<description>Its worth mentioning, for people who prefer to use a &#039;cleaner&#039; coding style, that you can use the flex compiler option &quot;includes&quot; to explicitly include classes in your swf, whether they are referenced or not. This way, you don&#039;t have to declare any variables on your code.

I usually use a config file instead of the command line, here&#039;s an example:


   yourpackage.YourClass
   yourpackage.YourOtherClass


Note that the  node is not a child of the  node.

With this done, you won&#039;t need to declare any instances of the classes you&#039;d like to reference dynamically by using util.getDefinitionByName() or ApplicationDomain.getDefinition().</description>
		<content:encoded><![CDATA[<p>Its worth mentioning, for people who prefer to use a &#8216;cleaner&#8217; coding style, that you can use the flex compiler option &#8220;includes&#8221; to explicitly include classes in your swf, whether they are referenced or not. This way, you don&#8217;t have to declare any variables on your code.</p>
<p>I usually use a config file instead of the command line, here&#8217;s an example:</p>
<p>   yourpackage.YourClass<br />
   yourpackage.YourOtherClass</p>
<p>Note that the  node is not a child of the  node.</p>
<p>With this done, you won&#8217;t need to declare any instances of the classes you&#8217;d like to reference dynamically by using util.getDefinitionByName() or ApplicationDomain.getDefinition().</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeremy Daley</title>
		<link>http://www.mikechambers.com/blog/2006/06/22/actionscript-3-get-a-class-reference-by-class-name/comment-page-1/#comment-16150</link>
		<dc:creator>Jeremy Daley</dc:creator>
		<pubDate>Wed, 22 Apr 2009 20:20:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.mikechambers.com/blog/?p=1025#comment-16150</guid>
		<description>Sergey, I don&#039;t believe what you&#039;re asking is possible, because &quot;Sprite&quot; in a string representation could belong to:
flash.display.Sprite

or any other custom &quot;Sprite&quot; class path you&#039;ve written:
com.sergey.custom.Sprite

You can, however, get the fully qualified class path of a Sprite object:
var classPath:String = getQualifiedClassName(new Sprite())</description>
		<content:encoded><![CDATA[<p>Sergey, I don&#8217;t believe what you&#8217;re asking is possible, because &#8220;Sprite&#8221; in a string representation could belong to:<br />
flash.display.Sprite</p>
<p>or any other custom &#8220;Sprite&#8221; class path you&#8217;ve written:<br />
com.sergey.custom.Sprite</p>
<p>You can, however, get the fully qualified class path of a Sprite object:<br />
var classPath:String = getQualifiedClassName(new Sprite())</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sergey</title>
		<link>http://www.mikechambers.com/blog/2006/06/22/actionscript-3-get-a-class-reference-by-class-name/comment-page-1/#comment-16008</link>
		<dc:creator>Sergey</dc:creator>
		<pubDate>Mon, 23 Mar 2009 07:55:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.mikechambers.com/blog/?p=1025#comment-16008</guid>
		<description>Hello

Please help me brothers. How can I get the entire class path by class name in actionscript 3. For instance `

var className:String = ‘Sprite’;
var package:String = getPackage(className);

Is there such a technic?
Thanks in advance</description>
		<content:encoded><![CDATA[<p>Hello</p>
<p>Please help me brothers. How can I get the entire class path by class name in actionscript 3. For instance `</p>
<p>var className:String = ‘Sprite’;<br />
var package:String = getPackage(className);</p>
<p>Is there such a technic?<br />
Thanks in advance</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ajitpal</title>
		<link>http://www.mikechambers.com/blog/2006/06/22/actionscript-3-get-a-class-reference-by-class-name/comment-page-1/#comment-15409</link>
		<dc:creator>Ajitpal</dc:creator>
		<pubDate>Fri, 02 Jan 2009 11:21:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.mikechambers.com/blog/?p=1025#comment-15409</guid>
		<description>Getting error in :- 
var str:String=&quot;fl.transitions.Tween&quot;;
var obj=getDefinitionByName(str) as Class;
trace(obj);

why this is coming only in fl package</description>
		<content:encoded><![CDATA[<p>Getting error in :-<br />
var str:String=&#8221;fl.transitions.Tween&#8221;;<br />
var obj=getDefinitionByName(str) as Class;<br />
trace(obj);</p>
<p>why this is coming only in fl package</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: N</title>
		<link>http://www.mikechambers.com/blog/2006/06/22/actionscript-3-get-a-class-reference-by-class-name/comment-page-1/#comment-15358</link>
		<dc:creator>N</dc:creator>
		<pubDate>Thu, 18 Dec 2008 08:42:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.mikechambers.com/blog/?p=1025#comment-15358</guid>
		<description>example not working...</description>
		<content:encoded><![CDATA[<p>example not working&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeremy Daley</title>
		<link>http://www.mikechambers.com/blog/2006/06/22/actionscript-3-get-a-class-reference-by-class-name/comment-page-1/#comment-14513</link>
		<dc:creator>Jeremy Daley</dc:creator>
		<pubDate>Wed, 22 Oct 2008 21:10:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.mikechambers.com/blog/?p=1025#comment-14513</guid>
		<description>I&#039;m not sure how the snippet:
var s:String = (new ClassReference(&quot;foo=&quot;) as String);

...is that handy. how would you give the variable a &quot;String&quot; type if it was suppose to be dynamic (or unknown) in the first place?

Am I interpreting that incorrectly?</description>
		<content:encoded><![CDATA[<p>I&#8217;m not sure how the snippet:<br />
var s:String = (new ClassReference(&#8220;foo=&#8221;) as String);</p>
<p>&#8230;is that handy. how would you give the variable a &#8220;String&#8221; type if it was suppose to be dynamic (or unknown) in the first place?</p>
<p>Am I interpreting that incorrectly?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
