<?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>Jonathan Spooner is a Web Developer in the San Diego Area. &#187; Project Sprouts</title>
	<atom:link href="http://www.jonathanspooner.com/category/web-development/flash/project-sprouts/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jonathanspooner.com</link>
	<description>Flex Developer, Air Developer, and ActionScript Programmer</description>
	<lastBuildDate>Fri, 28 May 2010 16:42:35 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Building multiple swf&#8217;s with Project Sprouts</title>
		<link>http://www.jonathanspooner.com/web-development/building-multiple-swfs-with-project-sprouts/</link>
		<comments>http://www.jonathanspooner.com/web-development/building-multiple-swfs-with-project-sprouts/#comments</comments>
		<pubDate>Wed, 22 Apr 2009 15:47:04 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[ActionScript 3.0]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Project Sprouts]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.jonathanspooner.com/blog/?p=237</guid>
		<description><![CDATA[For each additional swf you'll create a new task in your rakefile like this.
&#160;
desc 'Menu App'
task :menu =&#62; &#34;bin/MenuApp.swf&#34;
mxmlc 'bin/MenuApp.swf' do &#124;t&#124;
  t.input                    = &#34;src/MenuApp.as&#34;
  t.debug         [...]]]></description>
			<content:encoded><![CDATA[<p>For each additional swf you'll create a new <a href="http://projectsprouts.org/rdoc/classes/Sprout/MXMLCTask.html">task</a> in your rakefile like this.</p>
<pre class="ruby">&nbsp;
desc <span style="color:#996600;">'Menu App'</span>
task <span style="color:#ff3333; font-weight:bold;">:menu</span> =&gt; <span style="color:#996600;">&quot;bin/MenuApp.swf&quot;</span>
mxmlc <span style="color:#996600;">'bin/MenuApp.swf'</span> <span style="color:#9966CC; font-weight:bold;">do</span> |t|
  t.<span style="color:#9900CC;">input</span>                    = <span style="color:#996600;">&quot;src/MenuApp.as&quot;</span>
  t.<span style="color:#9900CC;">debug</span>                    = <span style="color:#0000FF; font-weight:bold;">false</span>
  t.<span style="color:#9900CC;">optimize</span>                 = <span style="color:#0000FF; font-weight:bold;">true</span>
  t.<span style="color:#9900CC;">default_size</span>             = <span style="color:#996600;">'540 436'</span>
  t.<span style="color:#9900CC;">default_background_color</span> = <span style="color:#996600;">&quot;0x000000&quot;</span>
  t.<span style="color:#9900CC;">library_path</span>     &lt;&lt; <span style="color:#996600;">&quot;lib/corelib.swc&quot;</span>
  t.<span style="color:#9900CC;">source_path</span>      &lt;&lt; <span style="color:#996600;">&quot;config/environments/production&quot;</span>
  t.<span style="color:#9900CC;">define</span>           = <span style="color:#996600;">&quot;CONFIG::production,false
  t.title            = &quot;</span><span style="color:#996600;">'My Project'</span><span style="color:#996600;">&quot;
  t.description      = 'My Menu App'
  t.link_report      = 'menu_report.xml'
end
</span></pre>
<p>After your task has been added it should now be listed when you run rake -T </p>
<pre class="bash">&nbsp;
rake -T
&gt; rake menu                     <span style="color: #808080; font-style: italic;"># Menu App</span>
&nbsp;</pre>
<p>Now run the task by it's name.</p>
<pre class="bash">&nbsp;
rake menu
&nbsp;</pre>
<p>You should see the mxmlc command execute.  Note that your new swf will not be opened up like the  rake debug task. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonathanspooner.com/web-development/building-multiple-swfs-with-project-sprouts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Automated build numbers for Flash Applications with Sprouts</title>
		<link>http://www.jonathanspooner.com/web-development/automate-build-numbers-for-flash-applications/</link>
		<comments>http://www.jonathanspooner.com/web-development/automate-build-numbers-for-flash-applications/#comments</comments>
		<pubDate>Tue, 14 Apr 2009 15:40:54 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[ActionScript 3.0]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Project Sprouts]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.jonathanspooner.com/blog/?p=200</guid>
		<description><![CDATA[This article will demonstrate how to use compile time variables to set a build number and environment type.  I will be using Project Sprouts to compile a swf with the mxmlc compiler.
We'll start by creating a new variable in our rakefile like this. Since this number will always show up when you run rakeI [...]]]></description>
			<content:encoded><![CDATA[<p>This article will demonstrate how to use compile time variables to set a build number and environment type.  I will be using <a href="http://www.projectsprouts.org/">Project Sprouts</a> to compile a swf with the mxmlc compiler.</p>
<p>We'll start by creating a new variable in our rakefile like this. Since this number will always show up when you run rakeI prefixed it with dev so my local build will never get confused others.</p>
<pre class="ruby">&nbsp;
build_number = <span style="color:#996600;">'&quot;<span style="color:#000099;">\'</span>dev.1.1.1.1001<span style="color:#000099;">\'</span>&quot;'</span>
&nbsp;</pre>
<blockquote><p>Quark #1.  It took me a few tries to get the quotes right.  Since this var is passed through a command shell then into the mxmlc the triple quotes are necessary.  If you don't you will be likely to see some strange results and your swf just not compiling at all.  If you use the string above and just replace dev.1.1.1.1001 you should be in good shape.  </p></blockquote>
<p><br/></p>
<p>The next step it to add our version number to either the <a href="http://www.projectsprouts.org/rdoc/index.html">project model</a> or a <a href="http://www.projectsprouts.org/rdoc/index.html">task</a> via the <a href="http://www.projectsprouts.org/rdoc/classes/Sprout/MXMLCTask.html#M000182">define</a> method.  I decided to add the define method to the task since I would need to change the production variable for the deploy task.  </p>
<pre class="ruby">&nbsp;
desc <span style="color:#996600;">'Compile and run the application for debugging'</span>
debug <span style="color:#ff3333; font-weight:bold;">:debug</span> <span style="color:#9966CC; font-weight:bold;">do</span> |d|
  d.<span style="color:#9900CC;">define</span> = <span style="color:#996600;">&quot;CONFIG::production,false -define=CONFIG::version,&quot;</span> + build_number
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
desc <span style="color:#996600;">'Compile and run the test harness'</span>
unit <span style="color:#ff3333; font-weight:bold;">:test</span> <span style="color:#9966CC; font-weight:bold;">do</span> |d|
  d.<span style="color:#9900CC;">define</span> = <span style="color:#996600;">&quot;CONFIG::production,false -define=CONFIG::version,&quot;</span> + build_number
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
desc <span style="color:#996600;">'Compile for deployment'</span>
deploy <span style="color:#ff3333; font-weight:bold;">:deploy</span>  <span style="color:#9966CC; font-weight:bold;">do</span> |p|
  <span style="color:#CC0066; font-weight:bold;">p</span>.<span style="color:#9900CC;">define</span> = <span style="color:#996600;">&quot;CONFIG::production,true -define=CONFIG::version,&quot;</span> + build_number
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;</pre>
<p>Did you notice how I'm passing multiple variables in the same line?  This is because the define method can't be called more then one time.  It doesn't look like this is by design and might be a little bug in the task.  Getting around this is easy enough.  You just need to append "-define=" for all other variables. </p>
<p>This next snippet is the ActionScript 3.0 code demonstrates how to access your variable. </p>
<pre class="actionscript">&nbsp;
package <span style="color: #66cc66;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">class</span> Constants <span style="color: #66cc66;">&#123;</span>
    <span style="color: #0066CC;">public</span> <span style="color: #0066CC;">static</span> const <span style="color: #0066CC;">VERSION</span>:<span style="color: #0066CC;">String</span>        = <span style="color: #0066CC;">String</span><span style="color: #66cc66;">&#40;</span>CONFIG::<span style="color: #0066CC;">version</span><span style="color: #66cc66;">&#41;</span>;
    <span style="color: #0066CC;">public</span> <span style="color: #0066CC;">static</span> const IS_PRODUCTION:<span style="color: #0066CC;">Boolean</span> = CONFIG::production;
  <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span>
&nbsp;</pre>
<p>Now that you have these lines of code in your project the next time you try to run AsDoc everything is going to melt down.  AsDoc is very finicky and doesn't like the CONFIG variable.  I was able to get around this by using a <a href="http://www.projectsprouts.org/rdoc.5/classes/Sprout/ToolTask.html#M000145">c preprocessor </a> to remove these lines before AsDoc executes.</p>
<p>Finally you'll want to have your <a href="http://en.wikipedia.org/wiki/Continuous_Integration">continuous integration system</a> insert the correct version number.  For example I have <a href="https://hudson.dev.java.net/">Hudson</a> use sed to insert the correct version number.</p>
<pre class="bash">&nbsp;
<span style="color: #c20cb9; font-weight: bold;">sed</span> -i <span style="color: #ff0000;">'s/dev.1.1.1.1001/{RELEASE_NUMBER}/'</span> rakefile.rb
&nbsp;</pre>
<p>And now you never have to manually update version numbers again!</p>
<p>If your using Flex to profile your application you will have to add these additional compiler arguments to the project properties.<br />
<a href="http://www.jonathanspooner.com/blog/wp-content/uploads/2009/04/picture-4.png"><img src="http://www.jonathanspooner.com/blog/wp-content/uploads/2009/04/picture-4-300x197.png" alt="" title="Flex Properties" width="300" height="197" class="alignleft size-medium wp-image-240" /></a></p>
<div class="clear"></div>
]]></content:encoded>
			<wfw:commentRss>http://www.jonathanspooner.com/web-development/automate-build-numbers-for-flash-applications/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
