<?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: AS3 Nightmare: Unload loader content</title>
	<atom:link href="http://www.arckid.com/blog/flash/as3-nightmare-unload-loader-content/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.arckid.com/blog/flash/as3-nightmare-unload-loader-content/</link>
	<description>All about RIA development using Flash, Flex, Flash Media Server (Flashcom) with various middleware and backends.</description>
	<lastBuildDate>Thu, 04 Mar 2010 04:09:48 -0800</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
	<item>
		<title>By: Eric</title>
		<link>http://www.arckid.com/blog/flash/as3-nightmare-unload-loader-content/comment-page-1/#comment-56281</link>
		<dc:creator>Eric</dc:creator>
		<pubDate>Thu, 04 Feb 2010 17:01:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.arckid.com/blog/archives/2008/02/09/as3-nightmare-unload-loader-content/#comment-56281</guid>
		<description>@Josh
You may be right about building a working example of the problem for Adobe to look at.... but this particular issue is based on what I think is just counter-intuitive design within AS3.

When you unload a SWF, call MyLoader.unload() or conainer.removeChild(mySwf), then logically whatever those objects contained should be closed and removed as well - automatically. To make an example, it&#039;s like telling a person to get out of the car, and when he does there&#039;s still a heart, lungs, kidneys, etc all just laying there in a bloody heap because, oops- you forgot to tell them to get out as well. 

