<?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: Abstracting Assets from Actionscript in AS3.0 &#8211; Asset Libraries and DuplicateMovieClip</title>
	<atom:link href="http://darylteo.com/blog/2007/11/16/abstracting-assets-from-actionscript-in-as30-asset-libraries/feed/" rel="self" type="application/rss+xml" />
	<link>http://darylteo.com/blog/2007/11/16/abstracting-assets-from-actionscript-in-as30-asset-libraries/</link>
	<description>Personal Views on Software Development</description>
	<lastBuildDate>Fri, 05 Mar 2010 16:35:51 +1100</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Daryl</title>
		<link>http://darylteo.com/blog/2007/11/16/abstracting-assets-from-actionscript-in-as30-asset-libraries/comment-page-1/#comment-10788</link>
		<dc:creator>Daryl</dc:creator>
		<pubDate>Tue, 12 May 2009 13:56:39 +0000</pubDate>
		<guid isPermaLink="false">http://darylteo.com/blog/2007/11/16/abstracting-assets-from-actionscript-in-as30-asset-libraries/#comment-10788</guid>
		<description>Hi gid,

thanks for alerting me to the issues.

The images are all embedded from Flickr. That is the best I can do for now.

The source files are mysteriously... not working. I think a link in the background is missing, or I may have lost it. I&#039;ll see if I can dig it up again, but I wouldn&#039;t hold your breath.

There have been bigger advancements in this area so I encourage you to look for them :)

