<?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; Flex Builder</title>
	<atom:link href="http://blog.betabong.com/tag/flex-builder/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>Embed Assets in Flash Project</title>
		<link>http://blog.betabong.com/2009/02/13/embed-assets-in-flash-project/</link>
		<comments>http://blog.betabong.com/2009/02/13/embed-assets-in-flash-project/#comments</comments>
		<pubDate>Fri, 13 Feb 2009 13:00:18 +0000</pubDate>
		<dc:creator>betabong</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Flash IDE]]></category>
		<category><![CDATA[Flex Builder]]></category>

		<guid isPermaLink="false">http://blog.betabong.com/?p=190</guid>
		<description><![CDATA[There&#8217;s still quite a gap between Flash and Flex – while Flash is great for creating animations, vector symbols and just keeping little assets within one place, Flex Builder is so very much better for anything code. So how to link those two together?
Though I&#8217;ve written some posts about how to code within Flex Builder [...]


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></ol>]]></description>
			<content:encoded><![CDATA[<p>There&#8217;s still quite a gap between Flash and Flex – while Flash is great for creating animations, vector symbols and just keeping little assets within one place, Flex Builder is so very much better for anything code. So how to link those two together?</p>
<p>Though I&#8217;ve written some posts about how to code within Flex Builder and <a href="/2008/12/03/test-movie-from-flex-to-flash-easy-way/">compile from there using Flash IDE</a>, I personally don&#8217;t like that at all and only use it for some few older AS3 projects. There are better methods, ways to compile from within Flex Builder while still being able to make use of Flash comfort.</p>
<p>There&#8217;s a neat way to <strong>embed a library</strong> without loosing any functionality (like little scripts). I&#8217;ve first seen it at <a href="http://www.gskinner.com/blog/archives/2007/03/using_flash_sym.html">Grant Skinner</a> (who&#8217;s doing great stuff, one of my favorites in the flash community really). Let&#8217;s say, you have a assets.fla and a published assets.swf. Now here we go:<span id="more-190"></span></p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #66cc66;">&#91;</span>SWF<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">width</span>=<span style="color: #ff0000;">&quot;750&quot;</span>, <span style="color: #0066CC;">height</span>=<span style="color: #ff0000;">&quot;500&quot;</span>, frameRate=<span style="color: #ff0000;">&quot;30&quot;</span>, <span style="color: #0066CC;">backgroundColor</span>=<span style="color: #ff0000;">&quot;#111111&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#93;</span>
<span style="color: #0066CC;">dynamic</span> <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> MyApplication <span style="color: #0066CC;">extends</span> Sprite
<span style="color: #66cc66;">&#123;</span>
&nbsp;
	<span style="color: #66cc66;">&#91;</span>Embed<span style="color: #66cc66;">&#40;</span>source=<span style="color: #ff0000;">&quot;assets/assets.swf&quot;</span>, mimeType=<span style="color: #ff0000;">&quot;application/octet-stream&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#93;</span>
	<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> StageAssets:<span style="color: #000000; font-weight: bold;">Class</span>;
&nbsp;
	<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> GlobusFlow<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
	<span style="color: #66cc66;">&#123;</span>
		loadEmbedded<span style="color: #66cc66;">&#40;</span> StageAssets <span style="color: #66cc66;">&#41;</span>;
	<span style="color: #66cc66;">&#125;</span>
&nbsp;
	<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> loadEmbedded<span style="color: #66cc66;">&#40;</span> cls : <span style="color: #000000; font-weight: bold;">Class</span> <span style="color: #66cc66;">&#41;</span> : <span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
		<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">&quot;[Preloader] Loading embedded&quot;</span> <span style="color: #66cc66;">&#41;</span>;
		<span style="color: #000000; font-weight: bold;">var</span> loader : Loader = <span style="color: #000000; font-weight: bold;">new</span> Loader<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
		loader.<span style="color: #006600;">contentLoaderInfo</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span> Event.<span style="color: #006600;">COMPLETE</span> , <span style="color: #0066CC;">this</span>.<span style="color: #006600;">handleComplete</span> <span style="color: #66cc66;">&#41;</span>;
		<span style="color: #000000; font-weight: bold;">var</span> context : LoaderContext = <span style="color: #000000; font-weight: bold;">new</span> LoaderContext<span style="color: #66cc66;">&#40;</span> <span style="color: #000000; font-weight: bold;">false</span> , ApplicationDomain.<span style="color: #006600;">currentDomain</span> <span style="color: #66cc66;">&#41;</span>;
		loader.<span style="color: #006600;">loadBytes</span><span style="color: #66cc66;">&#40;</span> <span style="color: #000000; font-weight: bold;">new</span> cls<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> , context <span style="color: #66cc66;">&#41;</span>;
	<span style="color: #66cc66;">&#125;</span>
&nbsp;
	protected <span style="color: #000000; font-weight: bold;">function</span> handleComplete<span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">e</span> : Event <span style="color: #66cc66;">&#41;</span> : <span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">var</span> app : Sprite = Sprite<span style="color: #66cc66;">&#40;</span> LoaderInfo<span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">e</span>.<span style="color: #0066CC;">target</span> <span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">content</span> <span style="color: #66cc66;">&#41;</span>;
		<span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">loaded</span><span style="color: #66cc66;">&#40;</span> app <span style="color: #66cc66;">&#41;</span>;
	<span style="color: #66cc66;">&#125;</span>
&nbsp;
	protected <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">loaded</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">target</span>:Sprite<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">background</span> : <span style="color: #0066CC;">MovieClip</span> = <span style="color: #0066CC;">target</span> as <span style="color: #0066CC;">MovieClip</span>;
&nbsp;
		<span style="color: #000000; font-weight: bold;">var</span> mainChildren : <span style="color: #0066CC;">Array</span> = <span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</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>background.<span style="color: #006600;">numChildren</span> ; i++ <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
			mainChildren.<span style="color: #0066CC;">push</span><span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">background</span>.<span style="color: #006600;">getChildAt</span><span style="color: #66cc66;">&#40;</span>i<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
		<span style="color: #b1b100;">for</span> each <span style="color: #66cc66;">&#40;</span> <span style="color: #000000; font-weight: bold;">var</span> child : DisplayObject <span style="color: #b1b100;">in</span> mainChildren <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
			<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> child.<span style="color: #0066CC;">name</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
				<span style="color: #0066CC;">this</span><span style="color: #66cc66;">&#91;</span> child.<span style="color: #0066CC;">name</span> <span style="color: #66cc66;">&#93;</span> = child;
			<span style="color: #66cc66;">&#125;</span>
			<span style="color: #0066CC;">this</span>.<span style="color: #006600;">addChild</span><span style="color: #66cc66;">&#40;</span> child <span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #0066CC;">stage</span>.<span style="color: #006600;">stageWidth</span> = <span style="color: #0066CC;">background</span>.<span style="color: #0066CC;">width</span>;
		<span style="color: #0066CC;">stage</span>.<span style="color: #006600;">stageHeight</span> = <span style="color: #0066CC;">background</span>.<span style="color: #0066CC;">height</span>;
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>This does a bit more than just make the library available. In loaded() we&#8217;ll loop through all assets that are «on stage» in the loaded/embedded movieclip (assets.swf), and add each of them to our stage. That leads to a state that&#8217;s quite similar to as if we&#8217;d code within assets.fla itself. Hmm&#8230; well, really, that sounds more complicated than it is :-) It mainly gives you the feeling of being able to code within a SWF file. You can visually do your stuff in assets.fla, you can add a background and whatever to its stage, keep a nice library with graphics, animations, sounds and fonts.. and schwupps, here you go!</p>
<p>If you have Fonts embedded in your library, there&#8217;s a tiny little more to do:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">protected <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">loaded</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">target</span>:Sprite<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
	<span style="color: #808080; font-style: italic;">// ... (all the other stuff, see above)</span>
	registerFont<span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">'BoldFont'</span> <span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #0066CC;">public</span> <span style="color: #0066CC;">static</span> <span style="color: #000000; font-weight: bold;">function</span> registerFont<span style="color: #66cc66;">&#40;</span> fontLinkageId : <span style="color: #0066CC;">String</span> <span style="color: #66cc66;">&#41;</span> : <span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">var</span> fontClass : <span style="color: #000000; font-weight: bold;">Class</span> = getDefinitionByName<span style="color: #66cc66;">&#40;</span> fontLinkageId <span style="color: #66cc66;">&#41;</span> as <span style="color: #000000; font-weight: bold;">Class</span>;
	<span style="color: #0066CC;">Font</span>.<span style="color: #006600;">registerFont</span><span style="color: #66cc66;">&#40;</span> fontClass <span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>If you just wanna embed fonts without any registering, you can also go like that:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #66cc66;">&#91;</span>Embed<span style="color: #66cc66;">&#40;</span>source=<span style="color: #ff0000;">'assets/fonts.swf'</span> , symbol=<span style="color: #ff0000;">'BoldFont'</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#93;</span>
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> BoldFont : <span style="color: #000000; font-weight: bold;">Class</span>;</pre></div></div>

<p>Of course, instead of embedding everything, you can also load this dynamically (I mean, after all we have the Loader ready, don&#8217;t we? :) The advantage of that is that you can give your assets to some dumb Flasher and he can mess around with it without you having to recompile the app.</p>
<p>I know, this is all snippets and frickets, I&#8217;m just too lazy right now to build an example Flex project. Still I hope it&#8217;s of some use for one or the other.</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></ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.betabong.com/2009/02/13/embed-assets-in-flash-project/feed/</wfw:commentRss>
		<slash:comments>3</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>
	</channel>
</rss>
