<?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>Stuntbox &#187; actionscript</title>
	<atom:link href="http://stuntbox.com/blog/tag/actionscript/feed/" rel="self" type="application/rss+xml" />
	<link>http://stuntbox.com</link>
	<description>David Sleight&#039;s Blog</description>
	<lastBuildDate>Tue, 06 Jul 2010 15:04:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Test Movie and AS2 Garbage Collection Hilarity</title>
		<link>http://stuntbox.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fstuntbox.com%2Fblog%2F2006%2F05%2Ftest-movie-and-as2-garbage-collection-hilarity%2F&amp;seed_title=Test+Movie+and+AS2+Garbage+Collection+Hilarity</link>
		<comments>http://stuntbox.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fstuntbox.com%2Fblog%2F2006%2F05%2Ftest-movie-and-as2-garbage-collection-hilarity%2F&amp;seed_title=Test+Movie+and+AS2+Garbage+Collection+Hilarity#comments</comments>
		<pubDate>Sat, 27 May 2006 20:50:09 +0000</pubDate>
		<dc:creator>David Sleight</dc:creator>
				<category><![CDATA[Post]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[flash]]></category>

		<guid isPermaLink="false">http://www.stuntbox.com/blog/2006/05/test-movie-and-as2-garbage-collection-hilarity/</guid>
		<description><![CDATA[When ActionScript arrays just won't give up the ghost.]]></description>
			<content:encoded><![CDATA[<p>Want to scramble the Flash 8 compiler&#8217;s brain? (Or more likely your own?) Give the following class a quick whirl.</p>
<pre><code>class TestArray {
    private var foo:Array = new Array();
    public function TestArray() {
         this.foo.push("bar");
         trace("this.foo.length ––> " + this.foo.length);
     }
}</code>
</pre>
<p>I know, I know. Bad form. &#8216;Tis true. The class property <code>foo</code> isn&#8217;t really a compile-time constant. But the compiler says nary a word in protest. No errors thrown. Nada. Zip. Zero. <em>Nothing</em>. Which would be fine <em>if</em> the Flash IDE didn&#8217;t get all butterfingered on you.</p>
<p>But try creating a new instance of <code>TestArray</code> in your Flash movie and invoke &#8220;Test Movie&#8221; a few times without closing the window. The length of <code>foo</code> will just grow and grow and grow. It&#8217;s only cleaned up between tests if you close out the Test Movie window and start over again.</p>
<p>I could be wrong, but methinks I smell a compiler garbage collection issue (albeit one surrounding bad code). Shouldn&#8217;t the compiler be smart enough to let you know when you&#8217;ve done something that&#8217;s basically foolish?</p>
]]></content:encoded>
			<wfw:commentRss>http://stuntbox.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fstuntbox.com%2Fblog%2F2006%2F05%2Ftest-movie-and-as2-garbage-collection-hilarity%2F&amp;seed_title=Test+Movie+and+AS2+Garbage+Collection+Hilarity/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Hidden Depths</title>
		<link>http://stuntbox.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fstuntbox.com%2Fblog%2F2005%2F08%2Fthe-hidden-depths%2F&amp;seed_title=The+Hidden+Depths</link>
		<comments>http://stuntbox.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fstuntbox.com%2Fblog%2F2005%2F08%2Fthe-hidden-depths%2F&amp;seed_title=The+Hidden+Depths#comments</comments>
		<pubDate>Wed, 31 Aug 2005 06:07:55 +0000</pubDate>
		<dc:creator>David Sleight</dc:creator>
				<category><![CDATA[Post]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://www.stuntbox.com/blog/2005/08/the-hidden-depths/</guid>
		<description><![CDATA[Or, While I'll Never Use the V2 Components Ever Again.]]></description>
			<content:encoded><![CDATA[<p>Like lots of Flash folk, I&#8217;ve got a real love/hate relationship going with the V2 components. I shy away from them whenever I can, but sometimes, well, they&#8217;re just so darn useful. Pick up that can. Pop that top. Oh look, worms! </p>
<p>This time the joy came in the form of a seemingly mundane preloader I threw together using the drawing API. No need for anything in the library, just a nice, svelte little progress bar drawn in at runtime. Nothing too exotic, right? Pop it into my Flash file and <em>blam-o!</em> The unmistakable sound of breaking glass. My movie is playing after the preloading is done, but my progress bar is <em>still there</em>, stuck at 100%. &#8220;What the–? Oh brother, here we go again&#8230;&#8221;</p>
<p>A little Googling turns up <a href="http://www.macromedia.com/cfusion/knowledgebase/index.cfm?id=tn_19435" title="Macromedia Flash TechNote: removeMovieClip action fails when button component is on stage">this gem</a>. Turns out the V2 button component drags <code>mx.managers.DepthManager</code> along for the ride, which nabs the highest and lowest available depths from the Flash player and then proceeds to sit on them for future use. No big deal, but if you&#8217;re a good scout and use the <code>MovieClip.getNextHighestDepth()</code> method guess whaaaaaaat&#8230; your next highest depth (1,048,576 to be precise) will be beyond the reach of <code>MovieClip.removeMovieClip()</code>. Never mind all those other open slots. All together now&#8230; &#8220;D&#8217;OH!&#8221;</p>
<p>The solution? If you use <code>getNextHighestDepth()</code> and the V2 components together in the same movie be prepared to use <code>swapDepths()</code> to drag that clip back down to Earth where you can do something useful with it. </p>
<p>So now the real question is, think anybody&#8217;s done anything about this in Flash 8? </p>
]]></content:encoded>
			<wfw:commentRss>http://stuntbox.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fstuntbox.com%2Fblog%2F2005%2F08%2Fthe-hidden-depths%2F&amp;seed_title=The+Hidden+Depths/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
