<?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 Loader unload() error</title>
	<atom:link href="http://www.xllusion.net/ed/2008/06/19/as3-loader-unload-error/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.xllusion.net/ed/2008/06/19/as3-loader-unload-error/</link>
	<description>Flash, Actionscript, Javascript, PHP and more?</description>
	<lastBuildDate>Thu, 21 Jan 2010 21:10:51 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Pado</title>
		<link>http://www.xllusion.net/ed/2008/06/19/as3-loader-unload-error/comment-page-1/#comment-1912</link>
		<dc:creator>Pado</dc:creator>
		<pubDate>Fri, 26 Jun 2009 09:28:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.xllusion.net/ed/2008/06/19/as3-loader-unload-error/#comment-1912</guid>
		<description>Hi, I&#039;m trying to understand this, but my problem is a bit different so I was wondering if you could help me sort it out. I&#039;m creating a test that clears the page and then loads new XML content and I&#039;m getting this very same error. Here is my code:
public function LoadXML() {
			XML_URL = &quot;exam-problems&quot; + pageNumber + &quot;.xml&quot;;
			contentXMLURL = new URLRequest(XML_URL);
			contentXMLLoader = new URLLoader(contentXMLURL);
			contentXMLLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onCompleteHandler);
			contentXMLLoader.addEventListener(Event.COMPLETE, xmlLoaded);

			function xmlLoaded(event:Event):void {
				var theXML:DisplayObject = event.target.content;
				if (contentXMLLoader != null) {
					unload();
				}
				contentXML = new XML(event.target.data);
				for (var i:int = 0; i&lt;contentXML.*.length(); i++) {
					questions[i] = contentXML.PROBLEM[i].@QUESTION;
					choicesArry1[i] = contentXML.PROBLEM[i].@CHOICE1;
					choicesArry2[i] = contentXML.PROBLEM[i].@CHOICE2;
					choicesArry3[i] = contentXML.PROBLEM[i].@CHOICE3;
					choicesArry4[i] = contentXML.PROBLEM[i].@CHOICE4;
					answers[i] = contentXML.PROBLEM[i].@THEANSWER;
				}
				numberOfProblems = questions.length;
				startTestCreation();
			}
		}
		function onCompleteHandler(e:Event):void {
			// This will not cause the error
			contentXMLLoader.unload();
			contentXMLLoader = null;
		}
