<?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: getDefinitionByName Error: &#8220;Variable &#8230; is not defined.&#8221;</title>
	<atom:link href="http://www.flexer.info/2009/05/01/getdefinitionbyname-error-variable-is-not-defined/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.flexer.info/2009/05/01/getdefinitionbyname-error-variable-is-not-defined/</link>
	<description>flex developers web corner</description>
	<lastBuildDate>Wed, 18 Jan 2012 13:28:25 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Kawika</title>
		<link>http://www.flexer.info/2009/05/01/getdefinitionbyname-error-variable-is-not-defined/comment-page-1/#comment-1947</link>
		<dc:creator>Kawika</dc:creator>
		<pubDate>Wed, 25 Aug 2010 21:44:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.flexer.info/?p=751#comment-1947</guid>
		<description>Thanks!  I wish Adobe had not made this the default behavior of the Flex compiler...</description>
		<content:encoded><![CDATA[<p>Thanks!  I wish Adobe had not made this the default behavior of the Flex compiler&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Yasin Türkdoğan</title>
		<link>http://www.flexer.info/2009/05/01/getdefinitionbyname-error-variable-is-not-defined/comment-page-1/#comment-1892</link>
		<dc:creator>Yasin Türkdoğan</dc:creator>
		<pubDate>Wed, 12 May 2010 09:44:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.flexer.info/?p=751#comment-1892</guid>
		<description>If you are using flex Update your flex sdk 

http://fpdownload.adobe.com/pub/flex/sdk/builds/flex4/flex_sdk_4.1.0.16021.zip</description>
		<content:encoded><![CDATA[<p>If you are using flex Update your flex sdk </p>
<p><a href="http://fpdownload.adobe.com/pub/flex/sdk/builds/flex4/flex_sdk_4.1.0.16021.zip" rel="nofollow">http://fpdownload.adobe.com/pub/flex/sdk/builds/flex4/flex_sdk_4.1.0.16021.zip</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gert-Jan van der Wel</title>
		<link>http://www.flexer.info/2009/05/01/getdefinitionbyname-error-variable-is-not-defined/comment-page-1/#comment-1840</link>
		<dc:creator>Gert-Jan van der Wel</dc:creator>
		<pubDate>Thu, 11 Mar 2010 15:46:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.flexer.info/?p=751#comment-1840</guid>
		<description>It seems to work when you pass in the whole path of the class.

&lt;pre lang=&quot;actionscript&quot;&gt;
var myClass:Class = getDefinitionByName(&quot;mx.containers.Box&quot;) as Class;
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>It seems to work when you pass in the whole path of the class.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">var</span> myClass:<span style="color: #000000; font-weight: bold;">Class</span> = getDefinitionByName<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;mx.containers.Box&quot;</span><span style="color: #66cc66;">&#41;</span> as <span style="color: #000000; font-weight: bold;">Class</span>;</pre></div></div>

]]></content:encoded>
	</item>
	<item>
		<title>By: Andrei Ionescu</title>
		<link>http://www.flexer.info/2009/05/01/getdefinitionbyname-error-variable-is-not-defined/comment-page-1/#comment-1661</link>
		<dc:creator>Andrei Ionescu</dc:creator>
		<pubDate>Mon, 20 Jul 2009 07:44:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.flexer.info/?p=751#comment-1661</guid>
		<description>Hello Brad! You can do one of the following:
&lt;pre lang=&quot;actionscript&quot;&gt;private var _myBox:MyBox;
private var _mySprite:MySprite;
...&lt;/pre&gt;
or
&lt;pre lang=&quot;actionscript&quot;&gt;MyBox;
MySprite;
...&lt;/pre&gt;
First example creates some variables and can be put in a class outside any method/function, second example calls the class but needs to be in method, function or in a place where ActionScript code is executed.

Only one of them is necessary. Both methods adds to the file size.

Hope this is clearing any confusion.</description>
		<content:encoded><![CDATA[<p>Hello Brad! You can do one of the following:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _myBox:MyBox;
<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _mySprite:MySprite;
...</pre></div></div>

<p>or</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">MyBox;
MySprite;
...</pre></div></div>

<p>First example creates some variables and can be put in a class outside any method/function, second example calls the class but needs to be in method, function or in a place where ActionScript code is executed.</p>
<p>Only one of them is necessary. Both methods adds to the file size.</p>
<p>Hope this is clearing any confusion.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brad Manderscheid</title>
		<link>http://www.flexer.info/2009/05/01/getdefinitionbyname-error-variable-is-not-defined/comment-page-1/#comment-1660</link>
		<dc:creator>Brad Manderscheid</dc:creator>
		<pubDate>Sun, 19 Jul 2009 00:23:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.flexer.info/?p=751#comment-1660</guid>
		<description>So I&#039;ve been annoyed with this issue b/c I&#039;m also creating a dynamic system that will be controlled by a config XML.  It is said that you can just declare dummy vars for all possible views, which works and I can live with, but by declaring them all, am I adding to the swf file size? or do I need to instanciate for it to actually add to the file size?
Also, I&#039;m able to do this approach just fine in Flash.</description>
		<content:encoded><![CDATA[<p>So I&#8217;ve been annoyed with this issue b/c I&#8217;m also creating a dynamic system that will be controlled by a config XML.  It is said that you can just declare dummy vars for all possible views, which works and I can live with, but by declaring them all, am I adding to the swf file size? or do I need to instanciate for it to actually add to the file size?<br />
Also, I&#8217;m able to do this approach just fine in Flash.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mikko Pukki</title>
		<link>http://www.flexer.info/2009/05/01/getdefinitionbyname-error-variable-is-not-defined/comment-page-1/#comment-1638</link>
		<dc:creator>Mikko Pukki</dc:creator>
		<pubDate>Thu, 25 Jun 2009 12:51:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.flexer.info/?p=751#comment-1638</guid>
		<description>Hi,

Just built the serialization and figured out that my conserns were unnecessary after all. Because if we have a case where Component A waits for data that is of type B, and when component A receives message type B, it is of course put in a variable of type B inside component A. So class B is included in the compilation (because it is included with A) and unnecessary classes are not. I quess that it makes always sense after all (Well of course it does!) that class is never compiled if it is not used in code.

This makes sense. If the class is not included in the compilation, why in the world would I need the class&#039;s definition. If it were the case, then an erroneus message must have been received by the component.</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>Just built the serialization and figured out that my conserns were unnecessary after all. Because if we have a case where Component A waits for data that is of type B, and when component A receives message type B, it is of course put in a variable of type B inside component A. So class B is included in the compilation (because it is included with A) and unnecessary classes are not. I quess that it makes always sense after all (Well of course it does!) that class is never compiled if it is not used in code.</p>
<p>This makes sense. If the class is not included in the compilation, why in the world would I need the class&#8217;s definition. If it were the case, then an erroneus message must have been received by the component.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mikko Pukki</title>
		<link>http://www.flexer.info/2009/05/01/getdefinitionbyname-error-variable-is-not-defined/comment-page-1/#comment-1637</link>
		<dc:creator>Mikko Pukki</dc:creator>
		<pubDate>Wed, 24 Jun 2009 14:08:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.flexer.info/?p=751#comment-1637</guid>
		<description>Hi, I ran into this same problem when building serialization between java and as3 classes. Both java and as3 classes are build by generating them from an uml document and then as3 classes are compiled to swc with compc that comes with flex sdk. When i compile the application in flash cs4, everything works fine, if there is a variable representing the class in the code. Problem is that there might soon be hundreds of classes that I need to be able to move between java server application and flash applet. What should I do?

Flo, you mentioned runtime shared libraries.. How to use them and in what way they could help? Sorry, if the question sounds stupid, but I&#039;ve not used actionscript a lot yet, I&#039;m mainly java developer and I dont know yet everything about this environment..

But if adding a variable to the class where getDefinitionByName is being used, I&#039;m ready to ditch the whole idea and burn all flash licences at our company.</description>
		<content:encoded><![CDATA[<p>Hi, I ran into this same problem when building serialization between java and as3 classes. Both java and as3 classes are build by generating them from an uml document and then as3 classes are compiled to swc with compc that comes with flex sdk. When i compile the application in flash cs4, everything works fine, if there is a variable representing the class in the code. Problem is that there might soon be hundreds of classes that I need to be able to move between java server application and flash applet. What should I do?</p>
<p>Flo, you mentioned runtime shared libraries.. How to use them and in what way they could help? Sorry, if the question sounds stupid, but I&#8217;ve not used actionscript a lot yet, I&#8217;m mainly java developer and I dont know yet everything about this environment..</p>
<p>But if adding a variable to the class where getDefinitionByName is being used, I&#8217;m ready to ditch the whole idea and burn all flash licences at our company.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Flo</title>
		<link>http://www.flexer.info/2009/05/01/getdefinitionbyname-error-variable-is-not-defined/comment-page-1/#comment-1607</link>
		<dc:creator>Flo</dc:creator>
		<pubDate>Sun, 03 May 2009 17:51:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.flexer.info/?p=751#comment-1607</guid>
		<description>@Andrei Ionescu Thanks a lot for your answer. Yeah it is not really good solution, but it helps :-) If i do not have many classes, that it is fine... otherwise I should to use Runtime Shared Librarys in which my classes are defined. That has the advantages that the filesize is not inscreasing a lot....</description>
		<content:encoded><![CDATA[<p>@Andrei Ionescu Thanks a lot for your answer. Yeah it is not really good solution, but it helps <img src='http://www.flexer.info/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  If i do not have many classes, that it is fine&#8230; otherwise I should to use Runtime Shared Librarys in which my classes are defined. That has the advantages that the filesize is not inscreasing a lot&#8230;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrei Ionescu</title>
		<link>http://www.flexer.info/2009/05/01/getdefinitionbyname-error-variable-is-not-defined/comment-page-1/#comment-1604</link>
		<dc:creator>Andrei Ionescu</dc:creator>
		<pubDate>Sat, 02 May 2009 15:46:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.flexer.info/?p=751#comment-1604</guid>
		<description>Flo, I&#039;m sorry that you&#039;re in this nasty problem. I can understand why the linker and compiler work like this. The resulting application is targeted for web which limits our size, so the compiler excludes anything that is not directly used. Also by this way unused code lines from the Flex SDK will not be included either. 

What I would if I were you... I would make a list with all possible classes that may be instantiated and add them to the whole application. Then using that XML config file you&#039;ll use only what you need.

Doing this you&#039;ll have control of what is included in your compiled application thus having a known size of your resulting swf file and you&#039;ll also be able to use your external settings file.

I know that is not a fix for your problem but I hope it helps a bit.</description>
		<content:encoded><![CDATA[<p>Flo, I&#8217;m sorry that you&#8217;re in this nasty problem. I can understand why the linker and compiler work like this. The resulting application is targeted for web which limits our size, so the compiler excludes anything that is not directly used. Also by this way unused code lines from the Flex SDK will not be included either. </p>
<p>What I would if I were you&#8230; I would make a list with all possible classes that may be instantiated and add them to the whole application. Then using that XML config file you&#8217;ll use only what you need.</p>
<p>Doing this you&#8217;ll have control of what is included in your compiled application thus having a known size of your resulting swf file and you&#8217;ll also be able to use your external settings file.</p>
<p>I know that is not a fix for your problem but I hope it helps a bit.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrei Ionescu</title>
		<link>http://www.flexer.info/2009/05/01/getdefinitionbyname-error-variable-is-not-defined/comment-page-1/#comment-1603</link>
		<dc:creator>Andrei Ionescu</dc:creator>
		<pubDate>Sat, 02 May 2009 15:39:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.flexer.info/?p=751#comment-1603</guid>
		<description>Mem, thanks for your comment.</description>
		<content:encoded><![CDATA[<p>Mem, thanks for your comment.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

