<?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>blog.betabong.com &#187; flash</title>
	<atom:link href="http://blog.betabong.com/tag/flash/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.betabong.com</link>
	<description></description>
	<lastBuildDate>Thu, 13 May 2010 09:49:40 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Bug Hunting: Shadowed 3D and ScrollRect</title>
		<link>http://blog.betabong.com/2009/04/01/bug-hunting-shadowed-3d-and-scrollrect/</link>
		<comments>http://blog.betabong.com/2009/04/01/bug-hunting-shadowed-3d-and-scrollrect/#comments</comments>
		<pubDate>Wed, 01 Apr 2009 16:02:05 +0000</pubDate>
		<dc:creator>betabong</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Bug]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[Flash Player]]></category>

		<guid isPermaLink="false">http://blog.betabong.com/?p=217</guid>
		<description><![CDATA[I don&#8217;t discover as many bugs nowadays as I&#8217;ve used to in the old days when I was beta testing for Macromedia. But it happened today, and I&#8217;ve just installed the newest Flash Player 10.0.22.87 to be sure.
It happens to DisplayObjects A inside DisplayObjectContainers B inside DisplayObjectContainer C, when

A was not initially visible (not inside [...]


Related posts:<ol><li><a href='http://blog.betabong.com/2009/04/17/metatunnel-with-pixel-bender/' rel='bookmark' title='Permanent Link: MetaTunnel with Pixel Bender'>MetaTunnel with Pixel Bender</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>I don&#8217;t discover as many bugs nowadays as I&#8217;ve used to in the old days when I was beta testing for Macromedia. But it happened today, and I&#8217;ve just installed the newest Flash Player 10.0.22.87 to be sure.</p>
<p>It happens to DisplayObjects A inside DisplayObjectContainers B inside DisplayObjectContainer C, when</p>
<ul>
<li>A was not initially visible (not inside initial scroll rect of C)</li>
<li>A is in 3D mode (I just change rotationY for that)</li>
<li>B is in «cached as Bitmap» (cacheAsBitmap would do, I go with DropShadowFilter in the example)</li>
<li>C&#8217;s scrollrect property is set, so A is shows up (well, it doesn&#8217;t – that&#8217;s the bug after all ;)</li>
</ul>
<p>Here the example:</p>
<div style="padding: 10px; background-color: #eee;"><object width="500" height="200" data="/wp-content/uploads/2009/04/bug-3d-shadow.swf" type="application/x-shockwave-flash"><param name="id" value="Bug-3D-Shadow" /><param name="align" value="middle" /><param name="allowScriptAccess" value="sameDomain" /><param name="allowFullScreen" value="false" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /><param name="src" value="/wp-content/uploads/2009/04/bug-3d-shadow.swf" /><param name="name" value="Bug-3D-Shadow" /><param name="allowfullscreen" value="false" /></object></div>
<p><a href="http://blog.betabong.com/wp-content/uploads/2009/04/bug-3d-shadow.swf">bug-3d-shadow.swf</a><br />
<span id="more-217"></span><br />
And here the code:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/* Flash Bug - Flash Player 10.0.22.87
	disappearance when 3d's parent has shadow
	more info: betabong@gmail.com
*/</span>
&nbsp;
<span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">stage</span>.<span style="color: #0066CC;">scaleMode</span> = StageScaleMode.<span style="color: #006600;">NO_SCALE</span>;
<span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">stage</span>.<span style="color: #0066CC;">align</span> = StageAlign.<span style="color: #006600;">TOP_LEFT</span>;
&nbsp;
&nbsp;
<span style="color: #000000; font-weight: bold;">var</span> scroller:Sprite = <span style="color: #000000; font-weight: bold;">new</span> Sprite<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
addChild<span style="color: #66cc66;">&#40;</span> scroller <span style="color: #66cc66;">&#41;</span>;
scroller = <span style="color: #0066CC;">this</span>;
&nbsp;
<span style="color: #000000; font-weight: bold;">var</span> filter:DropShadowFilter = <span style="color: #000000; font-weight: bold;">new</span> DropShadowFilter<span style="color: #66cc66;">&#40;</span> <span style="color: #cc66cc;">2</span> , <span style="color: #cc66cc;">90</span> , <span style="color: #cc66cc;">0</span> , <span style="color: #cc66cc;">0.5</span> , <span style="color: #cc66cc;">8</span> , <span style="color: #cc66cc;">8</span> , <span style="color: #cc66cc;">1</span> , <span style="color: #cc66cc;">2</span> <span style="color: #66cc66;">&#41;</span>;
<span style="color: #000000; font-weight: bold;">var</span> r:Sprite,rect:Sprite;
&nbsp;
<span style="color: #b1b100;">for</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #000000; font-weight: bold;">var</span> mode:<span style="color: #0066CC;">int</span> = <span style="color: #cc66cc;">0</span> ; mode<span style="color: #66cc66;">&lt;</span>=<span style="color: #cc66cc;">1</span> ; mode++ <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
	<span style="color: #b1b100;">for</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #000000; font-weight: bold;">var</span> i:<span style="color: #0066CC;">int</span>=<span style="color: #cc66cc;">0</span> ; i<span style="color: #66cc66;">&lt;</span><span style="color: #cc66cc;">3000</span> ; i+=<span style="color: #cc66cc;">100</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
		r = <span style="color: #000000; font-weight: bold;">new</span> Sprite<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
		r.<span style="color: #006600;">addChild</span><span style="color: #66cc66;">&#40;</span> rect = <span style="color: #000000; font-weight: bold;">new</span> Sprite<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span>;
		rect.<span style="color: #006600;">graphics</span>.<span style="color: #0066CC;">beginFill</span><span style="color: #66cc66;">&#40;</span> 0xff0000 <span style="color: #66cc66;">&#41;</span>;
		rect.<span style="color: #006600;">graphics</span>.<span style="color: #006600;">drawRect</span><span style="color: #66cc66;">&#40;</span> -<span style="color: #cc66cc;">40</span> , -<span style="color: #cc66cc;">40</span> , <span style="color: #cc66cc;">80</span> , <span style="color: #cc66cc;">80</span> <span style="color: #66cc66;">&#41;</span>;
		rect.<span style="color: #006600;">graphics</span>.<span style="color: #0066CC;">endFill</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
		rect.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span> MouseEvent.<span style="color: #006600;">MOUSE_MOVE</span> , rotate <span style="color: #66cc66;">&#41;</span>;
		<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #66cc66;">!</span>mode <span style="color: #66cc66;">&#41;</span> r.<span style="color: #006600;">cacheAsBitmap</span> = <span style="color: #000000; font-weight: bold;">true</span>; <span style="color: #808080; font-style: italic;">//r.filters = [ filter ];</span>
		r.<span style="color: #006600;">y</span> = i + <span style="color: #cc66cc;">100</span>;
		r.<span style="color: #006600;">x</span> = mode <span style="color: #66cc66;">*</span> <span style="color: #cc66cc;">150</span> + <span style="color: #cc66cc;">100</span>;
		addChild<span style="color: #66cc66;">&#40;</span> r <span style="color: #66cc66;">&#41;</span>;
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #0066CC;">stage</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span> Event.<span style="color: #006600;">ENTER_FRAME</span> , move <span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">scroll</span>:<span style="color: #0066CC;">Number</span> = <span style="color: #cc66cc;">0</span>;
<span style="color: #000000; font-weight: bold;">function</span> move<span style="color: #66cc66;">&#40;</span> event:Event <span style="color: #66cc66;">&#41;</span> : <span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
	<span style="color: #0066CC;">scroll</span> += <span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">stage</span>.<span style="color: #006600;">mouseY</span> - <span style="color: #cc66cc;">100</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">/</span> <span style="color: #cc66cc;">50</span>;
	scroller.<span style="color: #006600;">scrollRect</span> = <span style="color: #000000; font-weight: bold;">new</span> Rectangle<span style="color: #66cc66;">&#40;</span> <span style="color: #cc66cc;">0</span> , <span style="color: #0066CC;">scroll</span> , <span style="color: #cc66cc;">500</span> , <span style="color: #cc66cc;">200</span> <span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> rotate<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:<span style="color: #66cc66;">*</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
	<span style="color: #0066CC;">e</span>.<span style="color: #0066CC;">target</span>.<span style="color: #006600;">rotationY</span>++;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p><strong>Update:</strong> Now that: it took me about 20 min to file a bug in the Adobe Bug System (which is slow as hell anyway). And when I want to submit it, I get a message saying they&#8217;d be in maintenance. Well, buggy bug systems piss me off quite a bit.</p>


<p>Related posts:<ol><li><a href='http://blog.betabong.com/2009/04/17/metatunnel-with-pixel-bender/' rel='bookmark' title='Permanent Link: MetaTunnel with Pixel Bender'>MetaTunnel with Pixel Bender</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.betabong.com/2009/04/01/bug-hunting-shadowed-3d-and-scrollrect/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Test Flex/Flash throttled (aka Simulate Download)</title>
		<link>http://blog.betabong.com/2008/12/06/test-flex-throttled-simulate-download/</link>
		<comments>http://blog.betabong.com/2008/12/06/test-flex-throttled-simulate-download/#comments</comments>
		<pubDate>Sat, 06 Dec 2008 15:52:55 +0000</pubDate>
		<dc:creator>betabong</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Browser]]></category>
		<category><![CDATA[Debug]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[Flex Builder]]></category>

		<guid isPermaLink="false">http://blog.betabong.com/?p=161</guid>
		<description><![CDATA[Most of the Flash application deal with server side data like images, xml files etc. We tend to forget about that because the default Run or Debug commands in Flex will open a local html file (and also because we developers often have quite a nice internet connection when testing remotely). Thus all data is [...]


Related posts:<ol><li><a href='http://blog.betabong.com/2008/12/03/test-movie-from-flex-to-flash-easy-way/' rel='bookmark' title='Permanent Link: Test Movie from Flex to Flash (easy way)'>Test Movie from Flex to Flash (easy way)</a></li><li><a href='http://blog.betabong.com/2008/11/29/flex-builder-t-flash-ide/' rel='bookmark' title='Permanent Link: Develop in Flex Builder, publish in Flash IDE (Mac OS X)'>Develop in Flex Builder, publish in Flash IDE (Mac OS X)</a></li><li><a href='http://blog.betabong.com/2009/04/05/flash-debug-speed/' rel='bookmark' title='Permanent Link: Flash Debug Speed'>Flash Debug Speed</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>Most of the Flash application deal with server side data like images, xml files etc. We tend to forget about that because the default Run or Debug commands in Flex will open a local html file (and also because we developers often have quite a nice internet connection when testing remotely). Thus all data is loaded nearly instantely.</p>
<p>In Flash we have a menu command called <strong>«Simulate Download»</strong> to see how things run at different bandwidth situations. <strong>But how to achieve this in Flex?</strong></p>
<p>I&#8217;ve been using Sloppy for a long time. It&#8217;s little java app that can be started via a simple web click. It&#8217;s really easy to use and does very well what it does. For debugging your app (your flash website) throttled in Flex Builder simply follow these steps:</p>
<p> </p>
<ol>
<li><a href="http://www.dallaway.com/sloppy/">Open the <strong>Sloppy website</strong></a></li>
<li>Click the little <strong>Sloppy icon</strong>:<br />
<a href="http://blog.betabong.com/wp-content/uploads/2008/12/picture-10.png" rel="lightbox[161]"><img class="alignnone size-full wp-image-162" title="picture-10" src="http://blog.betabong.com/wp-content/uploads/2008/12/picture-10.png" alt="" width="233" height="41" /><br />
</a></li>
<li>A «sloppy.jnlp» file is downloaded. <strong>Open it</strong> if doesn&#8217;t open automatically.</li>
<li>The actual application will be downloaded and started. If it asks you to trust: <strong>trust!</strong> :-)</li>
<li><strong>Enter the address</strong> of your html file in the bin-debug or bin-release folder. It should be a webserver address. I usually create a <a href="http://www.macupdate.com/info.php/id/10433/symboliclinker">symbolic link</a> of my project directory and put it into my local webserver directory.<br />
<a href="http://blog.betabong.com/wp-content/uploads/2008/12/picture-11.png" rel="lightbox[161]"></a><a href="http://blog.betabong.com/wp-content/uploads/2008/12/picture-11.png" rel="lightbox[161]"><img class="alignnone size-full wp-image-163" title="picture-11" src="http://blog.betabong.com/wp-content/uploads/2008/12/picture-11.png" alt="" width="501" height="453" /></a></li>
<li><strong>Click «Go»</strong> – this will start the Sloppy proxy and open the page in your default browser. </li>
<li><strong>Copy the address</strong> from the browser window (usually http://127.0.0.1:7569/your/path)<br />
<a href="http://blog.betabong.com/wp-content/uploads/2008/12/picture-12.png" rel="lightbox[161]"><img class="alignnone size-full wp-image-164" title="picture-12" src="http://blog.betabong.com/wp-content/uploads/2008/12/picture-12.png" alt="" width="375" height="34" /></a></li>
<li>You may close the window. Go to Flex Builder and <strong>open the project properties</strong> (right click on project folder, last item). In an Actionscript Project, switch to ActionScript Build Path.<br />
<a href="http://blog.betabong.com/wp-content/uploads/2008/12/picture-14.png" rel="lightbox[161]"><img class="alignnone size-medium wp-image-165" title="picture-14" src="http://blog.betabong.com/wp-content/uploads/2008/12/picture-14-300x289.png" alt="" width="300" height="289" /></a> </li>
<li>Enter the copied address into <strong>«Output folder URL»</strong>, clear the html name (e.g. App.html).<br />
<a href="http://blog.betabong.com/wp-content/uploads/2008/12/picture-15.png" rel="lightbox[161]"><img class="alignnone size-full wp-image-166" title="picture-15" src="http://blog.betabong.com/wp-content/uploads/2008/12/picture-15.png" alt="" width="423" height="40" /></a></li>
<li>Click «OK» and <strong>you&#8217;re done</strong>. You can now Run and Debug as if your website was hosted on some server and you had a 256K ADSL connection (instead of your T1).</li>
</ol>
<p>Note: I tried to automate the whole thing (with Ant of course) and succeeded to a certain limit. What I did was download <a href="http://code.google.com/p/sloppy/">Sloopy&#8217;s source code</a> (java), modify it so it can handle more terminal attributes and build the  .jar file. This can be run on command line, which will start the sloopy server. So I created an ant file that does all that for me, but this ant file would only be cool, if it could also trigger the run or debug commands and modify the output folder url. I haven&#8217;t found a way (at least not a satisfying one) to do this, so I might just follow the manual street for once ;)</p>
<p>Another note: If you are windows user, you might wanna try this Firefox plugin: <a href="https://addons.mozilla.org/en-US/firefox/addon/5917">Firefox Throttle</a></p>


<p>Related posts:<ol><li><a href='http://blog.betabong.com/2008/12/03/test-movie-from-flex-to-flash-easy-way/' rel='bookmark' title='Permanent Link: Test Movie from Flex to Flash (easy way)'>Test Movie from Flex to Flash (easy way)</a></li><li><a href='http://blog.betabong.com/2008/11/29/flex-builder-t-flash-ide/' rel='bookmark' title='Permanent Link: Develop in Flex Builder, publish in Flash IDE (Mac OS X)'>Develop in Flex Builder, publish in Flash IDE (Mac OS X)</a></li><li><a href='http://blog.betabong.com/2009/04/05/flash-debug-speed/' rel='bookmark' title='Permanent Link: Flash Debug Speed'>Flash Debug Speed</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.betabong.com/2008/12/06/test-flex-throttled-simulate-download/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Test Movie from Flex to Flash (easy way)</title>
		<link>http://blog.betabong.com/2008/12/03/test-movie-from-flex-to-flash-easy-way/</link>
		<comments>http://blog.betabong.com/2008/12/03/test-movie-from-flex-to-flash-easy-way/#comments</comments>
		<pubDate>Wed, 03 Dec 2008 11:23:33 +0000</pubDate>
		<dc:creator>betabong</dc:creator>
				<category><![CDATA[Flash & more]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Ant]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[Flex Builder]]></category>

		<guid isPermaLink="false">http://blog.betabong.com/?p=154</guid>
		<description><![CDATA[I figured a much much easier (compared to this) way to trigger Test Movie in Flash IDE from within Flex. What you&#8217;ll still need is Ant (here&#8217;s how to install), but that&#8217;s all you gonna need apart from Flex Builder and Flash. That&#8217;s the simplest ant build file to achieve this:

&#60;?xml version=&#34;1.0&#34; encoding=&#34;UTF-8&#34;?&#62;
&#60;project name=&#34;Publish&#34; default=&#34;Publish&#34; [...]


Related posts:<ol><li><a href='http://blog.betabong.com/2008/12/06/test-flex-throttled-simulate-download/' rel='bookmark' title='Permanent Link: Test Flex/Flash throttled (aka Simulate Download)'>Test Flex/Flash throttled (aka Simulate Download)</a></li><li><a href='http://blog.betabong.com/2008/11/29/flex-builder-t-flash-ide/' rel='bookmark' title='Permanent Link: Develop in Flex Builder, publish in Flash IDE (Mac OS X)'>Develop in Flex Builder, publish in Flash IDE (Mac OS X)</a></li><li><a href='http://blog.betabong.com/2008/07/16/flex-project-svn-strategy/' rel='bookmark' title='Permanent Link: Flex Project &#8211; SVN Strategy'>Flex Project &#8211; SVN Strategy</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>I figured a much much easier (<a href="http://blog.betabong.com/2008/11/29/flex-builder-t-flash-ide">compared to this</a>) way to trigger Test Movie in Flash IDE from within Flex. What you&#8217;ll still need is Ant (<a href="http://blog.jodybrewster.net/2008/04/09/installing-ant-in-flex-builder-3/">here&#8217;s how to install</a>), but that&#8217;s all you gonna need apart from Flex Builder and Flash. That&#8217;s the simplest ant build file to achieve this:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;project</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Publish&quot;</span> <span style="color: #000066;">default</span>=<span style="color: #ff0000;">&quot;Publish&quot;</span> <span style="color: #000066;">basedir</span>=<span style="color: #ff0000;">&quot;./&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
	<span style="color: #808080; font-style: italic;">&lt;!-- project specifics --&gt;</span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Publish&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;concat</span> <span style="color: #000066;">destfile</span>=<span style="color: #ff0000;">&quot;build.jsfl&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
			fl.getDocumentDOM().testMovie();
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/concat<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;exec</span> <span style="color: #000066;">executable</span>=<span style="color: #ff0000;">&quot;open&quot;</span> <span style="color: #000066;">failonerror</span>=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #000066;">logerror</span>=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">line</span>=<span style="color: #ff0000;">&quot;build.jsfl&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/exec<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;delete</span> <span style="color: #000066;">file</span>=<span style="color: #ff0000;">&quot;build.jsfl&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/project<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>This tests the frontmost document in Flash IDE. (basically what does <a href="http://theflashblog.com/?p=482">this plugin</a>). Tested on Mac OS X 10.5.5 with Flex Builder Pro 3.0.2 and Flash CS4.</p>
<p>No need for <a href="http://www.mikechambers.com/blog/2008/05/02/flashcommand-for-os-x-updated-to-work-with-flash-cs3/">FlashCommand</a>. No need to alter the file for other projects. Just a super easy file for people with not too many requirements. </p>
<p>You can still go more advanced with something like that:<br />
<span id="more-154"></span></p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;project</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Build Project&quot;</span> <span style="color: #000066;">default</span>=<span style="color: #ff0000;">&quot;Publish and Test&quot;</span> <span style="color: #000066;">basedir</span>=<span style="color: #ff0000;">&quot;../&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
	<span style="color: #808080; font-style: italic;">&lt;!-- common --&gt;</span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;browser&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;Safari&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;log.path&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;${user.home}/Library/Preferences/Macromedia/Flash Player/Logs/flashlog.txt&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
	<span style="color: #808080; font-style: italic;">&lt;!-- project specifics --&gt;</span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;fla.path&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;${basedir}/main.fla&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;swf.path&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;${basedir}/result.swf&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;test.path&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;http://localhost/projects/test/index.html&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Publish and Test&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;antcall</span> <span style="color: #000066;">target</span>=<span style="color: #ff0000;">&quot;Publish&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;antcall</span> <span style="color: #000066;">target</span>=<span style="color: #ff0000;">&quot;Clear Log&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;antcall</span> <span style="color: #000066;">target</span>=<span style="color: #ff0000;">&quot;Open in Browser&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
	<span style="color: #808080; font-style: italic;">&lt;!-- publish swf --&gt;</span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Publish&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;concat</span> <span style="color: #000066;">destfile</span>=<span style="color: #ff0000;">&quot;build.jsfl&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
			var sourceFile = &quot;#FLA#&quot;;
			var outputFile = &quot;#SWF#&quot;;
			var doc = fl.getDocumentDOM();
			if ( !doc || sourceFile.indexOf( doc.path ) <span style="color: #ddbb00;">&amp;lt;</span> 0 ) {
				doc = fl.openDocument(sourceFile);
			}
			doc.exportSWF(outputFile, true);
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filterchain<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;replacetokens</span> <span style="color: #000066;">begintoken</span>=<span style="color: #ff0000;">&quot;#&quot;</span> <span style="color: #000066;">endtoken</span>=<span style="color: #ff0000;">&quot;#&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;token</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;FLA&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;file:///${fla.path}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;token</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;SWF&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;file:///${swf.path}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/replacetokens<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/filterchain<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/concat<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;exec</span> <span style="color: #000066;">executable</span>=<span style="color: #ff0000;">&quot;open&quot;</span> <span style="color: #000066;">failonerror</span>=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #000066;">logerror</span>=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">line</span>=<span style="color: #ff0000;">&quot;build.jsfl&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/exec<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;delete</span> <span style="color: #000066;">file</span>=<span style="color: #ff0000;">&quot;build.jsfl&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
&nbsp;
	<span style="color: #808080; font-style: italic;">&lt;!-- Open in local browser --&gt;</span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Open in Browser&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;exec</span> <span style="color: #000066;">executable</span>=<span style="color: #ff0000;">&quot;open&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">line</span>=<span style="color: #ff0000;">&quot;-a ${browser} ${test.path}&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/exec<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
	<span style="color: #808080; font-style: italic;">&lt;!-- Clear Debug Log --&gt;</span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Clear Log&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;concat</span> <span style="color: #000066;">destfile</span>=<span style="color: #ff0000;">&quot;${log.path}&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>                                                                                                            
		.: Sev Log File :.
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/concat<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;exec</span> <span style="color: #000066;">executable</span>=<span style="color: #ff0000;">&quot;open&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">line</span>=<span style="color: #ff0000;">&quot;-a console '${log.path}'&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/exec<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/project<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>This has pretty much the same results as <a href="http://blog.betabong.com/2008/11/29/flex-builder-t-flash-ide/">posted here</a>.</p>
<p>I have created a Flex Project that contains all necessary files (fla, main class, build file). Just download and import into Flex:</p>
<p><a class="download" href='http://blog.betabong.com/wp-content/uploads/2008/12/flaproject.zip'> Download Flex Project</a></p>
<p><strong>Update: </strong>Mirko Sablijic sent me a Hello World project for Windows (he runs Vista):</p>
<p><a class="download" href='http://blog.betabong.com/wp-content/uploads/2008/12/helloworld.zip'>Download Flex Project (Windows)</a></p>


<p>Related posts:<ol><li><a href='http://blog.betabong.com/2008/12/06/test-flex-throttled-simulate-download/' rel='bookmark' title='Permanent Link: Test Flex/Flash throttled (aka Simulate Download)'>Test Flex/Flash throttled (aka Simulate Download)</a></li><li><a href='http://blog.betabong.com/2008/11/29/flex-builder-t-flash-ide/' rel='bookmark' title='Permanent Link: Develop in Flex Builder, publish in Flash IDE (Mac OS X)'>Develop in Flex Builder, publish in Flash IDE (Mac OS X)</a></li><li><a href='http://blog.betabong.com/2008/07/16/flex-project-svn-strategy/' rel='bookmark' title='Permanent Link: Flex Project &#8211; SVN Strategy'>Flex Project &#8211; SVN Strategy</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.betabong.com/2008/12/03/test-movie-from-flex-to-flash-easy-way/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Develop in Flex Builder, publish in Flash IDE (Mac OS X)</title>
		<link>http://blog.betabong.com/2008/11/29/flex-builder-t-flash-ide/</link>
		<comments>http://blog.betabong.com/2008/11/29/flex-builder-t-flash-ide/#comments</comments>
		<pubDate>Sat, 29 Nov 2008 12:12:43 +0000</pubDate>
		<dc:creator>betabong</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[CS4]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[Install]]></category>

		<guid isPermaLink="false">http://blog.betabong.com/?p=144</guid>
		<description><![CDATA[Update: I&#8217;ve found an easier way without FlashCommand
Once you got used to developing for Flash in Flex Builder, you hate to do any programming in Flash IDE. Still you sometimes might have to: Flex Builder won&#8217;t allow to publish into a FLA file. (There are of course many other reasons, like supporting older AS1/AS2 projects, [...]


Related posts:<ol><li><a href='http://blog.betabong.com/2008/12/03/test-movie-from-flex-to-flash-easy-way/' rel='bookmark' title='Permanent Link: Test Movie from Flex to Flash (easy way)'>Test Movie from Flex to Flash (easy way)</a></li><li><a href='http://blog.betabong.com/2008/12/06/test-flex-throttled-simulate-download/' rel='bookmark' title='Permanent Link: Test Flex/Flash throttled (aka Simulate Download)'>Test Flex/Flash throttled (aka Simulate Download)</a></li><li><a href='http://blog.betabong.com/2008/07/16/flex-project-svn-strategy/' rel='bookmark' title='Permanent Link: Flex Project &#8211; SVN Strategy'>Flex Project &#8211; SVN Strategy</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p><span class="update"><strong>Update:</strong> <a href="http://blog.betabong.com/2008/12/03/test-movie-from-flex-to-flash-easy-way/">I&#8217;ve found an easier way without FlashCommand</a></span></p>
<p>Once you got used to developing for Flash in Flex Builder, you hate to do any programming in Flash IDE. Still you sometimes might have to: Flex Builder won&#8217;t allow to publish into a FLA file. (There are of course many other reasons, like supporting older AS1/AS2 projects, we don&#8217;t go into that here.) Thanks to Eclipse&#8217;s ability to be customized, there are ways to make things at least a little easier. I give here a little overview of how I&#8217;ve set up my environment, based on several helpful resources I&#8217;ve found in the web.</p>
<ol>
<li>Install FlashCommand</li>
<li>Install Ant</li>
</ol>
<p>And for each project:</p>
<ol>
<li>Create/modify Ant file</li>
<li>Create Actionscript project</li>
<li>Set up project and FLA file</li>
</ol>
<p><span id="more-144"></span></p>
<h3>What you need</h3>
<ul>
<li><a href="http://www.adobe.com/products/flex/">Flex Builder</a></li>
<li><a href="http://www.adobe.com/products/flash/">Flash IDE (CS3 or CS4)</a></li>
</ul>
<h3>Install FlashCommand</h3>
<p><a href="http://www.mikechambers.com/blog/2008/05/02/flashcommand-for-os-x-updated-to-work-with-flash-cs3/">flashcommand</a> is a python script by <a href="http://www.mikechambers.com/blog/">Mike Chambers</a> that lets you compile FLA files from the command line using Flash IDE. <a href="http://code.google.com/p/flashcommand/downloads/list">Download it</a> and put it wherever you want.</p>
<h3>Install ANT</h3>
<p>If you&#8217;re used to FDT (or Eclipse in any way) you may well know Ant. <a href="http://en.wikipedia.org/wiki/Apache_Ant">Ant</a> is the premier build tool for any developers working in <a href="http://www.eclipse.org/">Eclipse</a>, with many many cool possibilites to automate your workflow. Here&#8217;s how you <a href="http://blog.jodybrewster.net/2008/04/09/installing-ant-in-flex-builder-3/">install Ant in Flex Builder 3 Standalone</a>:</p>
<ol>
<li>Go to Help &gt; Software Updates &gt; Find and Install</li>
<li>Search for new features to install, click next</li>
<li>Select «The Eclipse Project Updates», click finish<br />
Note: If you do not have the option above click «New Remote Site» and enter «The Eclipse Project Updates» as the name and «http://update.eclipse.org/updates/3.3» as the url.</li>
<li>In Eclipse project updates look for «Eclipse Java Development Tools &#8230;» – it might be in «Eclipse SDK Eclipse 3.3.2» but this depends on what version you have installed and what version is currently available. Select it and click next.</li>
<li>Accept licence agreement, click next. Then click «Finish» to start download.</li>
<li>Once downloaded, click «Install all»</li>
<li>Restart Eclipse (you&#8217;ll be asked to)</li>
</ol>
<h3>Create Project</h3>
<ol>
<li>Create a new Actionscript Project in Flex Builder</li>
<li>Add a new «build» directory in the project root</li>
<li>Add your FLA file(s) and assets to the build folder and your source files to the src folder<br />
(I also strongly recommend adding external libraries to and «externals» directory and use svn:externals property on it, but that&#8217;s another story) </li>
<li>Add build paths. You have to do this at least twice:
<ul>
<li>In the Flash IDE for the FLA: Publish Settings &gt; Actionscript 3 «Settings&#8230;». Don&#8217;t forget to add the src folder at least.<br />
Test your FLA once done. It should compile just fine.</li>
<li>In Flex Builder: Project &gt; Properties &gt; ActionScript Build Path. Add your external libraries here. This is used so Flex knows where to lookup your classes, it won&#8217;t actually be needed for compiling, because that&#8217;s what Flash IDE&#8217;s gonna do.</li>
</ul>
</li>
<li>Now you&#8217;re almost done: you can edit your classes in Flex Builder and switch to Flash IDE to publish and/or test your movie. We&#8217;re gonna make this a little more comfortable with Ant and flashcommand.</li>
</ol>
<h3>Add Ant build file</h3>
<ol>
<li>Create a new file build.xml in the root folder and open it with Ant Editor (in Flex Builder aka Eclipse)</li>
<li>Edit the build.xml according your setup (see below for example)</li>
<li>Add build.xml to Ant View (Window &gt; Other Views&#8230;)</li>
<li>Run an action by double clicking it in Ant View: there you go!! It will compile in Flash IDE and open in your browser for testing!</li>
</ol>
<h3>Sample Ant build.xml</h3>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;">	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
	<span style="color: #808080; font-style: italic;">&lt;!-- ====================================================================== </span>
<span style="color: #808080; font-style: italic;">	     Nov 28, 2008 1:37:54 AM                                                        </span>
&nbsp;
<span style="color: #808080; font-style: italic;">	     MyProject    </span>
<span style="color: #808080; font-style: italic;">	     Compile in Flash IDE</span>
&nbsp;
<span style="color: #808080; font-style: italic;">	     sev                                                                </span>
<span style="color: #808080; font-style: italic;">	     ====================================================================== --&gt;</span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;project</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;MyProject&quot;</span> <span style="color: #000066;">default</span>=<span style="color: #ff0000;">&quot;Compile and Run&quot;</span> <span style="color: #000066;">basedir</span>=<span style="color: #ff0000;">&quot;./&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
	        <span style="color: #808080; font-style: italic;">&lt;!-- project specifics --&gt;</span>
	        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;browser&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;Safari&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
	        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;swf.filename&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;MyProject&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
	        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;html.filename&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;fla/index.html&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
	        <span style="color: #808080; font-style: italic;">&lt;!-- Flash IDE Commandline compiler --&gt;</span>
	        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;python&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;/usr/bin/python&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
	        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;flash.command&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;/path/to/flashcommand&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
	        <span style="color: #808080; font-style: italic;">&lt;!-- directories --&gt;</span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;user.path&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;/Users/yourname&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
	        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;build.dir&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;${basedir}/build&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
	        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;main.fla&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;${build.dir}/${swf.filename}.fla&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
	        <span style="color: #808080; font-style: italic;">&lt;!-- paths --&gt;</span>
	        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;output.path&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;${build.dir}/${swf.filename}.swf&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
			<span style="color: #808080; font-style: italic;">&lt;!-- you can also point to the file:///path/to/index.html --&gt;</span>
	        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;local.path&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;http://localhost/projects/MyProject/${html.filename}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
	        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;log.path&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;${user.path}/Library/Preferences/Macromedia/Flash Player/Logs/flashlog.txt&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
	        <span style="color: #808080; font-style: italic;">&lt;!-- Compile python flashcommand -e  -s build/MyProject.fla -o build/MyProject.swf </span>
&nbsp;
<span style="color: #808080; font-style: italic;">	        usage: flashcommand -e | -c | -p [-v] [-x] (-s &lt;sourcefile&gt;) ([-o] &lt;exportpath&gt;) ([-t] &lt;timeout&gt;)([-d] &lt;tempdir&gt;) [-j]</span>
&nbsp;
<span style="color: #808080; font-style: italic;">	        Options and arguments:</span>
&nbsp;
<span style="color: #808080; font-style: italic;">	        -a : Prints version and about information.</span>
<span style="color: #808080; font-style: italic;">	        -c : Specifies save and compact action. </span>
<span style="color: #808080; font-style: italic;">	        -d : Specifies temp directory that will be used for temporary files. Optional.</span>
<span style="color: #808080; font-style: italic;">	        -e : Specifies export action.</span>
<span style="color: #808080; font-style: italic;">	        -h : Prints usage information.</span>
<span style="color: #808080; font-style: italic;">	        -j : Specifies that the generated JSFL file should be printed. If this option is specified, Flash will not be executed.</span>
<span style="color: #808080; font-style: italic;">	        -o : Specifies the output file if -e flag is also set. Optional. If not specified, file will be output to same directory as source.</span>
<span style="color: #808080; font-style: italic;">	        -p : Specifies publish action.</span>
<span style="color: #808080; font-style: italic;">	        -s : Specifies source file. Required.</span>
<span style="color: #808080; font-style: italic;">	        -t : Specifies timeout value. Optional.</span>
<span style="color: #808080; font-style: italic;">	        -v : Specifies verbose mode. Optional.</span>
<span style="color: #808080; font-style: italic;">	        -f : Specifies that the Flash authoring version installed is a version other than Flash CS3</span>
<span style="color: #808080; font-style: italic;">	        -x : Specifies whether Flash should be closed after it is done processing. Optional.    </span>
&nbsp;
<span style="color: #808080; font-style: italic;">	        --&gt;</span>
&nbsp;
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Compile and Run&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;antcall</span> <span style="color: #000066;">target</span>=<span style="color: #ff0000;">&quot;Compile in IDE&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;antcall</span> <span style="color: #000066;">target</span>=<span style="color: #ff0000;">&quot;Clear Log&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;antcall</span> <span style="color: #000066;">target</span>=<span style="color: #ff0000;">&quot;Open in Browser&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Compile in IDE&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;echo<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>${flash.command} -e -c -s ${main.fla} -o ${output.path}<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/echo<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;exec</span> <span style="color: #000066;">executable</span>=<span style="color: #ff0000;">&quot;${python}&quot;</span> <span style="color: #000066;">failonerror</span>=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #000066;">logError</span>=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
                        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">line</span>=<span style="color: #ff0000;">&quot;${flash.command}&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
                        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">line</span>=<span style="color: #ff0000;">&quot;-e &quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
                        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">line</span>=<span style="color: #ff0000;">&quot;-s ${main.fla} &quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
                        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">line</span>=<span style="color: #ff0000;">&quot;-o ${output.path}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/exec<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
&nbsp;
        <span style="color: #808080; font-style: italic;">&lt;!-- Open in local browser --&gt;</span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Open in Browser&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;exec</span> <span style="color: #000066;">executable</span>=<span style="color: #ff0000;">&quot;open&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
                        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">line</span>=<span style="color: #ff0000;">&quot;-a ${browser} ${local.path}&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/exec<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
        <span style="color: #808080; font-style: italic;">&lt;!-- Clear Debug Log --&gt;</span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Clear Log&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
&nbsp;
        	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;concat</span> <span style="color: #000066;">destfile</span>=<span style="color: #ff0000;">&quot;${log.path}&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>                                                                                                            
.: Sev Log File :.
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/concat<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;exec</span> <span style="color: #000066;">executable</span>=<span style="color: #ff0000;">&quot;open&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
                    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">line</span>=<span style="color: #ff0000;">&quot;-a console '${log.path}'&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/exec<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/project<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p><strong>Update:</strong> <a href="http://www.leebrimelow.com/">Lee Brimelov</a> just released a <a href="http://theflashblog.com/?p=482">plugin for Eclipse</a>, that provides this functionality (more or less) with a single click of an icon. It&#8217;s an alpha version, and you won&#8217;t have all the Ant flexibility (well, you could still install Ant), but you can avoid most of the installation hazzle, and that&#8217;s pretty cool. Unfortunately I couldn&#8217;t get it to work so far. </p>
<p><strong>Update 2:</strong> It bugged me that every time I execute this action Flash would pop up. To work around that I slightly modified the FlashCommand script (it actually checks wether the FLA file is already open, and if so won&#8217;t call the open command). Also I had to leave away the -c option (save and compact), something I don&#8217;t need anyway. So now when you execute the command from Flex the following happens:</p>
<ol>
<li>The little publish dialog pops up (Fla is exported to SWF)</li>
<li>The HTML file is opened in the browser (which comes to front), as well as the Console displaying the trace output</li>
</ol>
<p>Also I have bound the «Launch last external tool» command in Flex Builder to a key combo. Now things run pretty smooth and as much satisfying as compiling via Flash can be. Btw, I also looked into this Eclipse plugin – as it seems the only thing it does is to tell Flash to «Test Movie» with the frontmost open document. That&#8217;s absolutely okay for most people, but I&#8217;m glad for the extra functionality I get with this solution (at the cost of more initial effort of course). Download here the modified FlashCommand: <a class="download" href='http://blog.betabong.com/wp-content/uploads/2008/12/flashcommand.zip'>flashcommand.zip</a></p>


<p>Related posts:<ol><li><a href='http://blog.betabong.com/2008/12/03/test-movie-from-flex-to-flash-easy-way/' rel='bookmark' title='Permanent Link: Test Movie from Flex to Flash (easy way)'>Test Movie from Flex to Flash (easy way)</a></li><li><a href='http://blog.betabong.com/2008/12/06/test-flex-throttled-simulate-download/' rel='bookmark' title='Permanent Link: Test Flex/Flash throttled (aka Simulate Download)'>Test Flex/Flash throttled (aka Simulate Download)</a></li><li><a href='http://blog.betabong.com/2008/07/16/flex-project-svn-strategy/' rel='bookmark' title='Permanent Link: Flex Project &#8211; SVN Strategy'>Flex Project &#8211; SVN Strategy</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.betabong.com/2008/11/29/flex-builder-t-flash-ide/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>E4X String Parser</title>
		<link>http://blog.betabong.com/2008/09/23/e4x-string-parser/</link>
		<comments>http://blog.betabong.com/2008/09/23/e4x-string-parser/#comments</comments>
		<pubDate>Tue, 23 Sep 2008 11:13:00 +0000</pubDate>
		<dc:creator>betabong</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[e4x]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[library]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[os]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://blog.betabong.com/?p=111</guid>
		<description><![CDATA[I did a lot of string parsing in the recent time: CSS Selectors, XML Display Objects, Stylesheets, &#8230; I also need XML selection from String expressions – I formerly (AS2) used the great XPath4AS2 from XFactorStudio which did it&#8217;s job well (though a bit slow, it&#8217;s AS2 after all).
There&#8217;s also one for Actionscript 3 (xpath-as3). [...]


Related posts:<ol><li><a href='http://blog.betabong.com/2008/09/01/speed-parsing-string-in-as3/' rel='bookmark' title='Permanent Link: Simplicity follows Performance – parsing Strings in Actionscript 3'>Simplicity follows Performance – parsing Strings in Actionscript 3</a></li><li><a href='http://blog.betabong.com/2008/11/19/alchemy-release/' rel='bookmark' title='Permanent Link: Alchemy – THE cool new flash feature!'>Alchemy – THE cool new flash feature!</a></li><li><a href='http://blog.betabong.com/2008/07/21/nested-inner-functions-can-be-evil/' rel='bookmark' title='Permanent Link: Nested inner functions can be evil'>Nested inner functions can be evil</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>I did a lot of string parsing in the recent time: CSS Selectors, XML Display Objects, Stylesheets, &#8230; I also need XML selection from String expressions – I formerly (AS2) used the great <a href="http://www.xfactorstudio.com/">XPath4AS2 from XFactorStudio</a> which did it&#8217;s job well (though a bit slow, it&#8217;s AS2 after all).</p>
<p>There&#8217;s also one for Actionscript 3 (<a href="http://code.google.com/p/xpath-as3/">xpath-as3</a>). But.. well&#8230; I wanted to go for some real speed! I like XPath a lot, but we now have native E4X selection in Actionscript 3, quite a different concept of node selection, and the conversion of XPath to E4X obviously results in quite a compromise in performance.</p>
<p>So all I need is a decent E4X parser. And hey, I found one! E<a href="http://www.adobe.com/devnet/flex/articles/e4x_print.html">4XParser from Digital Primates</a>. It does its job really well, especially considering the very compact code it consists of. Thanks to some preparsing and caching, it&#8217;s also quite fast.</p>
<p><strong>Still I thought I can do better :-)</strong> So I planted myself for a day (and a night) in front of my displays and hacked the hell out of it. The result is a little library which does pretty much the same thing as E4XParser, though pretty much more and a little faster too (15% to 50%). It&#8217;s about half as fast as the native E4X selection (once parsed). You can do nearly anything you can do with E4X. Use it like this:</p>
<p> </p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">import</span> com.<span style="color: #006600;">betabong</span>.<span style="color: #0066CC;">xml</span>.<span style="color: #006600;">e4x</span>.<span style="color: #006600;">E4X</span>;
<span style="color: #000000; font-weight: bold;">var</span> result : XMLList = E4X.<span style="color: #006600;">evaluate</span><span style="color: #66cc66;">&#40;</span> xmllist , <span style="color: #ff0000;">&quot;author.( name.@last == 'Jobs' )&quot;</span> <span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #808080; font-style: italic;">// E4X.evaluate( source : XMLList , expression : String ) : XMLList</span></pre></div></div>

<p> <br />
If your source is XML, just do XMLList( xml ), if your result should be xml, do xml = result[0]</p>
<p><a href="/showcase/e4x/E4X_Parse_Test.html">Test it here</a></p>
<p><a href="http://blog.betabong.com/showcase/e4x/E4X_Parse_Test.html" target="_blank"><img class="alignnone size-full wp-image-113" title="e4x" src="http://blog.betabong.com/wp-content/uploads/2008/09/e4x.png" alt="" width="512" height="405" /></a></p>
<p><strong>Restrictions:</strong> You can&#8217;t use AND/OR in comparisions. So, this won&#8217;t go: author.( name.@first == &#8216;Steve&#8217; &amp;&amp; name.@last == &#8216;Jobs&#8217; ) – though this is only a real limitations for OR. do this for AND: author.( name.@first == &#8216;Steve&#8217; ).( name.@last == &#8216;Jobs&#8217; ).</p>
<p><strong>What you can do:</strong> Yes, you can do quite advanced stuff like author.( name.@first == name.@last ) or car.@rating.average() (one of the few proprietary functions I added). Or even</p>
<pre>*..car.( @brand.toLowerCase() == 'volvo' ).( parent().( localName() == 'group' ).@rating &gt; @rating )</pre>
<p>– a weird example, I admit, but fancy, ain&#8217;t it? :-)</p>
<p>This is the first time ever I&#8217;m releasing part of my library as Open Source (MIT licence). As soon as I&#8217;ll find some time (and if I see any interest), I&#8217;m gonna put this into Google Code, so everybody can easily checkout and participate. Until then download it from here:</p>
<p><a class="download" href="/showcase/e4x/betabong-e4x.zip">Download</a> (zip 13kb)</p>


<p>Related posts:<ol><li><a href='http://blog.betabong.com/2008/09/01/speed-parsing-string-in-as3/' rel='bookmark' title='Permanent Link: Simplicity follows Performance – parsing Strings in Actionscript 3'>Simplicity follows Performance – parsing Strings in Actionscript 3</a></li><li><a href='http://blog.betabong.com/2008/11/19/alchemy-release/' rel='bookmark' title='Permanent Link: Alchemy – THE cool new flash feature!'>Alchemy – THE cool new flash feature!</a></li><li><a href='http://blog.betabong.com/2008/07/21/nested-inner-functions-can-be-evil/' rel='bookmark' title='Permanent Link: Nested inner functions can be evil'>Nested inner functions can be evil</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.betabong.com/2008/09/23/e4x-string-parser/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Garbage Collector and Dictionary</title>
		<link>http://blog.betabong.com/2008/07/18/garbage-collector-and-dictionary/</link>
		<comments>http://blog.betabong.com/2008/07/18/garbage-collector-and-dictionary/#comments</comments>
		<pubDate>Thu, 17 Jul 2008 23:59:11 +0000</pubDate>
		<dc:creator>betabong</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Random]]></category>
		<category><![CDATA[flash]]></category>

		<guid isPermaLink="false">http://blog.betabong.com/?p=27</guid>
		<description><![CDATA[Weak references are cool. No. they are substantial. I don&#8217;t know how we lived without them before. Anyway, they made our (we = flash developers) life better. I use them very often, when adding event listeners or caching with dictionaries (and I&#8217;m sure I&#8217;d use them even more often if there was any more possibilty [...]


Related posts:<ol><li><a href='http://blog.betabong.com/2008/07/21/nested-inner-functions-can-be-evil/' rel='bookmark' title='Permanent Link: Nested inner functions can be evil'>Nested inner functions can be evil</a></li><li><a href='http://blog.betabong.com/2008/09/26/weak-method-closure/' rel='bookmark' title='Permanent Link: Weak Method Closure'>Weak Method Closure</a></li><li><a href='http://blog.betabong.com/2008/09/23/e4x-string-parser/' rel='bookmark' title='Permanent Link: E4X String Parser'>E4X String Parser</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p><a href="http://dispatchevent.org/mims/creating-weak-references-in-as3/">Weak references</a> are cool. No. they are substantial. I don&#8217;t know how we lived without them before. Anyway, they made our (we = flash developers) life better. I use them very often, when adding event listeners or caching with dictionaries (and I&#8217;m sure I&#8217;d use them even more often if there was any more possibilty provided).</p>
<p>Still you can struggle over unexpected behaviour.<span id="more-27"></span> First of all there is no guarantee that objects are <a href="http://www.adobe.com/devnet/flashplayer/articles/garbage_collection.html">garbaged</a> (well it&#8217;s probably not a memory thing.. more about unreferencing, what the heck do I know?!) as soon as there aren&#8217;t any references left. But, in my experience, weak references work quite good.. I didn&#8217;t have to worry about them living for some more seconds or so. But. But! They&#8217;ll live on at least until next rendering step, meaning until actionscript execution is done.</p>
<p>I struggled over this with a validation manager, that keeps tracks of unvalidated objects in a weak dictionary. So when object unvalidates, it tells so to the validator who will validate before rendering update. Now let&#8217;s assume the object shall be destroyed in the mean time – it will unlisten to dispatchers, it will unlink sprites and so on.. but may be it&#8217;s already registered in the validator. So it&#8217;ll stay alive to fullfill next validation processing. (Which led into uncaught errors due to null references in the destroyed object in my example.)</p>
<p>I could of course unregister at the validator at destroy. But.. hmm.. I want my engine to be as fast and robust as possible and unregistering can be difficult and time consuming (especially when 1000 objects will be destroyed). So what I&#8217;ve done is, I set a flag &#8216;destroyed&#8217; when destruction is complete, and on each validation I&#8217;ll check for that flag:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> validateDisplay<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> : <span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
  <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> _render_dirty <span style="color: #66cc66;">&amp;&amp;</span> <span style="color: #66cc66;">!</span>destroyed <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
    render<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
  <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>Checking against a boolean flag is fast as hell, so that&#8217;s cool. And also, it won&#8217;t happen often (it was really a rare exceptional case actually). So besides weak references in AS3 we still have to be careful as hell about memory leaks. By the way, the profiler in Flex Pro is just fucking great :-)</p>
<p>On a side note: Any one any info on MethodClosure objects lying around in memory?? I know what they are used for, but it seems they live and live and live&#8230;.</p>


<p>Related posts:<ol><li><a href='http://blog.betabong.com/2008/07/21/nested-inner-functions-can-be-evil/' rel='bookmark' title='Permanent Link: Nested inner functions can be evil'>Nested inner functions can be evil</a></li><li><a href='http://blog.betabong.com/2008/09/26/weak-method-closure/' rel='bookmark' title='Permanent Link: Weak Method Closure'>Weak Method Closure</a></li><li><a href='http://blog.betabong.com/2008/09/23/e4x-string-parser/' rel='bookmark' title='Permanent Link: E4X String Parser'>E4X String Parser</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.betabong.com/2008/07/18/garbage-collector-and-dictionary/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RA D IOHEA_D HO_US E OF/ CARD_S</title>
		<link>http://blog.betabong.com/2008/07/17/ra-d-iohea_d-ho_us-e-of-card_s/</link>
		<comments>http://blog.betabong.com/2008/07/17/ra-d-iohea_d-ho_us-e-of-card_s/#comments</comments>
		<pubDate>Thu, 17 Jul 2008 12:48:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Flash & more]]></category>
		<category><![CDATA[Music]]></category>
		<category><![CDATA[Random]]></category>
		<category><![CDATA[3d]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[radiohead]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://blog.betabong.com/?p=25</guid>
		<description><![CDATA[It doesn&#8217;t happen that often that I see stuff that amazes me from a professional and private perspective in so many ways. Well, it happened today when I saw:

http://code.google.com/creative/radiohead/viewer.html (Flash)
http://code.google.com/creative/radiohead/ (see video in better quality, making of and more&#8230;)


No related posts.


No related posts.]]></description>
			<content:encoded><![CDATA[<p>It doesn&#8217;t happen that often that I see stuff that amazes me from a professional and private perspective in so many ways. Well, it happened today when I saw:</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="520" height="400" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="src" value="http://www.youtube.com/v/8nTFjVm9sTQ&amp;hl=en&amp;fs=0&amp;color1=0xeeeeee&amp;color2=0xeeeeee&amp;ap=%2526fmt%3D18" /><embed type="application/x-shockwave-flash" width="520" height="400" src="http://www.youtube.com/v/8nTFjVm9sTQ&amp;hl=en&amp;fs=0&amp;color1=0xeeeeee&amp;color2=0xeeeeee&amp;ap=%2526fmt%3D18"></embed></object></p>
<p><a title="Radiohead Interactive 3D Viewer" href="http://code.google.com/creative/radiohead/viewer.html">http://code.google.com/creative/radiohead/viewer.html</a> (Flash)</p>
<p><a title="The starting page" href="http://code.google.com/creative/radiohead/">http://code.google.com/creative/radiohead/</a> (see video in better quality, making of and more&#8230;)</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://blog.betabong.com/2008/07/17/ra-d-iohea_d-ho_us-e-of-card_s/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
