<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Flash User &#187; load swf</title>
	<atom:link href="http://www.flashuser.net/tag/load-swf/feed" rel="self" type="application/rss+xml" />
	<link>http://www.flashuser.net</link>
	<description>Useful and daily inspiration resources from web design, css, wordpress, graphic design, photography, illustrator, photoshop.</description>
	<lastBuildDate>Tue, 07 Feb 2012 10:23:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Tips &amp; Tricks 3: Loading of external resources such as images or SWFs using ActionScript 3.0</title>
		<link>http://www.flashuser.net/flash-tricks/loading-external-images-swfs-as3.html</link>
		<comments>http://www.flashuser.net/flash-tricks/loading-external-images-swfs-as3.html#comments</comments>
		<pubDate>Fri, 12 Jun 2009 09:22:30 +0000</pubDate>
		<dc:creator>flashuser</dc:creator>
				<category><![CDATA[ActionScript 3.0]]></category>
		<category><![CDATA[Flash Tips & Tricks]]></category>
		<category><![CDATA[actionscript 3]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[load swf]]></category>

		<guid isPermaLink="false">http://www.flashuser.net/?p=118</guid>
		<description><![CDATA[Maybe you have tried many different ways loading an external resource such as images or SWFs inside an empty movie clip from the stage and no matter what you have tried when loading another image / SWF again you saw two or three versions of it playing and hogging resources. Not good. You first need to understand that this loading problem of an external image or SWF is a bug in how the removing a child / garbage collector / display list mechanisms are working in AS3 / Flash player and not an issue with the SWF of your product(s). [...]]]></description>
			<content:encoded><![CDATA[<p>Maybe you have tried many different ways loading an external resource such as images or SWFs inside an empty movie clip from the stage and no matter what you have tried when loading another image / SWF again you saw two or three versions of it playing and hogging resources. Not good.</p>
<p><span id="more-118"></span></p>
<p>You first need to understand that this loading problem of an external image or SWF is a bug in how the removing a child / garbage collector / display list mechanisms are working in AS3 / Flash player and not an issue with the SWF of your product(s).</p>
<p>That&#8217;s because when you remove a child in Flash AS3, the reference to that child is still there in parent although you believed it was entirely removed. Here is a simple function that you can use in the future when you load images or SWFs inside an empty movie clip:</p>
<pre class="brush: as3; title: ; notranslate">function loadResource(resURL) {

var url = resURL;
var request1 = new URLRequest(url);
var loader1 = new Loader();

var mc1 = this.getChildByName(“mc”);
var nc = mc1.numChildren;

if (nc) { var l1 = mc1.getChildAt(0); mc1.removeChild(l1); l1 = null; }

loader1.load(request1); //start loading img/swf
mc1.addChild(loader1);

loader1.contentLoaderInfo.addEventListener(“complete”, this.finished_loading);

}

function finished_loading(e:Event) { trace(“Loading completed.” }</pre>
<p>, where mc is the instance name of an empty movie clip from the stage. You can simply call this function with the path string to your external SWFs and images avoiding references duplicates.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.flashuser.net/flash-tricks/loading-external-images-swfs-as3.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced

Served from: www.flashuser.net @ 2012-02-07 05:48:38 -->
