<?xml version="1.0" encoding="utf-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc = "http://purl.org/dc/elements/1.1/" xmlns="http://purl.org/rss/1.0/">
	<channel rdf:about="http://livedocs.adobe.com/">
	<title>LiveDocs Comments - flash - 9.0 - ActionScriptLangRefV3 - flash/display/Loader.html</title>	
		<link>http://livedocs.adobe.com/</link>
		<description>Macromedia LiveDocs - online documentation with user feedback.</description>
		<copyright>Copyright 2009, Macromedia, Inc.</copyright>
		<dc:date>2009-11-25T12:12:55</dc:date>
		<dc:language>en-us</dc:language>
		<items>
			<rdf:Seq>
				<rdf:li rdf:resource="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/Loader.html#88833" />
				<rdf:li rdf:resource="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/Loader.html#87642" />
				<rdf:li rdf:resource="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/Loader.html#83603" />
				<rdf:li rdf:resource="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/Loader.html#82691" />
				<rdf:li rdf:resource="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/Loader.html#80522" />
				<rdf:li rdf:resource="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/Loader.html#76125" />
				<rdf:li rdf:resource="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/Loader.html#74885" />
				<rdf:li rdf:resource="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/Loader.html#74878" />
				<rdf:li rdf:resource="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/Loader.html#72220" />
				<rdf:li rdf:resource="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/Loader.html#72051" />
				<rdf:li rdf:resource="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/Loader.html#71184" />
				<rdf:li rdf:resource="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/Loader.html#69870" />
				<rdf:li rdf:resource="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/Loader.html#68718" />
				<rdf:li rdf:resource="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/Loader.html#68610" />
			</rdf:Seq>
		</items>
	</channel>
	
	<item rdf:about="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/Loader.html#88833">
		<title>flash/9.0/ActionScriptLangRefV3/flash/display/Loader.html</title>
		<link>http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/Loader.html#88833</link>
		<description>This is somewhat of a public service announcement. I would have found this helpful a while ago, so I hope it helps others.  Unfortunately pre-FP10 actionscript 3 has no way to guarantee that unloaded content has been completely released from memory, even when the Loader.unload() method is used.&lt;br /&gt;&lt;br /&gt;Best solution? Migrate to Flash 10's unloadAndStop.&lt;br /&gt;&lt;br /&gt;Another solution is to expose a 'dispose' method on loaded content, that the hosting swf can call before it unloads the content. The content's dispose method must remove all event listeners, stop all sounds, dispose all bitmap data, etc. Unfortunately, this is not feasible when the external content is not under the control of the host swf developer.&lt;br /&gt;&lt;br /&gt;Some people consider this a bit of an oversight in the design of AS3:&lt;br /&gt;http://www.gskinner.com/blog/archives/2008/04/failure_to_unlo.html&lt;br /&gt;&lt;br /&gt;(Note that Actionscript 2's unload functionality immediately purged all references to loaded content.)</description>
		<dc:creator>AidanFraser</dc:creator>
		<dc:type>0 0</dc:type>
		<dc:date>2008-10-22T16:19:32</dc:date>
	</item>
	<item rdf:about="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/Loader.html#87642">
		<title>flash/9.0/ActionScriptLangRefV3/flash/display/Loader.html</title>
		<link>http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/Loader.html#87642</link>
		<description>For all who are suffering with the same thing I am:&lt;br /&gt;&lt;br /&gt;Loaders dispatch an IOErrorEvent when Flash Player has reached a certain threshold of loading content. I'm not sure where this threshold is, but I'm reporting a bug on the JIRA. My thought is that the error event is dispatched when Flash can't connect to the file due to more incoming/outgoing loading from Flash Player, just like if your internet is slow it takes forever to actually load the images. Has anyone else experienced this?&lt;br /&gt;&lt;br /&gt; - TK</description>
		<dc:creator>rfkrocktk</dc:creator>
		<dc:type>0 0</dc:type>
		<dc:date>2008-09-12T10:16:04</dc:date>
	</item>
	<item rdf:about="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/Loader.html#83603">
		<title>flash/9.0/ActionScriptLangRefV3/flash/display/Loader.html</title>
		<link>http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/Loader.html#83603</link>
		<description>In the example of the unload handler, it is registered without setting the useWeakReference flag and it doesn't unregister itself.  Wouldn't this mean that the object would not get garbage collected?  Or am I missing something?</description>
		<dc:creator>KeithIrwin</dc:creator>
		<dc:type>0 0</dc:type>
		<dc:date>2008-05-01T06:23:01</dc:date>
	</item>
	<item rdf:about="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/Loader.html#82691">
		<title>flash/9.0/ActionScriptLangRefV3/flash/display/Loader.html</title>
		<link>http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/Loader.html#82691</link>
		<description>Hi, more info on using Unload() would be helpful. The use of Unloading external swf files seems to be the baine of many a flash programmer.&lt;br /&gt;&lt;br /&gt;Why is it so hard to assign a button inside an externally coded swf file that unloads it?&lt;br /&gt;&lt;br /&gt;John.</description>
		<dc:creator>john anon</dc:creator>
		<dc:type>0 0</dc:type>
		<dc:date>2008-04-05T09:25:50</dc:date>
	</item>
	<item rdf:about="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/Loader.html#80522">
		<title>flash/9.0/ActionScriptLangRefV3/flash/display/Loader.html</title>
		<link>http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/Loader.html#80522</link>
		<description>I'm having a major problem with the Loader class and AMV1Movie.&lt;br /&gt;&lt;br /&gt;I can get it to load an AMV1Movie into the new AMV2 swf files, but once it loads I cannot get it to unload.  I even put the AMV1Movie into a MovieClip container, and then removeChild() on the MovieClip, but the music and memory from the AMV1Movie stays in memory.&lt;br /&gt;&lt;br /&gt;Has anyone tried loading old Flash swfs into a Flash 9 swf with success?  &lt;br /&gt;&lt;br /&gt;Thanks</description>
		<dc:creator>AlexCook</dc:creator>
		<dc:type>0 0</dc:type>
		<dc:date>2008-02-09T10:20:01</dc:date>
	</item>
	<item rdf:about="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/Loader.html#76125">
		<title>flash/9.0/ActionScriptLangRefV3/flash/display/Loader.html</title>
		<link>http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/Loader.html#76125</link>
		<description>it is possible once a Loader has loaded an SWF to copy the loaded movie clip, &lt;br /&gt;It involves accessing the child node of the Loader such that&lt;br /&gt;&lt;br /&gt;var loader = new Loader()&lt;br /&gt;..&lt;br /&gt;.. // load your file;  whatever code you need // &lt;br /&gt;.. // once loaded you can access the loaded SWF,  // &lt;br /&gt;..// Event.INIT is fired when the file loaded, not when the loading begins //&lt;br /&gt;..// Event.INIT can be used to trigger to clone the movie clip // &lt;br /&gt;.. &lt;br /&gt;loader.getChildAt(0) ;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;the child at index 0 is the loaded movieclip&lt;br /&gt;then you need to create a function that clones the movie clip, &lt;br /&gt;i use a recursive function to ensure all the child objects of the movie clip/s are also cloned&lt;br /&gt;&lt;br /&gt;function cloneDisplayObject(target)&lt;br /&gt;{&lt;br /&gt;       var targetClass:Class = Object(target).constructor&lt;br /&gt;	var duplicate = new targetClass()	&lt;br /&gt;	duplicate.transform = target.transform;&lt;br /&gt;	duplicate.filters = target.filters;&lt;br /&gt;	duplicate.cacheAsBitmap = target.cacheAsBitmap;&lt;br /&gt;	duplicate.opaqueBackground = target.opaqueBackground;&lt;br /&gt;	if (target.scale9Grid) {&lt;br /&gt;		var rect:Rectangle = target.scale9Grid;&lt;br /&gt;		// Flash 9 bug where returned scale9Grid is 20x larger than assigned&lt;br /&gt;	       rect.x /= 20, rect.y /= 20, rect.width /= 20, rect.height /= 20;&lt;br /&gt;	duplicate.scale9Grid = rect;&lt;br /&gt;	}&lt;br /&gt;	if (target.hasOwnProperty(&quot;numChildren&quot;))&lt;br /&gt;	{&lt;br /&gt;		for (var i = 0 ; i &lt; target.numChildren; i ++)&lt;br /&gt;		{&lt;br /&gt;		        duplicate.addChild(cloneDisplayObject(target.getChildAt(i)));&lt;br /&gt;		}&lt;br /&gt;	}&lt;br /&gt;	return duplicate;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;The above function has modified from what i found on this page&lt;br /&gt;&lt;br /&gt;http://www.senocular.com/flash/actionscript.php?file=ActionScript_3.0/com/senocular/display/duplicateDisplayObject.as&lt;br /&gt;&lt;br /&gt;hope this helps someone</description>
		<dc:creator></dc:creator>
		<dc:type>0 0</dc:type>
		<dc:date>2007-11-05T01:13:39</dc:date>
	</item>
	<item rdf:about="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/Loader.html#74885">
		<title>flash/9.0/ActionScriptLangRefV3/flash/display/Loader.html</title>
		<link>http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/Loader.html#74885</link>
		<description>I don't think you can duplicate a loaded SWF file, but you can instantiate a clip from the library of a loaded SWF file multiple times.  Here I've loaded a SWF with a movieClip in it's libary with a class name of &quot;testClip&quot;:&lt;br /&gt;&lt;br /&gt;function initHandler(e:Event) {&lt;br /&gt;	var applicationDomain:ApplicationDomain = e.target.applicationDomain; // e.target is the loaderInfo object&lt;br /&gt;	var testClip:Class=applicationDomain.getDefinition(&quot;testClip&quot;) as Class;&lt;br /&gt;	var clip = new testClip();&lt;br /&gt;	addChild(clip);&lt;br /&gt;	var clip2 = new testClip();&lt;br /&gt;	addChild(clip2);&lt;br /&gt;	clip2.y= 100;&lt;br /&gt;	 var clip3 = new testClip();&lt;br /&gt;	addChild(clip3);&lt;br /&gt;	clip.3= 200;&lt;br /&gt;}</description>
		<dc:creator>GalaxyBeing</dc:creator>
		<dc:type>0 1</dc:type>
		<dc:date>2007-10-18T19:01:35</dc:date>
	</item>
	<item rdf:about="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/Loader.html#74878">
		<title>flash/9.0/ActionScriptLangRefV3/flash/display/Loader.html</title>
		<link>http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/Loader.html#74878</link>
		<description>minor copy fix:  &quot;Again, you can use the LoaderInfo object event notifications to detect when the components is finished loading.&quot;  should be &quot;components are finished loading&quot;.</description>
		<dc:creator>GalaxyBeing</dc:creator>
		<dc:type>0 0</dc:type>
		<dc:date>2007-10-12T10:07:23</dc:date>
	</item>
	<item rdf:about="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/Loader.html#72220">
		<title>flash/9.0/ActionScriptLangRefV3/flash/display/Loader.html</title>
		<link>http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/Loader.html#72220</link>
		<description>ScrollRect can mess up Loader.&lt;br /&gt;&lt;br /&gt;I had a child sprite 2000 pix wide in a swf that the loader kept setting to the stage width of 1024.  After hours of debugging I found it was the sprite's scrollRect that was the problem - if I set it back to null before the Loader loaded the swf, the loader didn't truncate it anymore.</description>
		<dc:creator>dTronic</dc:creator>
		<dc:type>0 0</dc:type>
		<dc:date>2007-08-17T11:12:37</dc:date>
	</item>
	<item rdf:about="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/Loader.html#72051">
		<title>flash/9.0/ActionScriptLangRefV3/flash/display/Loader.html</title>
		<link>http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/Loader.html#72051</link>
		<description>In AS3 can you duplicate a loaded SWF file?&lt;br /&gt;&lt;br /&gt;No where in the docs does it say that this issue has changed from AS2- I was hoping to get clarification from Adobe if they have fixed this issue or not. - I can't seem to get any code to work that would duplicate a loaded swf - it usually just removes the first instance and places it in the new second instance.&lt;br /&gt;&lt;br /&gt;Thanks.</description>
		<dc:creator>wdrudolph</dc:creator>
		<dc:type>0 0</dc:type>
		<dc:date>2007-08-15T08:45:18</dc:date>
	</item>
	<item rdf:about="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/Loader.html#71184">
		<title>flash/9.0/ActionScriptLangRefV3/flash/display/Loader.html</title>
		<link>http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/Loader.html#71184</link>
		<description>Hi - I had trouble with the code above - it wasn't showing any event activity.&lt;br /&gt;&lt;br /&gt;Don't add listeners to the Loader object, add them to Loader.contentLoaderInfo.&lt;br /&gt;&lt;br /&gt;Replace this function and it works:&lt;br /&gt;&lt;br /&gt;private function configureListeners(dispatcher:IEventDispatcher):void {&lt;br /&gt;            dispatcher.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler);&lt;br /&gt;            dispatcher.contentLoaderInfo.addEventListener(HTTPStatusEvent.HTTP_STATUS, httpStatusHandler);&lt;br /&gt;            dispatcher.contentLoaderInfo.addEventListener(Event.INIT, initHandler);&lt;br /&gt;            dispatcher.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);&lt;br /&gt;            dispatcher.contentLoaderInfo.addEventListener(Event.OPEN, openHandler);&lt;br /&gt;            dispatcher.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, progressHandler);&lt;br /&gt;            dispatcher.contentLoaderInfo.addEventListener(Event.UNLOAD, unLoadHandler);&lt;br /&gt;        }</description>
		<dc:creator></dc:creator>
		<dc:type>0 0</dc:type>
		<dc:date>2007-08-01T00:55:17</dc:date>
	</item>
	<item rdf:about="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/Loader.html#69870">
		<title>flash/9.0/ActionScriptLangRefV3/flash/display/Loader.html</title>
		<link>http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/Loader.html#69870</link>
		<description>Hi, I'm having trouble with the Loader class.&lt;br /&gt;&lt;br /&gt;Upon creation, the debugger reports almost all of the variables in the contentLoaderInfo object inside the Loader object as &lt;exception thrown by getter&gt;&lt;br /&gt;&lt;br /&gt;I'm fairly new to AS3 so I'm not sure if this is supposed to happen until performing some other operation..   I've googled it but got nowhere.  Any help would be greatly appreciated!!  Thanks</description>
		<dc:creator></dc:creator>
		<dc:type>0 0</dc:type>
		<dc:date>2007-07-10T02:56:03</dc:date>
	</item>
	<item rdf:about="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/Loader.html#68718">
		<title>flash/9.0/ActionScriptLangRefV3/flash/display/Loader.html</title>
		<link>http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/Loader.html#68718</link>
		<description>It seems there is a bug in the Flash IDE; Images loaded using the Loader class are not removed by the Garbage Collector.&lt;br /&gt;Once the code is ran in the browser the problem is gone and the memory usage remains at a normal level...</description>
		<dc:creator>justGREAT.nl</dc:creator>
		<dc:type>0 0</dc:type>
		<dc:date>2007-06-20T05:09:13</dc:date>
	</item>
	<item rdf:about="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/Loader.html#68610">
		<title>flash/9.0/ActionScriptLangRefV3/flash/display/Loader.html</title>
		<link>http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/Loader.html#68610</link>
		<description>I have this strange GC problem with the loader class;&lt;br /&gt;When I load an image and unload it later on. It won't be disposed by the garbage collector.&lt;br /&gt;There are no references to neither the Loader nor the (weak) eventlisteners. After loading the image a couple of times the memory goes sky high :(&lt;br /&gt;Here is a (simple) example:&lt;br /&gt;&lt;br /&gt;//this example loads an image, unloads it as soon as it's loaded, and loads another one....&lt;br /&gt;package {&lt;br /&gt;	import flash.display.Sprite;&lt;br /&gt;	import flash.display.Loader;&lt;br /&gt;	import flash.events.Event;&lt;br /&gt;	import flash.net.URLRequest;&lt;br /&gt;	import flash.system.System;&lt;br /&gt;	&lt;br /&gt;	public class Application extends Sprite{&lt;br /&gt;		&lt;br /&gt;		private var currentLdr:Loader;&lt;br /&gt;		private var request:URLRequest;&lt;br /&gt;		&lt;br /&gt;		function Application(){&lt;br /&gt;			this.request = new URLRequest(&quot;http://www.flashfocus.nl/forum/image.php?u=8105&amp;dateline=1182191022&quot;);&lt;br /&gt;			this.loadNextImage();&lt;br /&gt;		}&lt;br /&gt;		&lt;br /&gt;		private function loadNextImage(){&lt;br /&gt;			this.currentLdr = new Loader();&lt;br /&gt;			this.currentLdr.contentLoaderInfo.addEventListener(Event.COMPLETE, this.loadCompleteHandler,false,0,true);&lt;br /&gt;			this.currentLdr.contentLoaderInfo.addEventListener(Event.UNLOAD, this.unloadCompleteHandler,false,0,true);&lt;br /&gt;			this.currentLdr.load(this.request);&lt;br /&gt;			&lt;br /&gt;			trace(&quot;Current mem: &quot; + System.totalMemory);&lt;br /&gt;		}&lt;br /&gt;		&lt;br /&gt;		private function loadCompleteHandler(event:Event):void{&lt;br /&gt;			this.currentLdr.unload();&lt;br /&gt;		}&lt;br /&gt;		private function unloadCompleteHandler(event:Event):void{&lt;br /&gt;			this.loadNextImage();&lt;br /&gt;		}&lt;br /&gt;	&lt;br /&gt;	}&lt;br /&gt;}&lt;br /&gt;//&lt;br /&gt;&lt;br /&gt;Could anyone explain why de GC doesn't clean the loaded content...&lt;br /&gt;&lt;br /&gt;PS: using the unload method on the loader does not affect the memory. :(</description>
		<dc:creator>justGREAT.nl</dc:creator>
		<dc:type>0 0</dc:type>
		<dc:date>2007-06-18T12:16:54</dc:date>
	</item>
	</rdf:RDF>