Cheers
Daryl</description>
		<content:encoded><![CDATA[<p>Hi gid,</p>
<p>thanks for alerting me to the issues.</p>
<p>The images are all embedded from Flickr. That is the best I can do for now.</p>
<p>The source files are mysteriously&#8230; not working. I think a link in the background is missing, or I may have lost it. I&#8217;ll see if I can dig it up again, but I wouldn&#8217;t hold your breath.</p>
<p>There have been bigger advancements in this area so I encourage you to look for them <img src='http://darylteo.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Cheers<br />
Daryl</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: gid</title>
		<link>http://darylteo.com/blog/2007/11/16/abstracting-assets-from-actionscript-in-as30-asset-libraries/comment-page-1/#comment-10783</link>
		<dc:creator>gid</dc:creator>
		<pubDate>Tue, 12 May 2009 12:31:37 +0000</pubDate>
		<guid isPermaLink="false">http://darylteo.com/blog/2007/11/16/abstracting-assets-from-actionscript-in-as30-asset-libraries/#comment-10783</guid>
		<description>For some reason, I can&#039;t download the sourcecode...it just takes me to the main blog page. 

Also, the pictures of the code snippets are blocked on my network. Is there a place that has them in actual text? then again...being able to download that sourcecode may help.</description>
		<content:encoded><![CDATA[<p>For some reason, I can&#8217;t download the sourcecode&#8230;it just takes me to the main blog page. </p>
<p>Also, the pictures of the code snippets are blocked on my network. Is there a place that has them in actual text? then again&#8230;being able to download that sourcecode may help.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Denis</title>
		<link>http://darylteo.com/blog/2007/11/16/abstracting-assets-from-actionscript-in-as30-asset-libraries/comment-page-1/#comment-10354</link>
		<dc:creator>Denis</dc:creator>
		<pubDate>Tue, 31 Mar 2009 18:48:48 +0000</pubDate>
		<guid isPermaLink="false">http://darylteo.com/blog/2007/11/16/abstracting-assets-from-actionscript-in-as30-asset-libraries/#comment-10354</guid>
		<description>I managed to get rid of this error. Maybe it willbe usefull for someone else.

Add two lines of code before calling load method of the Loader() class. And pass context as parameter.

var context:LoaderContext = new LoaderContext();
context.applicationDomain = new ApplicationDomain();
loader.load(load(new URLRequest(path), context)</description>
		<content:encoded><![CDATA[<p>I managed to get rid of this error. Maybe it willbe usefull for someone else.</p>
<p>Add two lines of code before calling load method of the Loader() class. And pass context as parameter.</p>
<p>var context:LoaderContext = new LoaderContext();<br />
context.applicationDomain = new ApplicationDomain();<br />
loader.load(load(new URLRequest(path), context)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Denis</title>
		<link>http://darylteo.com/blog/2007/11/16/abstracting-assets-from-actionscript-in-as30-asset-libraries/comment-page-1/#comment-10350</link>
		<dc:creator>Denis</dc:creator>
		<pubDate>Tue, 31 Mar 2009 17:07:33 +0000</pubDate>
		<guid isPermaLink="false">http://darylteo.com/blog/2007/11/16/abstracting-assets-from-actionscript-in-as30-asset-libraries/#comment-10350</guid>
		<description>It is and error.

When I test the movie (ctrl+enter), it appears.

When I launch compiled swf, sometimes it works ok.
Sometimes is looking for Debuger running.

The most interesting thing, when I run Debug movie (ctr+shift+enter), compilation goes perfectly.

Flash CS3 Pro.</description>
		<content:encoded><![CDATA[<p>It is and error.</p>
<p>When I test the movie (ctrl+enter), it appears.</p>
<p>When I launch compiled swf, sometimes it works ok.<br />
Sometimes is looking for Debuger running.</p>
<p>The most interesting thing, when I run Debug movie (ctr+shift+enter), compilation goes perfectly.</p>
<p>Flash CS3 Pro.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daryl</title>
		<link>http://darylteo.com/blog/2007/11/16/abstracting-assets-from-actionscript-in-as30-asset-libraries/comment-page-1/#comment-10344</link>
		<dc:creator>Daryl</dc:creator>
		<pubDate>Tue, 31 Mar 2009 12:03:07 +0000</pubDate>
		<guid isPermaLink="false">http://darylteo.com/blog/2007/11/16/abstracting-assets-from-actionscript-in-as30-asset-libraries/#comment-10344</guid>
		<description>Is it an error or a warning? 

I suppose there might have been a change with the new compilers, with stricter compile-time checks.

I&#039;ve been too busy working with .NET I haven&#039;t had time to play around with Flash anymore, which is a pity.</description>
		<content:encoded><![CDATA[<p>Is it an error or a warning? </p>
<p>I suppose there might have been a change with the new compilers, with stricter compile-time checks.</p>
<p>I&#8217;ve been too busy working with .NET I haven&#8217;t had time to play around with Flash anymore, which is a pity.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Denis</title>
		<link>http://darylteo.com/blog/2007/11/16/abstracting-assets-from-actionscript-in-as30-asset-libraries/comment-page-1/#comment-10322</link>
		<dc:creator>Denis</dc:creator>
		<pubDate>Mon, 30 Mar 2009 19:06:23 +0000</pubDate>
		<guid isPermaLink="false">http://darylteo.com/blog/2007/11/16/abstracting-assets-from-actionscript-in-as30-asset-libraries/#comment-10322</guid>
		<description>Thanks for your post Daryl!
I&#039;ve got one question maybe you can help me with. Your example wotks perfectly.
I&#039;ve got external swf loaded into the class that is called from the Document class of the main swf movie.
During compiling time I receive constant error in the line of code :

var tempClass:Class = mc.loaderInfo.applicationDomain.getDefinition(&quot;className&quot;) as Class;

The error message is: 
&quot;ReferenceError: Error #1065: Variable className is not defined.&quot;

But, if I go through the code step by step via Debugger, it works ok, and throws no error.
If I lauch creater swf, no error as well, and the movieClip is duplicated.

It seems compliler somehow evaluetes, loaded classes before execute it.</description>
		<content:encoded><![CDATA[<p>Thanks for your post Daryl!<br />
I&#8217;ve got one question maybe you can help me with. Your example wotks perfectly.<br />
I&#8217;ve got external swf loaded into the class that is called from the Document class of the main swf movie.<br />
During compiling time I receive constant error in the line of code :</p>
<p>var tempClass:Class = mc.loaderInfo.applicationDomain.getDefinition(&#8220;className&#8221;) as Class;</p>
<p>The error message is:<br />
&#8220;ReferenceError: Error #1065: Variable className is not defined.&#8221;</p>
<p>But, if I go through the code step by step via Debugger, it works ok, and throws no error.<br />
If I lauch creater swf, no error as well, and the movieClip is duplicated.</p>
<p>It seems compliler somehow evaluetes, loaded classes before execute it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daryl</title>
		<link>http://darylteo.com/blog/2007/11/16/abstracting-assets-from-actionscript-in-as30-asset-libraries/comment-page-1/#comment-9436</link>
		<dc:creator>Daryl</dc:creator>
		<pubDate>Sun, 15 Feb 2009 15:25:38 +0000</pubDate>
		<guid isPermaLink="false">http://darylteo.com/blog/2007/11/16/abstracting-assets-from-actionscript-in-as30-asset-libraries/#comment-9436</guid>
		<description>First thing is : this post was written 2 years ago. I am sure someone would have found a better way to do it by now. So don&#039;t need to act &quot;smart&quot; :)

2ndly, yours doesn&#039;t work. You&#039;re cloning &quot;this&quot; and adding the new clip to &quot;this&quot;.

3rdly, doesn&#039;t solve the problem of what to do if your assets were loaded externally.

4thly, since you have access to the constructor() method, that would mean you had access to the class itself anyway. So you would have been better off using &quot;new classname&quot; instead, since you wouldn&#039;t be achieving anything else extra.

By the way, the link in the trackback above yours is very informative. :) 

Thanks for the input though.
Cheers
Daryl</description>
		<content:encoded><![CDATA[<p>First thing is : this post was written 2 years ago. I am sure someone would have found a better way to do it by now. So don&#8217;t need to act &#8220;smart&#8221; <img src='http://darylteo.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>2ndly, yours doesn&#8217;t work. You&#8217;re cloning &#8220;this&#8221; and adding the new clip to &#8220;this&#8221;.</p>
<p>3rdly, doesn&#8217;t solve the problem of what to do if your assets were loaded externally.</p>
<p>4thly, since you have access to the constructor() method, that would mean you had access to the class itself anyway. So you would have been better off using &#8220;new classname&#8221; instead, since you wouldn&#8217;t be achieving anything else extra.</p>
<p>By the way, the link in the trackback above yours is very informative. <img src='http://darylteo.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  </p>
<p>Thanks for the input though.<br />
Cheers<br />
Daryl</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: d-one</title>
		<link>http://darylteo.com/blog/2007/11/16/abstracting-assets-from-actionscript-in-as30-asset-libraries/comment-page-1/#comment-9435</link>
		<dc:creator>d-one</dc:creator>
		<pubDate>Sun, 15 Feb 2009 15:20:04 +0000</pubDate>
		<guid isPermaLink="false">http://darylteo.com/blog/2007/11/16/abstracting-assets-from-actionscript-in-as30-asset-libraries/#comment-9435</guid>
		<description>And then the smart way of duplicating or clone a movieclip

&lt;code&gt;
var dClip:MovieClip = this;
var new_mc = new dClip.constructor();
this.addChild(new_mc);
&lt;/code&gt;

Have fun :D</description>
		<content:encoded><![CDATA[<p>And then the smart way of duplicating or clone a movieclip</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">var dClip:MovieClip = this;<br />
var new_mc = new dClip.constructor();<br />
this.addChild(new_mc);</div></td></tr></tbody></table></div>
<p>Have fun <img src='http://darylteo.com/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: The Quest for MovieClip.clone() In Flash AS3 &#124; DannyBurbol.com</title>
		<link>http://darylteo.com/blog/2007/11/16/abstracting-assets-from-actionscript-in-as30-asset-libraries/comment-page-1/#comment-9164</link>
		<dc:creator>The Quest for MovieClip.clone() In Flash AS3 &#124; DannyBurbol.com</dc:creator>
		<pubDate>Sun, 25 Jan 2009 06:50:41 +0000</pubDate>
		<guid isPermaLink="false">http://darylteo.com/blog/2007/11/16/abstracting-assets-from-actionscript-in-as30-asset-libraries/#comment-9164</guid>
		<description>[...] http://darylteo.com/blog/2007/11/16/abstracting-assets-from-actionscript-in-as30-asset-libraries/#mo... [...]</description>
		<content:encoded><![CDATA[<p>[...] <a href="http://darylteo.com/blog/2007/11/16/abstracting-assets-from-actionscript-in-as30-asset-libraries/#mo.." rel="nofollow">http://darylteo.com/blog/2007/11/16/abstracting-assets-from-actionscript-in-as30-asset-libraries/#mo..</a>. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: numediaweb</title>
		<link>http://darylteo.com/blog/2007/11/16/abstracting-assets-from-actionscript-in-as30-asset-libraries/comment-page-1/#comment-9136</link>
		<dc:creator>numediaweb</dc:creator>
		<pubDate>Thu, 22 Jan 2009 09:52:10 +0000</pubDate>
		<guid isPermaLink="false">http://darylteo.com/blog/2007/11/16/abstracting-assets-from-actionscript-in-as30-asset-libraries/#comment-9136</guid>
		<description>a complete version of bouth bigspaceship and darylteo:
&lt;code&gt;
// utility to get external swf library classes
function getAsset ($obj:Object, $str:String):MovieClip {
	var c:Class = $obj.applicationDomain.getDefinition($str);
	return new c();
}
// a usage example
// test.swf contains an MC with class name _dump
// i will load it inside my current main.swf
function assetLoaded (e:Event):void {
	trace (e.target);	
	var temp:DisplayObject = getAsset(e.target, &quot;_dump&quot;);
	addChild (temp);
}
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener (Event.COMPLETE, assetLoaded, false, 0, true);
loader.load (new URLRequest(&quot;test.swf&quot;));
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>a complete version of bouth bigspaceship and darylteo:</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">// utility to get external swf library classes<br />
function getAsset ($obj:Object, $str:String):MovieClip {<br />
&nbsp; &nbsp;var c:Class = $obj.applicationDomain.getDefinition($str);<br />
&nbsp; &nbsp;return new c();<br />
}<br />
// a usage example<br />
// test.swf contains an MC with class name _dump<br />
// i will load it inside my current main.swf<br />
function assetLoaded (e:Event):void {<br />
&nbsp; &nbsp;trace (e.target); <br />
&nbsp; &nbsp;var temp:DisplayObject = getAsset(e.target, &quot;_dump&quot;);<br />
&nbsp; &nbsp;addChild (temp);<br />
}<br />
var loader:Loader = new Loader();<br />
loader.contentLoaderInfo.addEventListener (Event.COMPLETE, assetLoaded, false, 0, true);<br />
loader.load (new URLRequest(&quot;test.swf&quot;));</div></td></tr></tbody></table></div>
]]></content:encoded>
	</item>
</channel>
</rss>