The point is, you shouldn&#039;t have to explicitly get rid of everything an object contains before you get rid of the object, itself. That&#039;s what the GC is supposed to do, and it goes to the whole point of having an object-oriented design.
Just my two cents.</description>
		<content:encoded><![CDATA[<p>@Josh<br />
You may be right about building a working example of the problem for Adobe to look at&#8230;. but this particular issue is based on what I think is just counter-intuitive design within AS3.</p>
<p>When you unload a SWF, call MyLoader.unload() or conainer.removeChild(mySwf), then logically whatever those objects contained should be closed and removed as well &#8211; automatically. To make an example, it&#8217;s like telling a person to get out of the car, and when he does there&#8217;s still a heart, lungs, kidneys, etc all just laying there in a bloody heap because, oops- you forgot to tell them to get out as well. </p>
<p>The point is, you shouldn&#8217;t have to explicitly get rid of everything an object contains before you get rid of the object, itself. That&#8217;s what the GC is supposed to do, and it goes to the whole point of having an object-oriented design.<br />
Just my two cents.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ashvin Savani - Arckid</title>
		<link>http://www.arckid.com/blog/flash/as3-nightmare-unload-loader-content/comment-page-1/#comment-46482</link>
		<dc:creator>Ashvin Savani - Arckid</dc:creator>
		<pubDate>Thu, 03 Apr 2008 05:20:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.arckid.com/blog/archives/2008/02/09/as3-nightmare-unload-loader-content/#comment-46482</guid>
		<description>redblind,

sorry for replying a late. But we are loading Applications or say modules as SWFs.

Can you tell me bit more about the DOM option or any links?

Thanks for the help.</description>
		<content:encoded><![CDATA[<p>redblind,</p>
<p>sorry for replying a late. But we are loading Applications or say modules as SWFs.</p>
<p>Can you tell me bit more about the DOM option or any links?</p>
<p>Thanks for the help.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: redblind</title>
		<link>http://www.arckid.com/blog/flash/as3-nightmare-unload-loader-content/comment-page-1/#comment-44838</link>
		<dc:creator>redblind</dc:creator>
		<pubDate>Fri, 21 Mar 2008 19:18:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.arckid.com/blog/archives/2008/02/09/as3-nightmare-unload-loader-content/#comment-44838</guid>
		<description>Hi there- I came across your post looking for a solution to something else, but I had run into a similar issue to yours before.

Are you playing audio, video, or streaming anything in your child swfs? Those should be closed in addition to removing your listeners.

You could also try using external interface to add and remove different swfs from the DOM, bypassing this whole loader issue.</description>
		<content:encoded><![CDATA[<p>Hi there- I came across your post looking for a solution to something else, but I had run into a similar issue to yours before.</p>
<p>Are you playing audio, video, or streaming anything in your child swfs? Those should be closed in addition to removing your listeners.</p>
<p>You could also try using external interface to add and remove different swfs from the DOM, bypassing this whole loader issue.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tahir</title>
		<link>http://www.arckid.com/blog/flash/as3-nightmare-unload-loader-content/comment-page-1/#comment-44205</link>
		<dc:creator>tahir</dc:creator>
		<pubDate>Mon, 17 Mar 2008 10:50:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.arckid.com/blog/archives/2008/02/09/as3-nightmare-unload-loader-content/#comment-44205</guid>
		<description>Uooth is one the fastest growing websites an the internet. Registrations is fast, simple tale is only a minute or two and then you ve an your way to being part of one of the greatest Uooth you will be able
to upload photos, videos, music leave comments on members profiles, write your owe blog, search for friends our make new one make your own profiles chat with friends discuss ideas calculate love   This Great Site</description>
		<content:encoded><![CDATA[<p>Uooth is one the fastest growing websites an the internet. Registrations is fast, simple tale is only a minute or two and then you ve an your way to being part of one of the greatest Uooth you will be able<br />
to upload photos, videos, music leave comments on members profiles, write your owe blog, search for friends our make new one make your own profiles chat with friends discuss ideas calculate love   This Great Site</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pablo</title>
		<link>http://www.arckid.com/blog/flash/as3-nightmare-unload-loader-content/comment-page-1/#comment-42397</link>
		<dc:creator>Pablo</dc:creator>
		<pubDate>Fri, 29 Feb 2008 19:21:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.arckid.com/blog/archives/2008/02/09/as3-nightmare-unload-loader-content/#comment-42397</guid>
		<description>u can solve this by doing this: - only tested with Loaders that loads Images -

(myLoader as Bitmap).bitmapData.dispose(); //DELETE all pixels from memory
myLoader.unload();</description>
		<content:encoded><![CDATA[<p>u can solve this by doing this: &#8211; only tested with Loaders that loads Images -</p>
<p>(myLoader as Bitmap).bitmapData.dispose(); //DELETE all pixels from memory<br />
myLoader.unload();</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ashvin Savani - Arckid</title>
		<link>http://www.arckid.com/blog/flash/as3-nightmare-unload-loader-content/comment-page-1/#comment-40158</link>
		<dc:creator>Ashvin Savani - Arckid</dc:creator>
		<pubDate>Thu, 14 Feb 2008 07:49:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.arckid.com/blog/archives/2008/02/09/as3-nightmare-unload-loader-content/#comment-40158</guid>
		<description>@Josh,

 Yes you are right, that We should give Adobe some test application which they can see and do something positive to solve issue in next release of flash player.

About events, We are removing events but still movieclips are not being removed from the memory. In some cases we even noticed that it doesn&#039;t remove child movieclips while you remove the parent and they are not listening to any events anymore. 

I will update you guys if we find any workaround than this because in our last tests we made on the code, this trick is even not helping. Just making sure out of 1000+ classes and all movieclips in library to make sure nothing else is affecting it.</description>
		<content:encoded><![CDATA[<p>@Josh,</p>
<p> Yes you are right, that We should give Adobe some test application which they can see and do something positive to solve issue in next release of flash player.</p>
<p>About events, We are removing events but still movieclips are not being removed from the memory. In some cases we even noticed that it doesn&#8217;t remove child movieclips while you remove the parent and they are not listening to any events anymore. </p>
<p>I will update you guys if we find any workaround than this because in our last tests we made on the code, this trick is even not helping. Just making sure out of 1000+ classes and all movieclips in library to make sure nothing else is affecting it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ashvin Savani - Arckid</title>
		<link>http://www.arckid.com/blog/flash/as3-nightmare-unload-loader-content/comment-page-1/#comment-40157</link>
		<dc:creator>Ashvin Savani - Arckid</dc:creator>
		<pubDate>Thu, 14 Feb 2008 07:44:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.arckid.com/blog/archives/2008/02/09/as3-nightmare-unload-loader-content/#comment-40157</guid>
		<description>@Bjorn

It actually require as I need to load another SWF application in place of one. If I won&#039;t force it much, It will use some memory and while I load another application; It will double the memory usage instead of remaining at same level.</description>
		<content:encoded><![CDATA[<p>@Bjorn</p>
<p>It actually require as I need to load another SWF application in place of one. If I won&#8217;t force it much, It will use some memory and while I load another application; It will double the memory usage instead of remaining at same level.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ashvin Savani - Arckid</title>
		<link>http://www.arckid.com/blog/flash/as3-nightmare-unload-loader-content/comment-page-1/#comment-40155</link>
		<dc:creator>Ashvin Savani - Arckid</dc:creator>
		<pubDate>Thu, 14 Feb 2008 07:41:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.arckid.com/blog/archives/2008/02/09/as3-nightmare-unload-loader-content/#comment-40155</guid>
		<description>@Cedric

I will try to use that and see if that helps and thanks for your feedback :)</description>
		<content:encoded><![CDATA[<p>@Cedric</p>
<p>I will try to use that and see if that helps and thanks for your feedback <img src='http://www.arckid.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Josh</title>
		<link>http://www.arckid.com/blog/flash/as3-nightmare-unload-loader-content/comment-page-1/#comment-40117</link>
		<dc:creator>Josh</dc:creator>
		<pubDate>Thu, 14 Feb 2008 00:44:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.arckid.com/blog/archives/2008/02/09/as3-nightmare-unload-loader-content/#comment-40117</guid>
		<description>If you think Adobe should do something about an issue, you need to provide valid test cases to help them understand your concerns. If you feel the garbage collector isn&#039;t running properly, build an example that demonstrates a reproducible memory leak or memory that balloons out of control when you are sure that all references have been removed.

You mentioned listening/broadcasting events. Be sure to remove event listeners when they aren&#039;t needed any more. That should be obvious. In cases where you need to listen to events from the stage, always use weak listeners. In fact, if you&#039;re listening for events from object FOO in object BAR and BAR doesn&#039;t directly manage the use of FOO (think subcomponents and similar fully-contained items), then you should be using weak listeners so that FOO doesn&#039;t keep a reference to BAR because BAR is still listening to FOO&#039;s events. Again, the most obvious example is the stage.</description>
		<content:encoded><![CDATA[<p>If you think Adobe should do something about an issue, you need to provide valid test cases to help them understand your concerns. If you feel the garbage collector isn&#8217;t running properly, build an example that demonstrates a reproducible memory leak or memory that balloons out of control when you are sure that all references have been removed.</p>
<p>You mentioned listening/broadcasting events. Be sure to remove event listeners when they aren&#8217;t needed any more. That should be obvious. In cases where you need to listen to events from the stage, always use weak listeners. In fact, if you&#8217;re listening for events from object FOO in object BAR and BAR doesn&#8217;t directly manage the use of FOO (think subcomponents and similar fully-contained items), then you should be using weak listeners so that FOO doesn&#8217;t keep a reference to BAR because BAR is still listening to FOO&#8217;s events. Again, the most obvious example is the stage.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bjorn</title>
		<link>http://www.arckid.com/blog/flash/as3-nightmare-unload-loader-content/comment-page-1/#comment-40108</link>
		<dc:creator>Bjorn</dc:creator>
		<pubDate>Wed, 13 Feb 2008 23:14:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.arckid.com/blog/archives/2008/02/09/as3-nightmare-unload-loader-content/#comment-40108</guid>
		<description>Is it even necessary to force gc once you have removed all your references.
Why not just wait until it runs normally?</description>
		<content:encoded><![CDATA[<p>Is it even necessary to force gc once you have removed all your references.<br />
Why not just wait until it runs normally?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cedric</title>
		<link>http://www.arckid.com/blog/flash/as3-nightmare-unload-loader-content/comment-page-1/#comment-40068</link>
		<dc:creator>Cedric</dc:creator>
		<pubDate>Wed, 13 Feb 2008 16:45:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.arckid.com/blog/archives/2008/02/09/as3-nightmare-unload-loader-content/#comment-40068</guid>
		<description>I always use weak reference for eventListeners (the last param set to true):
addEventListener(eventStr, eventHandlerFunc, false, 0, true);
This makes the Garbage Collector go round.</description>
		<content:encoded><![CDATA[<p>I always use weak reference for eventListeners (the last param set to true):<br />
addEventListener(eventStr, eventHandlerFunc, false, 0, true);<br />
This makes the Garbage Collector go round.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
