<?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>ciacob.tk</title>
	<atom:link href="http://www.ciacob.org/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.ciacob.org</link>
	<description>Musings about ActionScript, Flex, AJAX, HTML, CSS, PHP... and pretty much any web beast out there</description>
	<lastBuildDate>Fri, 09 Apr 2010 08:01:16 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>So I&#8217;m a prostitute.. Essentially</title>
		<link>http://www.ciacob.org/?p=202</link>
		<comments>http://www.ciacob.org/?p=202#comments</comments>
		<pubDate>Fri, 09 Apr 2010 07:59:51 +0000</pubDate>
		<dc:creator>ciacob</dc:creator>
				<category><![CDATA[Life]]></category>

		<guid isPermaLink="false">http://www.ciacob.tk/?p=202</guid>
		<description><![CDATA[The quoted text is no novelty, in fact it&#8217;s a classic, as it&#8217;s been flowing around the net for some good years now. I just happened to stumble upon it these days  – well, in fact I got a link to some fresh, funny, new thingy to read ;) – and I felt it&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>The quoted text is no novelty, in fact it&#8217;s a classic, as it&#8217;s been flowing around the net for some good years now. I just happened to stumble upon it these days  – well, in fact I got a link to some fresh, funny, new thingy to read ;) – and I felt it&#8217;s still funny enough <span style="text-decoration: line-through;">and still true enough</span> to give it a republish.</p>
<p>I would love to give credit to the author, if I only new who it was&#8230;</p>
<blockquote><p><strong><em>The truth about working in the IT industry</em></strong></p>
<ol>
<li><em>We work weird (night) shifts&#8230;</em><em><br />
Just like prostitutes.</em></li>
<li><em>They pay you to make the client happy&#8230;</em><em><br />
Just like a prostitute.</em></li>
<li><em>The client pays a lot of money, but your employer keeps almost every penny&#8230;</em><em><br />
Just like a prostitute.</em></li>
<li><em>You are rewarded for fulfilling the client&#8217;s dreams&#8230;</em><em><br />
Just like a prostitute.</em></li>
<li><em>Your friends fall apart and you end up hanging out with people in the same profession as you&#8230;</em><em><br />
Just like a prostitute.</em></li>
<li><em>When you have to meet the client you always have to be perfectly groomed&#8230;<br />
</em><em>Just like a prostitute.</em></li>
<li><em>But when you go back home it seems like you are coming back from hell&#8230;</em><em><br />
Just like a prostitute.</em></li>
<li><em>The client always wants to pay less but expects</em><em> incredible things from you&#8230;</em><em><br />
Just like a prostitute.</em></li>
<li><em>When people ask you about your job, you have</em><em> difficulties to explain it&#8230;</em><em><br />
Just like a prostitute.</em></li>
<li><em>Everyday when you wake up, you say: &#8220;I&#8217;m not going</em><em> to spend the rest of my life doing this.&#8221;<br />
</em><em>Just like a prostitute &#8230;</em></li>
</ol>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.ciacob.org/?feed=rss2&amp;p=202</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>&#8230;remotely compile FLA files for Flex Builder debugging</title>
		<link>http://www.ciacob.org/?p=171</link>
		<comments>http://www.ciacob.org/?p=171#comments</comments>
		<pubDate>Mon, 15 Mar 2010 15:37:15 +0000</pubDate>
		<dc:creator>ciacob</dc:creator>
				<category><![CDATA[Hacking]]></category>
		<category><![CDATA[How do I]]></category>

		<guid isPermaLink="false">http://www.ciacob.tk/?p=171</guid>
		<description><![CDATA[This is a follow-up to this two-years old post by Daryl Joseph Ducharme.
While Daryl explains how to use Ant and a *.jsfl file to remotely open Flash IDE, have it compile a given *.fla, and then close, his approach creates a release *.swf file, one that contains no debug information. If you want to actually [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">This is a follow-up to this two-years old <a href="http://my.opera.com/flexcoders/blog/2008/07/25/using-flex-builder-for-flash-development">post</a> by <a href="http://my.opera.com/darylducharme/">Daryl Joseph Ducharme</a>.</p>
<p style="text-align: left;">While Daryl explains how to use <a href="http://ant.apache.org/">Ant</a> and a *.<a href="http://www.actionscript.org/forums/forumdisplay.php3?f=37">jsfl</a> file to remotely open Flash IDE, have it compile a given *.fla, and then close, his approach creates a <em>release</em> *.swf file, one that contains <em>no debug information</em>. If you want to actually step-debug trough your code using the Flex Builder&#8217;s built-in debugger, some changes are in order.</p>
<p>To start with, we need to use <code>fl.getDocumentDOM().debugMovie()</code> instead of <code>fl.getDocumentDOM().exportSWF()</code> in the *.jsfl file template:</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="coMULTI">/**</span></div>
</li>
<li class="li1">
<div class="de1"><span class="coMULTI">&nbsp;* Exports file &quot;%fla%&quot; to &quot;%swf%&quot; using current settings.</span></div>
</li>
<li class="li1">
<div class="de1"><span class="coMULTI">&nbsp;*/</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li2">
<div class="de2"><span class="co1">// Open given file:</span></div>
</li>
<li class="li1">
<div class="de1">fl.<span class="me1">openDocument</span> <span class="br0">&#40;</span><span class="st0">&quot;file:///%fla%&quot;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="co1">// Export to *.swf, includding debugging information:</span></div>
</li>
<li class="li1">
<div class="de1">fl.<span class="me1">getDocumentDOM</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">debugMovie</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li2">
<div class="de2">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="co1">// Close the running movie which also ends the debugging session (this didn&#8217;t work</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co1">// for me):</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co1">// fl.closeAllPlayerDocuments();</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li2">
<div class="de2"><span class="co1">// Close Flash IDE as well:</span></div>
</li>
<li class="li1">
<div class="de1">fl.<span class="me1">saveAll</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">fl.<span class="me1">quit</span> <span class="br0">&#40;</span><span class="kw2">false</span><span class="br0">&#41;</span>;</div>
</li>
</ol>
</div>
<p>In my case, a Flash Player window remained open after running the above script in Flash IDE, and there was no way of getting rid of it via the *.jsfl file.</p>
<p>Therefore, I needed to add some code in the <code>build.xml</code> file, in order to close it &quot;by hand&quot;. This is what I&#8217;ve come up with:</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="sc3"><span class="coMULTI">&lt;!&#8211; Invokes Flash CS4 IDE an tells it to compile our *.fla file –&gt;</span></div>
</li>
<li class="li1">
<div class="de1"></span></div>
</li>
<li class="li1">
<div class="de1"><span class="sc3"><span class="re1">&lt;project</span> <span class="re0">default</span>=<span class="st0">&quot;start&quot;</span><span class="re2">&gt;</span></span> &nbsp; &nbsp; &nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;</span>!– Set Properties –<span class="re2">&gt;</span></span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;property</span> <span class="re0">name</span>=<span class="st0">&quot;flashIDE&quot;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="re0">value</span>=<span class="st0">&quot;my/path/to/Flash.exe&quot;</span> <span class="re2">/&gt;</span></span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;property</span> <span class="re0">name</span>=<span class="st0">&quot;moviePrefix&quot;</span> <span class="re0">value</span>=<span class="st0">&quot;MyFla&quot;</span> <span class="re2">/&gt;</span></span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;property</span> <span class="re0">name</span>=<span class="st0">&quot;srcDir&quot;</span> <span class="re0">value</span>=<span class="st0">&quot;path/to/project/source/folder&quot;</span> <span class="re2">/&gt;</span></span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;property</span> <span class="re0">name</span>=<span class="st0">&quot;destDir&quot;</span> <span class="re0">value</span>=<span class="st0">&quot;path/to/project/bin/folder&quot;</span> <span class="re2">/&gt;</span></span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;property</span> <span class="re0">name</span>=<span class="st0">&quot;jsflFile&quot;</span> <span class="re0">value</span>=<span class="st0">&quot;compile.jsfl&quot;</span> <span class="re2">/&gt;</span></span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;property</span> <span class="re0">name</span>=<span class="st0">&quot;jsflTemplate&quot;</span> <span class="re0">value</span>=<span class="st0">&quot;automation.jsfl&quot;</span> <span class="re2">/&gt;</span></span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;property</span> <span class="re0">name</span>=<span class="st0">&quot;publicUsersFolder&quot;</span> </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">value</span>=<span class="st0">&quot;path/to/a/public/folder/on/your/system&quot;</span> <span class="re2">/&gt;</span></span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;property</span> <span class="re0">name</span>=<span class="st0">&quot;batFile&quot;</span> <span class="re0">value</span>=<span class="st0">&quot;killFP.bat&quot;</span> <span class="re2">/&gt;</span></span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;property</span> <span class="re0">name</span>=<span class="st0">&quot;batFileTemplate&quot;</span> <span class="re0">value</span>=<span class="st0">&quot;automation.bat&quot;</span> <span class="re2">/&gt;</span></span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;property</span> <span class="re0">name</span>=<span class="st0">&quot;waitTime&quot;</span> <span class="re0">value</span>=<span class="st0">&quot;12&quot;</span> <span class="re2">/&gt;</span></span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;</span>!– Starts the build –<span class="re2">&gt;</span></span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;target</span> <span class="re0">name</span>=<span class="st0">&quot;start&quot;</span><span class="re2">&gt;</span></span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;</span>!– After running the debugMovie<span class="br0">&#40;</span><span class="br0">&#41;</span> command in Flash, Flash Player is</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;launched to show the compiled movie; it will never close by </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;itself, which, in turn, will make the <span class="st0">&quot;build&quot;</span> target never exit. </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;This is why we need to run the <span class="st0">&quot;waitForBuild&quot;</span> target in </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;parallel. It simply waits a number of seconds, and then forcibly</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;closes all running Flash Player instances. </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; –<span class="re2">&gt;</span></span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;parallel<span class="re2">&gt;</span></span></span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;antcall</span> <span class="re0">target</span>=<span class="st0">&quot;waitForBuild&quot;</span> <span class="re2">/&gt;</span></span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;antcall</span> <span class="re0">target</span>=<span class="st0">&quot;build&quot;</span> <span class="re2">/&gt;</span></span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;/parallel<span class="re2">&gt;</span></span></span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;/target<span class="re2">&gt;</span></span></span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;</span>!– Waits a number of seconds before calling the <span class="st0">&quot;cleanup&quot;</span> target. –<span class="re2">&gt;</span></span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;target</span> <span class="re0">name</span>=<span class="st0">&quot;waitForBuild&quot;</span><span class="re2">&gt;</span></span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;sleep</span> <span class="re0">seconds</span>=<span class="st0">&quot;${waitTime}&quot;</span><span class="re2">/&gt;</span></span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;antcall</span> <span class="re0">target</span>=<span class="st0">&quot;cleanup&quot;</span> <span class="re2">/&gt;</span></span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;/target<span class="re2">&gt;</span></span></span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;</span>!– Attempts to kill all Flash Player instances <span class="br0">&#40;</span>see above<span class="br0">&#41;</span>. –<span class="re2">&gt;</span></span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;target</span> <span class="re0">name</span>=<span class="st0">&quot;cleanup&quot;</span><span class="re2">&gt;</span></span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;copy</span> <span class="re0">tofile</span>=<span class="st0">&quot;${publicUsersFolder}/${batFile}&quot;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="re0">file</span>=<span class="st0">&quot;${srcDir}/${batFileTemplate}&quot;</span> <span class="re2">/&gt;</span></span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;exec</span> <span class="re0">executable</span>=<span class="st0">&quot;cmd&quot;</span> <span class="re0">dir</span>=<span class="st0">&quot;C:/Windows&quot;</span><span class="re2">&gt;</span></span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;arg</span> <span class="re0">value</span>=<span class="st0">&quot;/c&quot;</span><span class="re2">/&gt;</span></span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;arg</span> <span class="re0">value</span>=<span class="st0">&quot;${publicUsersFolder}/${batFile}&quot;</span><span class="re2">/&gt;</span></span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;/exec<span class="re2">&gt;</span></span></span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;/target<span class="re2">&gt;</span></span></span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;</span>!– Invokes Flash IDE with a generated JSFL file as argument. –<span class="re2">&gt;</span></span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;target</span> <span class="re0">name</span>=<span class="st0">&quot;build&quot;</span> <span class="re0">depends</span>=<span class="st0">&quot;writeJSFL&quot;</span><span class="re2">&gt;</span></span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;exec</span> <span class="re0">executable</span>=<span class="st0">&quot;${flashIDE}&quot;</span> <span class="re0">failonerror</span>=<span class="st0">&quot;true&quot;</span><span class="re2">&gt;</span></span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;arg</span> <span class="re0">value</span>=<span class="st0">&quot;${srcDir}/${jsflFile}&quot;</span><span class="re2">/&gt;</span></span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;/exec<span class="re2">&gt;</span></span></span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;/target<span class="re2">&gt;</span></span></span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;</span>!– Generates a JSFL file to pass as an argument to Flash IDE. –<span class="re2">&gt;</span></span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;target</span> <span class="re0">name</span>=<span class="st0">&quot;writeJSFL&quot;</span> <span class="re2">&gt;</span></span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;concat</span> <span class="re0">destfile</span>=<span class="st0">&quot;${srcDir}/${jsflFile}&quot;</span><span class="re2">&gt;</span></span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;filelist</span> <span class="re0">files</span>=<span class="st0">&quot;${jsflTemplate}&quot;</span> <span class="re2">/&gt;</span></span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;/concat<span class="re2">&gt;</span></span></span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;replace</span> <span class="re0">file</span>=<span class="st0">&quot;${jsflFile}&quot;</span><span class="re2">&gt;</span></span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;replacefilter</span> <span class="re0">token</span>=<span class="st0">&quot;%fla%&quot;</span> </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="re0">value</span>=<span class="st0">&quot;${srcDir}/${moviePrefix}.fla&quot;</span><span class="re2">/&gt;</span></span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;replacefilter</span> <span class="re0">token</span>=<span class="st0">&quot;%swf%&quot;</span> </div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="re0">value</span>=<span class="st0">&quot;${destDir}/${moviePrefix}.swf&quot;</span><span class="re2">/&gt;</span></span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;/replace<span class="re2">&gt;</span></span></span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;/target<span class="re2">&gt;</span></span></span></div>
</li>
<li class="li1">
<div class="de1"><span class="sc3"><span class="re1">&lt;/project<span class="re2">&gt;</span></span></span></div>
</li>
</ol>
</div>
<p>The <code>batFileTemplate</code> file the <code>build.xml</code> mentions only contains:</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="co2">:: Kills all running instances of Flash Player. Must be run as </span></div>
</li>
<li class="li1">
<div class="de1"><span class="co2">:: administrator, from the local machine. It will NOT work if run from </span></div>
</li>
<li class="li1">
<div class="de1"><span class="co2">:: a network location.</span></div>
</li>
<li class="li1">
<div class="de1">taskkill /F /IM FlashPlayer*</div>
</li>
</ol>
</div>
<p>All the above worked just fine for my particular configuration, which was: <strong>Windows Vista Enterprise 64</strong>, <strong>Flash CS4</strong>, and <strong>Flex Builder 3.0.2</strong> (standalone version); it may or may not work in your case.</p>
<p>You&#8217;ll definitely need to change a few things: the <em>waitTime</em> property (to accommodate your project compile time); all dummy paths with real ones on your system; and, if you are on a Mac or on a Linux box, then you&#8217;ll need to rewrite from scratch the <em>cleanup</em> target.</p>
<p>That&#8217;s about it. And, again, thanks <a href="http://my.opera.com/darylducharme/">Daryl</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ciacob.org/?feed=rss2&amp;p=171</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>&#8230;tell apart missing XML attributes from empty ones</title>
		<link>http://www.ciacob.org/?p=155</link>
		<comments>http://www.ciacob.org/?p=155#comments</comments>
		<pubDate>Fri, 26 Feb 2010 16:31:18 +0000</pubDate>
		<dc:creator>ciacob</dc:creator>
				<category><![CDATA[How do I]]></category>
		<category><![CDATA[actionscript3]]></category>
		<category><![CDATA[E4X]]></category>

		<guid isPermaLink="false">http://www.ciacob.tk/?p=155</guid>
		<description><![CDATA[This might be tricky using E4X, which, in an attempt to make the overall XML handling a lot easier, apparently also took some useful &#8220;garbage&#8221; away: there is no getAttributeNode() method (or similar) in E4X, as it is in DOM.



var dataProvider1 : XML = &#60;Text /&#62;;


var dataProvider2 : XML = &#60;Text prompt=&#34;&#34; /&#62;;


&#160;


// Suppose you [...]]]></description>
			<content:encoded><![CDATA[<p>This might be tricky using <abbr title="ECMAScript for XML"><strong>E4X</strong></abbr>, which, in an attempt to make the overall XML handling a lot easier, apparently also took some useful &#8220;garbage&#8221; away: there is no <code>getAttributeNode()</code> method (or similar) in <abbr title="ECMAScript for XML"><strong>E4X</strong></abbr>, as it is in <abbr title="Document Object Model"><strong>DOM</strong></abbr>.</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="kw2">var</span> dataProvider1 : <span class="kw3">XML</span> = &lt;Text /&gt;;</div>
</li>
<li class="li1">
<div class="de1"><span class="kw2">var</span> dataProvider2 : <span class="kw3">XML</span> = &lt;Text prompt=<span class="st0">&quot;&quot;</span> /&gt;;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="co1">// Suppose you want to see whether there actually is a &quot;prompt&quot; attribute set on your node, </span></div>
</li>
<li class="li2">
<div class="de2"><span class="co1">// and do something clever if it isn&#8217;t:</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw2">var</span> hasPromptAttribute : <span class="kw3">Boolean</span> = <span class="br0">&#40;</span>dataProvider1.@prompt != <span class="kw2">null</span><span class="br0">&#41;</span>; <span class="co1">// guess what: TRUE</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw2">var</span> hasPromptAttribute : <span class="kw3">Boolean</span> = <span class="br0">&#40;</span>dataProvider1.@<span class="br0">&#91;</span><span class="st0">&#8216;prompt&#8217;</span><span class="br0">&#93;</span> != <span class="kw2">null</span><span class="br0">&#41;</span>; <span class="co1">// just fancier: TRUE</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="co1">// Maybe a predicate will do?</span></div>
</li>
<li class="li2">
<div class="de2"><span class="kw2">var</span> hasPromptAttribute : <span class="kw3">Boolean</span> = <span class="br0">&#40;</span>dataProvider1.<span class="me1"><span class="br0">&#40;</span>attribute</span> <span class="br0">&#40;</span><span class="st0">&#8216;prompt&#8217;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="br0">&#91;</span><span class="nu0">0</span><span class="br0">&#93;</span> != <span class="kw2">null</span><span class="br0">&#41;</span> <span class="co1">// TRUE</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="co1">// Count elements in the returning XMLList?</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw3">trace</span> <span class="br0">&#40;</span>dataProvider1.<span class="me1"><span class="br0">&#40;</span>attribute</span> <span class="br0">&#40;</span><span class="st0">&#8216;prompt&#8217;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>.<span class="kw3">length</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>; <span class="co1">// this is &quot;1&quot;; you knew that, right?</span></div>
</li>
</ol>
</div>
<p>The point is, you&#8217;re essentially just wasting your time with <abbr title="ECMAScript for XML"><strong>E4X</strong></abbr> here. You need to get to the roots, and recall the <code><em>Object</em></code> object of ActionScript3. Remember the <code>hasOwnProperty</code> method?</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="kw2">var</span> hasDp1PromptAttribute : <span class="kw3">Boolean</span> = <span class="br0">&#40;</span>dataProvider1.<span class="me1">hasOwnProperty</span><span class="br0">&#40;</span><span class="st0">&#8216;prompt&#8217;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>; <span class="co1">// FALSE</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw2">var</span> hasDp2PromptAttribute : <span class="kw3">Boolean</span> = <span class="br0">&#40;</span>dataProvider2.<span class="me1">hasOwnProperty</span><span class="br0">&#40;</span><span class="st0">&#8216;prompt&#8217;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>; <span class="co1">// TRUE</span></div>
</li>
</ol>
</div>
<p>Phew&#8230; :-)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ciacob.org/?feed=rss2&amp;p=155</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Smarter i18n platform</title>
		<link>http://www.ciacob.org/?p=140</link>
		<comments>http://www.ciacob.org/?p=140#comments</comments>
		<pubDate>Sat, 30 Jan 2010 18:58:35 +0000</pubDate>
		<dc:creator>ciacob</dc:creator>
				<category><![CDATA[Ideas]]></category>

		<guid isPermaLink="false">http://www.ciacob.tk/?p=140</guid>
		<description><![CDATA[I am, these days, sporadically, working at translating the UI of the MuseScore music notation software into Romanian.
The software itself is opensource, written in C++ against the QT platform, and translation, up to a few days ago, was made via the QTLinguist application.
The QTLinguist has a rather priceless feature, called suggestions (or the like), which [...]]]></description>
			<content:encoded><![CDATA[<p>I am, these days, sporadically, working at translating the UI of the <a href="http://musescore.org/">MuseScore</a> music notation software into Romanian.</p>
<p>The software itself is opensource, written in C++ against the <a href="http://qt.nokia.com/">QT platform</a>, and translation, up to a few days ago, was made via the <a href="http://qt-apps.org/content/show.php/Qt+Linguist+Download?content=89360">QTLinguist</a> application.</p>
<p>The QTLinguist has a rather priceless feature, called <em>suggestions</em> (or the like), which saves much of translator&#8217;s precious time. It simply recognizes strings that you have previously translated and prompts you to choose (one of) the translation(s) you already entered for it.</p>
<p>Recently, the project&#8217;s stakeholder decided to switch to a web based <a href="http://translate.musescore.org">translation tool</a> (I&#8217;m not sure if it&#8217;s a home-made web application or a dedicated/commercial one). While this speeds things a lot, the <em>suggestions</em> feature QT had is, of course, missing, and I&#8217;m actually missing it the most.</p>
<p>Which brings me to the point I wanted to state when I first decided to put together this post: Isn&#8217;t there a smarter <em><abbr title="internationalization">i18n</abbr></em> tool/platform/API that would prevent the programmer from redundantly entering the same string several times in an application&#8217;s UI? I&#8217;d really like to know.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ciacob.org/?feed=rss2&amp;p=140</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>&#8230;convert a decimal Number to a hexadecimal String?</title>
		<link>http://www.ciacob.org/?p=134</link>
		<comments>http://www.ciacob.org/?p=134#comments</comments>
		<pubDate>Mon, 25 Jan 2010 22:30:45 +0000</pubDate>
		<dc:creator>ciacob</dc:creator>
				<category><![CDATA[How do I]]></category>

		<guid isPermaLink="false">http://www.ciacob.tk/?p=134</guid>
		<description><![CDATA[Don&#8217;t go about writing your own decimal to hexadecimal converter. In AS3, the Number.toString(radix : Number) method is all that you need:



var myDeci : Number = 16711680;


var myHexa : String = myDeci.toString &#40;16&#41;; // myHexa now holds &#34;ff0000&#34;



Note that you may still need to left pad the resulting value, if you&#8217;re operating with color triplets [...]]]></description>
			<content:encoded><![CDATA[<p>Don&#8217;t go about writing your own decimal to hexadecimal converter. In AS3, the <code>Number.toString(radix : Number)</code> method is all that you need:</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="kw2">var</span> myDeci : <span class="kw3">Number</span> = <span class="nu0">16711680</span>;</div>
</li>
<li class="li1">
<div class="de1"><span class="kw2">var</span> myHexa : <span class="kw3">String</span> = myDeci.<span class="kw3">toString</span> <span class="br0">&#40;</span><span class="nu0">16</span><span class="br0">&#41;</span>; <span class="co1">// myHexa now holds &quot;ff0000&quot;</span></div>
</li>
</ol>
</div>
<p>Note that you may still need to left pad the resulting value, if you&#8217;re operating with color triplets – as, for instance, <code>0</code> in decimal will still be <code>"0"</code> as a hexadecimal string, and <em>not </em><code>"000000"</code>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ciacob.org/?feed=rss2&amp;p=134</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>&#8230;scroll an element into view in Flex?</title>
		<link>http://www.ciacob.org/?p=129</link>
		<comments>http://www.ciacob.org/?p=129#comments</comments>
		<pubDate>Sat, 23 Jan 2010 13:12:43 +0000</pubDate>
		<dc:creator>ciacob</dc:creator>
				<category><![CDATA[How do I]]></category>

		<guid isPermaLink="false">http://www.ciacob.tk/?p=129</guid>
		<description><![CDATA[This worked for me:



var myButtonBounds : Rectangle = myButton.getBounds &#40;this&#41;;


verticalScrollPosition = myButtonBounds.bottom;



In the above, myButton was the Flex component I needed to bring into view by scrolling up the content of its container.

]]></description>
			<content:encoded><![CDATA[<p>This worked for me:</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="kw2">var</span> myButtonBounds : Rectangle = myButton.<span class="kw3">getBounds</span> <span class="br0">&#40;</span><span class="kw3">this</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">verticalScrollPosition = myButtonBounds.<span class="me1">bottom</span>;</div>
</li>
</ol>
</div>
<p>In the above, <code><strong>myButton</strong></code> was<strong> </strong>the Flex component I needed to bring into view by scrolling up the content of its container.<strong><br />
</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ciacob.org/?feed=rss2&amp;p=129</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