Can someone help me figure out what I&#039;m doing wrong? Thanks.</description>
		<content:encoded><![CDATA[<p>Hi, I&#8217;m trying to understand this, but my problem is a bit different so I was wondering if you could help me sort it out. I&#8217;m creating a test that clears the page and then loads new XML content and I&#8217;m getting this very same error. Here is my code:<br />
public function LoadXML() {<br />
			XML_URL = &#8220;exam-problems&#8221; + pageNumber + &#8220;.xml&#8221;;<br />
			contentXMLURL = new URLRequest(XML_URL);<br />
			contentXMLLoader = new URLLoader(contentXMLURL);<br />
			contentXMLLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onCompleteHandler);<br />
			contentXMLLoader.addEventListener(Event.COMPLETE, xmlLoaded);</p>
<p>			function xmlLoaded(event:Event):void {<br />
				var theXML:DisplayObject = event.target.content;<br />
				if (contentXMLLoader != null) {<br />
					unload();<br />
				}<br />
				contentXML = new XML(event.target.data);<br />
				for (var i:int = 0; i&lt;contentXML.*.length(); i++) {<br />
					questions[i] = contentXML.PROBLEM[i].@QUESTION;<br />
					choicesArry1[i] = contentXML.PROBLEM[i].@CHOICE1;<br />
					choicesArry2[i] = contentXML.PROBLEM[i].@CHOICE2;<br />
					choicesArry3[i] = contentXML.PROBLEM[i].@CHOICE3;<br />
					choicesArry4[i] = contentXML.PROBLEM[i].@CHOICE4;<br />
					answers[i] = contentXML.PROBLEM[i].@THEANSWER;<br />
				}<br />
				numberOfProblems = questions.length;<br />
				startTestCreation();<br />
			}<br />
		}<br />
		function onCompleteHandler(e:Event):void {<br />
			// This will not cause the error<br />
			contentXMLLoader.unload();<br />
			contentXMLLoader = null;<br />
		}<br />
Can someone help me figure out what I&#039;m doing wrong? Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: shane</title>
		<link>http://www.xllusion.net/ed/2008/06/19/as3-loader-unload-error/comment-page-1/#comment-1891</link>
		<dc:creator>shane</dc:creator>
		<pubDate>Mon, 08 Jun 2009 03:24:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.xllusion.net/ed/2008/06/19/as3-loader-unload-error/#comment-1891</guid>
		<description>new here, first post for help.

i have a simple slide show type .fla (AS 3.0)
slide1, space to goto slide2, space to goto slide3, etc.  then, i need to load an external .swf to act as slide4.  it loads, plays, and then stops on the last frame of the external .swf.  I cannot find info on how to wait for the external swf to play and finish, and then jump right into the main movie at slide5.

this make sense?

any ideas?</description>
		<content:encoded><![CDATA[<p>new here, first post for help.</p>
<p>i have a simple slide show type .fla (AS 3.0)<br />
slide1, space to goto slide2, space to goto slide3, etc.  then, i need to load an external .swf to act as slide4.  it loads, plays, and then stops on the last frame of the external .swf.  I cannot find info on how to wait for the external swf to play and finish, and then jump right into the main movie at slide5.</p>
<p>this make sense?</p>
<p>any ideas?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JB</title>
		<link>http://www.xllusion.net/ed/2008/06/19/as3-loader-unload-error/comment-page-1/#comment-1871</link>
		<dc:creator>JB</dc:creator>
		<pubDate>Fri, 29 May 2009 13:13:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.xllusion.net/ed/2008/06/19/as3-loader-unload-error/#comment-1871</guid>
		<description>Hey there!
First of all thanks for the info in this article, it helped me a lot. I&#039;ll post my implementation, maybe it will help some of you.

var mLoader:Loader = new Loader();
function startLoad(urlParam:String)
{
	if(mcHolder.numChildren &gt; 0)
	{
		mcHolder.removeChildAt(0);
	}
	if(urlParam != &quot;&quot;)
	{
		mLoader = new Loader();
		mLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onCompleteHandler);
		mLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onProgressHandler);
		mLoader.load (new URLRequest(urlParam));
	}
	else
	{
		trace(&quot;We have an empty string URL param.&quot;);
	}
}

function onCompleteHandler(e:Event):void
{
	mcHolder.addChild(e.target.content);
}
function onProgressHandler(mProgress:ProgressEvent)
{
	var percent:Number = mProgress.bytesLoaded/mProgress.bytesTotal;
	trace(percent);
}

&quot;mcHolder&quot; is an emtpy MC on the stage. You can call the function multiple times with:

startLoad(&quot;movie.swf&quot;);
or startLoad(&quot;&quot;);</description>
		<content:encoded><![CDATA[<p>Hey there!<br />
First of all thanks for the info in this article, it helped me a lot. I&#8217;ll post my implementation, maybe it will help some of you.</p>
<p>var mLoader:Loader = new Loader();<br />
function startLoad(urlParam:String)<br />
{<br />
	if(mcHolder.numChildren &gt; 0)<br />
	{<br />
		mcHolder.removeChildAt(0);<br />
	}<br />
	if(urlParam != &#8220;&#8221;)<br />
	{<br />
		mLoader = new Loader();<br />
		mLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onCompleteHandler);<br />
		mLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onProgressHandler);<br />
		mLoader.load (new URLRequest(urlParam));<br />
	}<br />
	else<br />
	{<br />
		trace(&#8220;We have an empty string URL param.&#8221;);<br />
	}<br />
}</p>
<p>function onCompleteHandler(e:Event):void<br />
{<br />
	mcHolder.addChild(e.target.content);<br />
}<br />
function onProgressHandler(mProgress:ProgressEvent)<br />
{<br />
	var percent:Number = mProgress.bytesLoaded/mProgress.bytesTotal;<br />
	trace(percent);<br />
}</p>
<p>&#8220;mcHolder&#8221; is an emtpy MC on the stage. You can call the function multiple times with:</p>
<p>startLoad(&#8220;movie.swf&#8221;);<br />
or startLoad(&#8220;&#8221;);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tammy</title>
		<link>http://www.xllusion.net/ed/2008/06/19/as3-loader-unload-error/comment-page-1/#comment-1869</link>
		<dc:creator>Tammy</dc:creator>
		<pubDate>Sun, 24 May 2009 12:53:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.xllusion.net/ed/2008/06/19/as3-loader-unload-error/#comment-1869</guid>
		<description>Hey, 

I had the same #2505 error. I did what Ed did,

myloader = new Loader();
myloader.load(newValue);

And it worked!

But doesn&#039;t this mean that each previously loaded content stays? (Which isn&#039;t a problem for me, because there are only 9 images loaded to my movie) - Wouldn&#039;t it use up more memory, because it&#039;s creating a new instance of a loader? 

** confused **</description>
		<content:encoded><![CDATA[<p>Hey, </p>
<p>I had the same #2505 error. I did what Ed did,</p>
<p>myloader = new Loader();<br />
myloader.load(newValue);</p>
<p>And it worked!</p>
<p>But doesn&#8217;t this mean that each previously loaded content stays? (Which isn&#8217;t a problem for me, because there are only 9 images loaded to my movie) &#8211; Wouldn&#8217;t it use up more memory, because it&#8217;s creating a new instance of a loader? </p>
<p>** confused **</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jon</title>
		<link>http://www.xllusion.net/ed/2008/06/19/as3-loader-unload-error/comment-page-1/#comment-1859</link>
		<dc:creator>jon</dc:creator>
		<pubDate>Sun, 19 Apr 2009 15:40:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.xllusion.net/ed/2008/06/19/as3-loader-unload-error/#comment-1859</guid>
		<description>i set it to null, but there are still listeners listening from the unloaded swf...</description>
		<content:encoded><![CDATA[<p>i set it to null, but there are still listeners listening from the unloaded swf&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ed</title>
		<link>http://www.xllusion.net/ed/2008/06/19/as3-loader-unload-error/comment-page-1/#comment-1829</link>
		<dc:creator>Ed</dc:creator>
		<pubDate>Mon, 29 Dec 2008 17:54:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.xllusion.net/ed/2008/06/19/as3-loader-unload-error/#comment-1829</guid>
		<description>If you want to re-use myLoader, you will always need to instantiate it since we have set it to null to avoid errors when unloading.</description>
		<content:encoded><![CDATA[<p>If you want to re-use myLoader, you will always need to instantiate it since we have set it to null to avoid errors when unloading.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
