<?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: Application Domain and External SWF Loading</title>
	<atom:link href="http://annafilina.com/blog/application-domain-and-external-swf-loading/feed/" rel="self" type="application/rss+xml" />
	<link>http://annafilina.com/blog/application-domain-and-external-swf-loading/</link>
	<description>Web applications developer, conference organizer, geek...</description>
	<lastBuildDate>Thu, 19 Aug 2010 12:35:00 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Anna</title>
		<link>http://annafilina.com/blog/application-domain-and-external-swf-loading/comment-page-1/#comment-2492</link>
		<dc:creator>Anna</dc:creator>
		<pubDate>Tue, 30 Mar 2010 19:23:27 +0000</pubDate>
		<guid isPermaLink="false">http://annafilina.com/blog/?p=244#comment-2492</guid>
		<description>&lt;a href=&quot;#comment-2091&quot; rel=&quot;nofollow&quot;&gt;@Will &lt;/a&gt; Since your classes are in different ApplicationDomains, they are considered as different classes, even though their names are the same.
You might need to rethink the architecture of your application to prevent assigning objects between different ApplicationDomains.</description>
		<content:encoded><![CDATA[<p><a href="#comment-2091" rel="nofollow">@Will </a> Since your classes are in different ApplicationDomains, they are considered as different classes, even though their names are the same.<br />
You might need to rethink the architecture of your application to prevent assigning objects between different ApplicationDomains.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anna</title>
		<link>http://annafilina.com/blog/application-domain-and-external-swf-loading/comment-page-1/#comment-2491</link>
		<dc:creator>Anna</dc:creator>
		<pubDate>Tue, 30 Mar 2010 19:19:10 +0000</pubDate>
		<guid isPermaLink="false">http://annafilina.com/blog/?p=244#comment-2491</guid>
		<description>&lt;a href=&quot;#comment-2337&quot; rel=&quot;nofollow&quot;&gt;@Nacho &lt;/a&gt; As far as I know, once a class is instantiated, you may not change its definition. You can always create an instance of the second class and then copy the properties from the first instance.</description>
		<content:encoded><![CDATA[<p><a href="#comment-2337" rel="nofollow">@Nacho </a> As far as I know, once a class is instantiated, you may not change its definition. You can always create an instance of the second class and then copy the properties from the first instance.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: AJ</title>
		<link>http://annafilina.com/blog/application-domain-and-external-swf-loading/comment-page-1/#comment-2385</link>
		<dc:creator>AJ</dc:creator>
		<pubDate>Wed, 17 Mar 2010 12:21:14 +0000</pubDate>
		<guid isPermaLink="false">http://annafilina.com/blog/?p=244#comment-2385</guid>
		<description>@will did you try with local files and with both parent / child files in the same folder..?</description>
		<content:encoded><![CDATA[<p>@will did you try with local files and with both parent / child files in the same folder..?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nacho</title>
		<link>http://annafilina.com/blog/application-domain-and-external-swf-loading/comment-page-1/#comment-2337</link>
		<dc:creator>Nacho</dc:creator>
		<pubDate>Thu, 11 Mar 2010 18:29:18 +0000</pubDate>
		<guid isPermaLink="false">http://annafilina.com/blog/?p=244#comment-2337</guid>
		<description>Hi Anna. It&#039;s possible to change a class definition for a instance in runtime??
For example, i load a SWF with a class called SomeMovie in his own application domain. I create an instance of that class and add the movie clip using addChild. Then i load a second SWF with a class called SomeMovie too in his own application domain. There is a way to say at the instance that point to the class definition of the second loaded class ??</description>
		<content:encoded><![CDATA[<p>Hi Anna. It&#8217;s possible to change a class definition for a instance in runtime??<br />
For example, i load a SWF with a class called SomeMovie in his own application domain. I create an instance of that class and add the movie clip using addChild. Then i load a second SWF with a class called SomeMovie too in his own application domain. There is a way to say at the instance that point to the class definition of the second loaded class ??</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Will</title>
		<link>http://annafilina.com/blog/application-domain-and-external-swf-loading/comment-page-1/#comment-2091</link>
		<dc:creator>Will</dc:creator>
		<pubDate>Fri, 19 Feb 2010 18:48:04 +0000</pubDate>
		<guid isPermaLink="false">http://annafilina.com/blog/?p=244#comment-2091</guid>
		<description>Hi Anna,

Thank you for the post, very informative. I was hoping you could give an example on how to gain reference to a class in a separate ApplicationDomain. For example, I am building an avatar class and will want to load the avatar into the application swf, but in its own application domain. After loading it externally, I can create the class as follows:

var avatarClass:Class = info.content.loaderInfo.applicationDomain.getDefinition(&quot;com.isointeractive.avatar.AvatarTypeBase&quot;) as Class;

But when I attempt to create an instance, such as:

var test:AvatarTypeBase = AvatarTypeBase(new avatarClass());

I receive the following error:

TypeError: Error #1034: Type Coercion failed: cannot convert com.isointeractive.avatar::AvatarTypeBase@3135a2e1 to com.isointeractive.avatar.AvatarTypeBase.

The problem is that I&#039;m trying to assign my variable, &quot;test&quot; to an object of the same type (AvatarTypeBase), but in a different application domain. Do you know how to resolve this? Thanks!</description>
		<content:encoded><![CDATA[<p>Hi Anna,</p>
<p>Thank you for the post, very informative. I was hoping you could give an example on how to gain reference to a class in a separate ApplicationDomain. For example, I am building an avatar class and will want to load the avatar into the application swf, but in its own application domain. After loading it externally, I can create the class as follows:</p>
<p>var avatarClass:Class = info.content.loaderInfo.applicationDomain.getDefinition(&#8220;com.isointeractive.avatar.AvatarTypeBase&#8221;) as Class;</p>
<p>But when I attempt to create an instance, such as:</p>
<p>var test:AvatarTypeBase = AvatarTypeBase(new avatarClass());</p>
<p>I receive the following error:</p>
<p>TypeError: Error #1034: Type Coercion failed: cannot convert com.isointeractive.avatar::AvatarTypeBase@3135a2e1 to com.isointeractive.avatar.AvatarTypeBase.</p>
<p>The problem is that I&#8217;m trying to assign my variable, &#8220;test&#8221; to an object of the same type (AvatarTypeBase), but in a different application domain. Do you know how to resolve this? Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anna</title>
		<link>http://annafilina.com/blog/application-domain-and-external-swf-loading/comment-page-1/#comment-496</link>
		<dc:creator>Anna</dc:creator>
		<pubDate>Sat, 15 Aug 2009 11:18:33 +0000</pubDate>
		<guid isPermaLink="false">http://annafilina.com/blog/?p=244#comment-496</guid>
		<description>Bruce,

Actually, the stage is contained within the domain, and not the other way around. I can&#039;t find any official documentation that explains it in the way I like.

There is not need to store the context variable once you are done loading and the naming is not important. You may store references to your various ApplicationDomain somewhere, or simply access them using Loader.contentLoaderInfo.applicationDomain or DisplayObject.contentLoaderInfo.applicationDomain</description>
		<content:encoded><![CDATA[<p>Bruce,</p>
<p>Actually, the stage is contained within the domain, and not the other way around. I can&#8217;t find any official documentation that explains it in the way I like.</p>
<p>There is not need to store the context variable once you are done loading and the naming is not important. You may store references to your various ApplicationDomain somewhere, or simply access them using Loader.contentLoaderInfo.applicationDomain or DisplayObject.contentLoaderInfo.applicationDomain</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bruce</title>
		<link>http://annafilina.com/blog/application-domain-and-external-swf-loading/comment-page-1/#comment-489</link>
		<dc:creator>Bruce</dc:creator>
		<pubDate>Fri, 07 Aug 2009 00:57:23 +0000</pubDate>
		<guid isPermaLink="false">http://annafilina.com/blog/?p=244#comment-489</guid>
		<description>Nicely written, Anna.  You have a nice way of making the ideas comfortable.

I have two questions.  First, could you elaborate on the idea of the &quot;domain.&quot;  Your image suggests that a &quot;domain&quot; occupies a space &quot;off-stage.&quot;  Is there a technical definition that explains that relationship somewhere?

Second, I have searched all over and have not found a clear explanation of how to call multiple independent applicationDomains.  Does each context variable need it&#039;s own unique variable name?  Is how they are named significant in some larger scheme?

Thanks again for a well written tutorial.</description>
		<content:encoded><![CDATA[<p>Nicely written, Anna.  You have a nice way of making the ideas comfortable.</p>
<p>I have two questions.  First, could you elaborate on the idea of the &#8220;domain.&#8221;  Your image suggests that a &#8220;domain&#8221; occupies a space &#8220;off-stage.&#8221;  Is there a technical definition that explains that relationship somewhere?</p>
<p>Second, I have searched all over and have not found a clear explanation of how to call multiple independent applicationDomains.  Does each context variable need it&#8217;s own unique variable name?  Is how they are named significant in some larger scheme?</p>
<p>Thanks again for a well written tutorial.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anna</title>
		<link>http://annafilina.com/blog/application-domain-and-external-swf-loading/comment-page-1/#comment-439</link>
		<dc:creator>Anna</dc:creator>
		<pubDate>Tue, 21 Jul 2009 14:52:28 +0000</pubDate>
		<guid isPermaLink="false">http://annafilina.com/blog/?p=244#comment-439</guid>
		<description>I&#039;m not sure that the content of the loaded file matters. Make sure that all references from the main application to the loaded content is severed: visual elements removed from stage, any variables referring to the content cleared and any event listeners removed. Only then should you call the unload() method. I hope this helps.</description>
		<content:encoded><![CDATA[<p>I&#8217;m not sure that the content of the loaded file matters. Make sure that all references from the main application to the loaded content is severed: visual elements removed from stage, any variables referring to the content cleared and any event listeners removed. Only then should you call the unload() method. I hope this helps.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonahtan</title>
		<link>http://annafilina.com/blog/application-domain-and-external-swf-loading/comment-page-1/#comment-430</link>
		<dc:creator>Jonahtan</dc:creator>
		<pubDate>Mon, 20 Jul 2009 14:34:36 +0000</pubDate>
		<guid isPermaLink="false">http://annafilina.com/blog/?p=244#comment-430</guid>
		<description>Hi Anna.  I am using application domains in a modular application.  I have noticed that what I load an application in a new domain that contains a native flash component memory is never freed on when Loader.unload or Loader.unloadAndStop is called.  Any suggestions as to how to get a flash components to release from memory in new Applicaiton Domain?</description>
		<content:encoded><![CDATA[<p>Hi Anna.  I am using application domains in a modular application.  I have noticed that what I load an application in a new domain that contains a native flash component memory is never freed on when Loader.unload or Loader.unloadAndStop is called.  Any suggestions as to how to get a flash components to release from memory in new Applicaiton Domain?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anna</title>
		<link>http://annafilina.com/blog/application-domain-and-external-swf-loading/comment-page-1/#comment-289</link>
		<dc:creator>Anna</dc:creator>
		<pubDate>Wed, 03 Jun 2009 19:06:09 +0000</pubDate>
		<guid isPermaLink="false">http://annafilina.com/blog/?p=244#comment-289</guid>
		<description>By default, any domain is able to access ApplicationDomain.currentDomain, but not the others. If domainA needs to access a class definition in domainB, you have to explicitly point to that domain by calling domainB.getDefinition(...)

http://livedocs.adobe.com/flex/3/langref/flash/system/ApplicationDomain.html#getDefinition()

What exact statement leads to this runtime error?</description>
		<content:encoded><![CDATA[<p>By default, any domain is able to access ApplicationDomain.currentDomain, but not the others. If domainA needs to access a class definition in domainB, you have to explicitly point to that domain by calling domainB.getDefinition(&#8230;)</p>
<p><a href="http://livedocs.adobe.com/flex/3/langref/flash/system/ApplicationDomain.html#getDefinition()" rel="nofollow">http://livedocs.adobe.com/flex/3/langref/flash/system/ApplicationDomain.html#getDefinition()</a></p>
<p>What exact statement leads to this runtime error?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
