<?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>The World In A State of Flex &#187; Development</title>
	<atom:link href="http://unitedmindset.com/jonbcampos/category/development/feed/" rel="self" type="application/rss+xml" />
	<link>http://unitedmindset.com/jonbcampos</link>
	<description>Jonathan Campos&#039;s Blog about Flex and the Flash Platform</description>
	<lastBuildDate>Thu, 29 Jul 2010 15:46:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Managing the Android Development Environment</title>
		<link>http://unitedmindset.com/jonbcampos/2010/07/21/managing-the-android-development-environment/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=managing-the-android-development-environment</link>
		<comments>http://unitedmindset.com/jonbcampos/2010/07/21/managing-the-android-development-environment/#comments</comments>
		<pubDate>Wed, 21 Jul 2010 14:10:29 +0000</pubDate>
		<dc:creator>Jonathan Campos</dc:creator>
				<category><![CDATA[Air for Android]]></category>
		<category><![CDATA[air for android]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[ANT]]></category>
		<category><![CDATA[apk]]></category>

		<guid isPermaLink="false">http://unitedmindset.com/jonbcampos/?p=1656</guid>
		<description><![CDATA[If you are starting with this post I recommend actually starting with a previous post introducing AIR for Android Development. There is a ANT file there that you will want to have. Once you have your project set up (Flash Professional or Flash Builder) and all the required downloads from the earlier post we still [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://unitedmindset.com/jonbcampos/wp-content/uploads/2010/07/airforandroid1.png"><img src="http://unitedmindset.com/jonbcampos/wp-content/uploads/2010/07/airforandroid1.png" alt="" title="AIR for Android Logo" width="228" height="200" class="alignleft size-full wp-image-1766" /></a><br />
If you are starting with this post I recommend actually starting with a previous post introducing <a href="http://unitedmindset.com/jonbcampos/2010/07/19/android-mobile-development/">AIR for Android Development</a>. There is a ANT file there that you will want to have.</p>
<p>Once you have your project set up (<a href="http://unitedmindset.com/jonbcampos/2010/07/20/creating-a-flash-professional-android-project/">Flash Professional</a> or <a href="http://unitedmindset.com/jonbcampos/2010/07/20/creating-a-flash-builder-android-project/">Flash Builder</a>) and all the <a href="http://unitedmindset.com/jonbcampos/2010/07/19/android-mobile-development/#required_downloads">required downloads from the earlier post</a> we still need to do some setup before we can start running the emulator and releasing to your Android device.</p>
<p>This is where that ANT file will really help your development. What we need to be able to do is startup the Android SDK and AVD Manager, download some packages, and set up some virtual devices. Only once this is done can we create emulators of different types and start installing.</p>
<p>Before going down the next steps make sure to set up your <em>build.properties</em>. Once you have all your paths set correctly we&#8217;ll be ready to move forward. What you don&#8217;t realize is you already have a working development environment, now let&#8217;s see how to use our environment. </p>
<blockquote><p>
Information on how to use the command line for all your commands is in the <a href="http://developer.android.com/guide/developing/tools/avd.html">Android Development Guide</a>. I&#8217;ve just made it a bit easier by providing a preconfigured ANT file.
</p></blockquote>
<p> <span id="more-1656"></span></p>
<p><strong>Starting up the Android SDK and AVD Manager</strong><br />
The next few steps all take place in the provided Android SDK and AVD Manager. To startup the manager is very simple, with ant execute the <em>start_up_manager</em> target.</p>
<div class="codecolorer-container text dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ ant -buildfile build.xml start_up_manager</div></td></tr></tbody></table></div>
<p>With this command properly called the java app should start right up and you should see this.<br />
<a href="http://unitedmindset.com/jonbcampos/wp-content/uploads/2010/07/Screen-shot-2010-07-20-at-3.23.04-PM.png"><img src="http://unitedmindset.com/jonbcampos/wp-content/uploads/2010/07/Screen-shot-2010-07-20-at-3.23.04-PM-300x174.png" alt="" title="Android SDK and AVD Manager" width="300" height="174" class="alignnone size-medium wp-image-1780" /></a></p>
<blockquote><p>
On the first startup you won&#8217;t have any listed virtual devices. We&#8217;ll need to add those in.
</p></blockquote>
<p><strong>Select and Download Packages</strong><br />
Before we can create a virtual device you need to go get some packages for your device to run on.<br />
<a href="http://unitedmindset.com/jonbcampos/wp-content/uploads/2010/07/Screen-shot-2010-07-20-at-3.30.26-PM.png"><img src="http://unitedmindset.com/jonbcampos/wp-content/uploads/2010/07/Screen-shot-2010-07-20-at-3.30.26-PM-300x175.png" alt="" title="Available Packages" width="300" height="175" class="alignnone size-medium wp-image-1782" /></a></p>
<p>Go to <em>Available Packages</em> and select the packages you want to download. Depending on the amount of packages you select you may be here a long time &#8211; I just did them all because I am crazy like that. I&#8217;d recommend getting a drink right about now.</p>
<p>Once all the packages you&#8217;ve selected are downloaded the waiting is over, we can get moving now.</p>
<p>My Installed Packages.<br />
<a href="http://unitedmindset.com/jonbcampos/wp-content/uploads/2010/07/Screen-shot-2010-07-20-at-3.33.05-PM.png"><img src="http://unitedmindset.com/jonbcampos/wp-content/uploads/2010/07/Screen-shot-2010-07-20-at-3.33.05-PM-300x175.png" alt="" title="Installed Packages" width="300" height="175" class="alignnone size-medium wp-image-1783" /></a></p>
<p>You can go through your finder/browser and see the downloaded packages in your <em>platforms</em> folder.<br />
<a href="http://unitedmindset.com/jonbcampos/wp-content/uploads/2010/07/Screen-shot-2010-07-20-at-3.35.31-PM.png"><img src="http://unitedmindset.com/jonbcampos/wp-content/uploads/2010/07/Screen-shot-2010-07-20-at-3.35.31-PM-300x104.png" alt="" title="Screen shot 2010-07-20 at 3.35.31 PM" width="300" height="104" class="alignnone size-medium wp-image-1784" /></a></p>
<p><strong>Setup Your Android Virtual Devices</strong><br />
With your packages downloaded we can now create our virtual devices on the <em>Virtual Devices</em> window.<br />
<a href="http://unitedmindset.com/jonbcampos/wp-content/uploads/2010/07/Screen-shot-2010-07-20-at-3.23.04-PM.png"><img src="http://unitedmindset.com/jonbcampos/wp-content/uploads/2010/07/Screen-shot-2010-07-20-at-3.23.04-PM-300x174.png" alt="" title="Android SDK and AVD Manager" width="300" height="174" class="alignnone size-medium wp-image-1780" /></a></p>
<p>Now you can go to <em>New&#8230;</em> and create a new Virtual Device.<br />
<a href="http://unitedmindset.com/jonbcampos/wp-content/uploads/2010/07/Screen-shot-2010-07-20-at-4.01.49-PM.png"><img src="http://unitedmindset.com/jonbcampos/wp-content/uploads/2010/07/Screen-shot-2010-07-20-at-4.01.49-PM-214x300.png" alt="" title="New AVD" width="214" height="300" class="alignnone size-medium wp-image-1788" /></a></p>
<p>Select your target platform.<br />
<a href="http://unitedmindset.com/jonbcampos/wp-content/uploads/2010/07/Screen-shot-2010-07-20-at-4.01.37-PM.png"><img src="http://unitedmindset.com/jonbcampos/wp-content/uploads/2010/07/Screen-shot-2010-07-20-at-4.01.37-PM-214x300.png" alt="" title="New AVD Platforms" width="214" height="300" class="alignnone size-medium wp-image-1789" /></a></p>
<p>The final thing that you need to do is to add abilities to your new virtual device by adding hardware specifications.<br />
<a href="http://unitedmindset.com/jonbcampos/wp-content/uploads/2010/07/Screen-shot-2010-07-20-at-4.06.03-PM.png"><img src="http://unitedmindset.com/jonbcampos/wp-content/uploads/2010/07/Screen-shot-2010-07-20-at-4.06.03-PM-300x110.png" alt="" title="New Hardware" width="300" height="110" class="alignnone size-medium wp-image-1790" /></a><br />
<a href="http://unitedmindset.com/jonbcampos/wp-content/uploads/2010/07/Screen-shot-2010-07-20-at-4.05.53-PM.png"><img src="http://unitedmindset.com/jonbcampos/wp-content/uploads/2010/07/Screen-shot-2010-07-20-at-4.05.53-PM-300x247.png" alt="" title="Hardware specifications" width="300" height="247" class="alignnone size-medium wp-image-1794" /></a></p>
<p>Once you have your virtual device set up we can run it as an emulator. You can set up as many of these as you like so don&#8217;t hold back.</p>
<blockquote><p>
With your platforms downloaded you can also set up your AVDs through the ANT file by calling the following command.</p>
<div class="codecolorer-container text dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ ant -buildfile build.xml create_virtual_device</div></td></tr></tbody></table></div>
</blockquote>
<p><strong>Startup the Emulator</strong><br />
Once you have some virtual devices set up you can just click on <em>Start&#8230;</em> and startup the emulator, ready for installing and testing.</p>
<blockquote><p>
You can also do this through the ANT file by calling the following command.</p>
<div class="codecolorer-container text dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ ant -buildfile build.xml start_emulator</div></td></tr></tbody></table></div>
</blockquote>
<p><strong>Install the AIR Runtime on the Emulator or Android Device</strong><br />
These next parts require going either through the ANT file or command line. For the ANT file installing the AIR Runtime on the emulator is extremely simple. With your Emulator started up just call the following ant command.</p>
<div class="codecolorer-container text dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ ant -buildfile build.xml install_air_on_emulator</div></td></tr></tbody></table></div>
<p>And for an Android Device just call:</p>
<div class="codecolorer-container text dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ ant -buildfile build.xml install_air_on_device</div></td></tr></tbody></table></div>
<blockquote><p>
The provided scripts expects that there will only be one emulator and/or one device connected at a time.
</p></blockquote>
<p><strong>Install your Application on the Emulator or Android Device</strong><br />
Installing an Application on the emulator or Android Device is extremely simple &#8211; just as simple as installing the Runtime. With your Emulator started up just call the following ant command.</p>
<div class="codecolorer-container text dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ ant -buildfile build.xml test_on_emulator</div></td></tr></tbody></table></div>
<p>And for an Android Device just call:</p>
<div class="codecolorer-container text dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ ant -buildfile build.xml test_on_device</div></td></tr></tbody></table></div>
<blockquote><p>
The provided scripts expects that there will only be one emulator and/or one device connected at a time. The ANT script currently recompiles and builds the application and then deploys it to the target device.
</p></blockquote>
<p><strong>DONE!</strong><br />
Once you have done all of this you will have a working development environment up and going. Good luck in your Adventures with Android.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://unitedmindset.com/jonbcampos/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://unitedmindset.com/jonbcampos/2010/07/21/managing-the-android-development-environment/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Creating a Flash Builder Android Project</title>
		<link>http://unitedmindset.com/jonbcampos/2010/07/20/creating-a-flash-builder-android-project/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=creating-a-flash-builder-android-project</link>
		<comments>http://unitedmindset.com/jonbcampos/2010/07/20/creating-a-flash-builder-android-project/#comments</comments>
		<pubDate>Tue, 20 Jul 2010 15:00:06 +0000</pubDate>
		<dc:creator>Jonathan Campos</dc:creator>
				<category><![CDATA[Air for Android]]></category>
		<category><![CDATA[air for android]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[apk]]></category>
		<category><![CDATA[flash builder]]></category>

		<guid isPermaLink="false">http://unitedmindset.com/jonbcampos/?p=1680</guid>
		<description><![CDATA[This post and it&#8217;s brother Creating a Flash Professional Android Project are going to be really short and sweet. I just want to make sure that there are no places for questions. If you are starting with this post I recommend actually starting with a previous post introducing AIR for Android Development. There is a [...]]]></description>
			<content:encoded><![CDATA[<p>This post and it&#8217;s brother <a href="http://unitedmindset.com/jonbcampos/2010/07/20/creating-a-flash-professional-android-project/">Creating a Flash Professional Android Project</a> are going to be really short and sweet. I just want to make sure that there are no places for questions.</p>
<p>If you are starting with this post I recommend actually starting with a previous post introducing <a href="http://unitedmindset.com/jonbcampos/2010/07/19/android-mobile-development/">AIR for Android Development</a>. There is a ANT file there that you will want to have.</p>
<p><a href="http://unitedmindset.com/jonbcampos/wp-content/uploads/2010/07/Screen-shot-2010-07-20-at-8.22.28-AM.png"><img src="http://unitedmindset.com/jonbcampos/wp-content/uploads/2010/07/Screen-shot-2010-07-20-at-8.22.28-AM-300x174.png" alt="" title="Flash Builder Opening Screen" width="300" height="174" class="alignnone size-medium wp-image-1740" /></a></p>
<blockquote><p>
FYI: All these steps are also available in <em>Developing AIR Apps for Android PDF</em> provided by Adobe.
</p></blockquote>
<p><span id="more-1680"></span><br />
Unlike Flash Professional we won&#8217;t be able to create an .apk file from our IDE. <a href="http://renaun.com/blog/2010/06/debug-air-apps-on-android-with-flash-builder-4/">We can debug from the Flash Builder IDE, as shown by Renaun</a>. That being said, that is where my ANT build file is even more helpful as it can package your application into a .apk file quickly for you.</p>
<p>Let&#8217;s set up this project.</p>
<p><strong>Step 1: Startup</strong><br />
Create a new Flash Builder Project. File > New > Flex Project.</p>
<p><strong>Step 2: Project Settings</strong><br />
<a href="http://unitedmindset.com/jonbcampos/wp-content/uploads/2010/07/Screen-shot-2010-07-20-at-8.31.10-AM.png"><img src="http://unitedmindset.com/jonbcampos/wp-content/uploads/2010/07/Screen-shot-2010-07-20-at-8.31.10-AM-233x300.png" alt="" title="New Flash Builder Project Window" width="233" height="300" class="alignnone size-medium wp-image-1741" /></a></p>
<p>Make sure the application type is Adobe AIR and that you are using the SDK that you created with the AIR 2.5 SDK.</p>
<p>Then click next twice or until you get to this screen.<br />
<a href="http://unitedmindset.com/jonbcampos/wp-content/uploads/2010/07/Screen-shot-2010-07-20-at-8.34.03-AM.png"><img src="http://unitedmindset.com/jonbcampos/wp-content/uploads/2010/07/Screen-shot-2010-07-20-at-8.34.03-AM-199x300.png" alt="" title="Flash Builder New Project Options" width="199" height="300" class="alignnone size-medium wp-image-1742" /></a> </p>
<p>Change your main application file to &#8220;[Your Application Name].as&#8221;. By default it will try to create an MXML file, but as we are trying to make an AS3 project we need to change the file extension to being &#8220;.as&#8221;.</p>
<p>It&#8217;s also good practice to change your application ID to be something a bit more unique &#8211; I always just add in reverse domain extension to it.</p>
<p>Click Finish</p>
<p><strong>Step 3: Program</strong><br />
You should now have an application that looks like this:</p>
<div class="codecolorer-container actionscript dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br /></div></td><td><div class="actionscript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">package<br />
<span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #006600;">Sprite</span>;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> HelloWorld <span style="color: #0066CC;">extends</span> Sprite<br />
&nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> HelloWorld<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
<span style="color: #66cc66;">&#125;</span></div></td></tr></tbody></table></div>
<p>You can keep programming your application to whatever you want. As I just want a quick application that shows Hello World so that we can continue, my application is going to be very simple.</p>
<p>My Application:</p>
<div class="codecolorer-container actionscript dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br /></div></td><td><div class="actionscript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">package<br />
<span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #006600;">Sprite</span>;<br />
&nbsp; &nbsp; <span style="color: #0066CC;">import</span> flash.<span style="color: #0066CC;">text</span>.<span style="color: #0066CC;">TextField</span>;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> HelloWorld <span style="color: #0066CC;">extends</span> Sprite<br />
&nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> HelloWorld<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">textField</span>:<span style="color: #0066CC;">TextField</span> = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">TextField</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">textField</span>.<span style="color: #0066CC;">text</span> = <span style="color: #ff0000;">&quot;Hello World&quot;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">stage</span>.<span style="color: #006600;">addChild</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">textField</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
<span style="color: #66cc66;">&#125;</span></div></td></tr></tbody></table></div>
<p><strong>Step 4: Setup your descriptor file</strong><br />
First thing you should do is make sure that your application descriptor namespace includes &#8220;2.5&#8243;:</p>
<div class="codecolorer-container text dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;application xmlns=&quot;http://ns.adobe.com/air/application/2.5&quot;&gt;</div></td></tr></tbody></table></div>
<p>If you are using the right SDK, this shouldn&#8217;t be an issue.</p>
<p>We only need to change a few attributes in the application descriptor file to get things going. Any other changes that we need to make will be more specific for your application.</p>
<p>In the &#8220;initialWindow&#8221; tag find &#8220;visible&#8221;. Make sure it is set to <em>true</em>.</p>
<p>Now find &#8220;supportedProfiles&#8221;, set this to <em>mobileDevice</em>.</p>
<p>Now go to the &#8220;content&#8221; tag and change it to &#8220;[Your Application Name].swf&#8221;. Flash Builder typically switches this name out for us, and I could do it in my ANT file. But I can be lazy at times and would prefer just to set this value. Especially since this application descriptor belongs to the one specific application.</p>
<p><strong>Step 5: Package your application</strong><br />
Your application is now ready to be changed to a .apk file for release. This is also when I will diverge from the Adobe PDF. See, I don&#8217;t like command line. So I created <a href="http://unitedmindset.com/jonbcampos/2010/07/19/android-mobile-development/">that nifty little ANT file to do everything I need</a>. Now go get that ANT file and add it into your project and make any changes necessary to the build.properties as described previously in the last post.</p>
<p>With the settings changed to your specific computer we are good to go. You can either run an ANT file from command line or from your IDE.</p>
<p>From the IDE:<br />
<a href="http://unitedmindset.com/jonbcampos/wp-content/uploads/2010/07/Screen-shot-2010-07-20-at-8.54.18-AM.png"><img src="http://unitedmindset.com/jonbcampos/wp-content/uploads/2010/07/Screen-shot-2010-07-20-at-8.54.18-AM-300x170.png" alt="" title="ANT from IDE" width="300" height="170" class="alignnone size-medium wp-image-1744" /></a><br />
Here I right-clicked on the build folder and went to Run As.</p>
<p>Or from your command line you can run the ant file. Just &#8220;change directory&#8221; to your project holding the build.xml. Here you can type in one of two commands.</p>
<div class="codecolorer-container text dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">[Hello World Directory] $ ant</div></td></tr></tbody></table></div>
<div class="codecolorer-container text dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">[Hello World Directory] $ ant -buildfile build.xml build</div></td></tr></tbody></table></div>
<blockquote><p>
Both mean the same thing as the <strong>build</strong> target is the default target in ANT and the <strong>build.xml</strong> is the default file. If you wanted to run a different target you could.</p>
<p>To run <strong>get_devices</strong></p>
<div class="codecolorer-container text dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">[Hello World Directory] $ ant -buildfile build.xml get_devices</div></td></tr></tbody></table></div>
<p>To run <strong>start_up_manager</strong></p>
<div class="codecolorer-container text dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">[Hello World Directory] $ ant -buildfile build.xml start_up_manager</div></td></tr></tbody></table></div>
</blockquote>
<p>After you run the <em>build</em> target you are good to go. The ANT file will spit out your .apk file in a <em>release</em> folder. That&#8217;s it, you are ready to get away from the Actionscript and into the Android release process.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://unitedmindset.com/jonbcampos/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://unitedmindset.com/jonbcampos/2010/07/20/creating-a-flash-builder-android-project/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Creating a Flash Professional Android Project</title>
		<link>http://unitedmindset.com/jonbcampos/2010/07/20/creating-a-flash-professional-android-project/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=creating-a-flash-professional-android-project</link>
		<comments>http://unitedmindset.com/jonbcampos/2010/07/20/creating-a-flash-professional-android-project/#comments</comments>
		<pubDate>Tue, 20 Jul 2010 15:00:04 +0000</pubDate>
		<dc:creator>Jonathan Campos</dc:creator>
				<category><![CDATA[Air for Android]]></category>
		<category><![CDATA[air for android]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[apk]]></category>
		<category><![CDATA[cs5]]></category>
		<category><![CDATA[flash professional]]></category>

		<guid isPermaLink="false">http://unitedmindset.com/jonbcampos/?p=1684</guid>
		<description><![CDATA[This post and it&#8217;s brother Creating a Flash Builder Android Project are going to be really short and sweet. I just want to make sure that there are no places for questions. If you are starting with this post I recommend actually starting with a previous post introducing AIR for Android Development. There is a [...]]]></description>
			<content:encoded><![CDATA[<p>This post and it&#8217;s brother <a href="http://unitedmindset.com/jonbcampos/2010/07/20/creating-a-flash-builder-android-project/">Creating a Flash Builder Android Project</a> are going to be really short and sweet. I just want to make sure that there are no places for questions.</p>
<p>If you are starting with this post I recommend actually starting with a previous post introducing <a href="http://unitedmindset.com/jonbcampos/2010/07/19/android-mobile-development/">AIR for Android Development</a>. There is a ANT file there that you will want to have.</p>
<p><img src="http://unitedmindset.com/jonbcampos/wp-content/uploads/2010/07/Screen-shot-2010-07-19-at-4.09.36-PM-300x143.png" alt="" title="Flash CS5 Intro Screen" width="300" height="143" class="alignnone size-medium wp-image-1721" /></p>
<blockquote><p>
FYI: All these steps are also available in <em>Developing AIR Apps for Android PDF</em> provided by Adobe.
</p></blockquote>
<p><span id="more-1684"></span><br />
<strong>Step 1: Add Extension</strong><br />
Go to <em>Help > Manage Extensions&#8230;</em> and install the AIR for Android Extension for Flash CS5. (Yes, CS5 is required).<br />
<a href="http://unitedmindset.com/jonbcampos/wp-content/uploads/2010/07/Screen-shot-2010-07-19-at-4.14.06-PM.png"><img src="http://unitedmindset.com/jonbcampos/wp-content/uploads/2010/07/Screen-shot-2010-07-19-at-4.14.06-PM-300x200.png" alt="" title="Manage Extensions CS5" width="300" height="200" class="alignnone size-medium wp-image-1725" /></a></p>
<p><strong>Step 2: Restart</strong><br />
Restart Flash CS5</p>
<p><strong>Step 3: Create Project</strong><br />
Create a new AIR for Android project.<br />
<a href="http://unitedmindset.com/jonbcampos/wp-content/uploads/2010/07/Screen-shot-2010-07-19-at-4.18.46-PM.png"><img src="http://unitedmindset.com/jonbcampos/wp-content/uploads/2010/07/Screen-shot-2010-07-19-at-4.18.46-PM-300x183.png" alt="" title="AIR for Android Template" width="300" height="183" class="alignnone size-medium wp-image-1724" /></a></p>
<p><strong>Step 4: Save</strong><br />
Save the the document.</p>
<p><strong>Step 5: Write your App</strong><br />
Do whatever you want. Here I&#8217;m going to add text that says &#8220;Hello World&#8221;. <img src='http://unitedmindset.com/jonbcampos/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
<a href="http://unitedmindset.com/jonbcampos/wp-content/uploads/2010/07/Screen-shot-2010-07-19-at-4.24.46-PM.png"><img src="http://unitedmindset.com/jonbcampos/wp-content/uploads/2010/07/Screen-shot-2010-07-19-at-4.24.46-PM-300x150.png" alt="" title="Hello World Text" width="300" height="150" class="alignnone size-medium wp-image-1728" /></a></p>
<p><strong>Step 6: AIR for Android Settings</strong><br />
Now we do the Android specific steps. Go to File > AIR for Android Settings.</p>
<p><a href="http://unitedmindset.com/jonbcampos/wp-content/uploads/2010/07/Screen-shot-2010-07-19-at-4.27.42-PM.png"><img src="http://unitedmindset.com/jonbcampos/wp-content/uploads/2010/07/Screen-shot-2010-07-19-at-4.27.42-PM-216x300.png" alt="" title="Hello World AIR for Android Settings" width="216" height="300" class="alignnone size-medium wp-image-1729" /></a></p>
<p>With the settings:<br />
Output File: Hello.apk<br />
App name: Hello<br />
App ID: Hello<br />
Aspect ratio: Portrait</p>
<p><strong>Step 7: Set up the Deployment&#8230;</strong><br />
<a href="http://unitedmindset.com/jonbcampos/wp-content/uploads/2010/07/Screen-shot-2010-07-19-at-4.32.15-PM.png"><img src="http://unitedmindset.com/jonbcampos/wp-content/uploads/2010/07/Screen-shot-2010-07-19-at-4.32.15-PM-216x300.png" alt="" title="AIR for Android Deployment tab" width="216" height="300" class="alignnone size-medium wp-image-1730" /></a></p>
<p>On the Deployment tab, make the following settings:</p>
<ul>
<li>Certificate: Point to a valid AIR code-signing certificate. You can click the Create button to create a new certificate. (Android apps deployed via the Android Marketplace must have certificates that are valid for 25 years.) Enter the certificate password in the Password field.</li>
<li>Android deployment type: Release</li>
<li>After Publish: Select both options</li>
<li>Enter the path to the ADB tool in the tools subdirectory of the Android SDK.</li>
<li>Close the Android settings dialog by clicking OK.</li>
</ul>
<p><strong>Step 8: Update the AIR Descriptor file.</strong></p>
<ul>
<li>Open the application descriptor (located in the directory where you saved the .fla file).</li>
<li>Change the <version> tag to <versionNumber> and make sure that it contains a value of the form: number.number.number<br />
For example: <versionNumber>0.1.0</versionNumber></li>
<li>Save the file.</li>
</ul>
<p><strong>Step 9: Publish</strong><br />
Now just go to File > Publish and you can export your .apk file. We&#8217;ll still need to install the runtime and the application on the emulator and/or device, but for now we have our .apk file ready to be installed.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://unitedmindset.com/jonbcampos/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://unitedmindset.com/jonbcampos/2010/07/20/creating-a-flash-professional-android-project/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Android Mobile Development</title>
		<link>http://unitedmindset.com/jonbcampos/2010/07/19/android-mobile-development/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=android-mobile-development</link>
		<comments>http://unitedmindset.com/jonbcampos/2010/07/19/android-mobile-development/#comments</comments>
		<pubDate>Mon, 19 Jul 2010 15:00:33 +0000</pubDate>
		<dc:creator>Jonathan Campos</dc:creator>
				<category><![CDATA[Air for Android]]></category>
		<category><![CDATA[air for android]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[ANT]]></category>
		<category><![CDATA[continuous integration]]></category>

		<guid isPermaLink="false">http://unitedmindset.com/jonbcampos/?p=1644</guid>
		<description><![CDATA[I am starting to write this post as I wait for a bunch of new packages to download and install from the Android SDK and AVD Manager. I&#8217;ll let you know now that so far I&#8217;ve really liked working on the Android Development Platform &#8211; especially with Air. The tricky part isn&#8217;t writing the application. [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://unitedmindset.com/jonbcampos/wp-content/uploads/2010/07/airforandroid.png" alt="" title="airforandroid" width="228" height="200" class="alignleft size-full wp-image-1673" />I am starting to write this post as I wait for a bunch of new packages to download and install from the Android SDK and AVD Manager. I&#8217;ll let you know now that so far I&#8217;ve really liked working on the Android Development Platform &#8211; especially with Air.</p>
<p>The tricky part isn&#8217;t writing the application. That part is easy and we know that part. The tricky part is building the .apk package and testing the application on an emulator or other valid device.</p>
<p><strong>So that is what I am going to write about, the tricky parts.</strong></p>
<ul>
<li>- <a href="http://unitedmindset.com/jonbcampos/2010/07/21/managing-the-android-development-environment/">Managing the Android Development Environment</a></li>
<li>- <a href="http://unitedmindset.com/jonbcampos/2010/07/20/creating-a-flash-professional-android-project/">Building the Hello World Application in Flash Professional</a></li>
<li>- <a href="http://unitedmindset.com/jonbcampos/2010/07/20/creating-a-flash-builder-android-project/">Building the Hello World Application in Flash Builder</a></li>
</ul>
<p>Once you read through these posts you&#8217;ll have an up and going <em>Air for Android</em> development environment and an initial application to kick you off.<br />
<span id="more-1644"></span><br />
<strong>Starting these posts off I will add a few disclosers:</strong></p>
<ol>
<li>1. I am not a fan of command line.</li>
<li>2. I am not a fan of messing with the paths in my computer.</li>
</ol>
<p><strong>I am not a fan of command line</strong><br />
I just don&#8217;t like memorizing a ton of commands or having to go back and reference a ton of commands and paths. One small path issue and BAM nothing works and you have to read through a ton of mixed code to see where your problem is. Not fun.</p>
<p><strong>I am not a fan of messing with the paths in my computer</strong><br />
Seems like every programming language I get into requires a bunch of path changes and if I move computers now nothing works till I set it up. Not fun. I also fear screwing up my computer.</p>
<blockquote><p>
In case you like setting up paths or want to know how there is a guide provided by Adobe called <em>Developing AIR Apps for Android</em> in the prerelease site. That PDF includes a section <em>Setting the path environment variable</em>. Follow that guide.
</p></blockquote>
<p><strong>Solution</strong><br />
I like using ANT. I can set up all my paths in ANT and ANT works directly into your continuous integration environment. So if I move computers I can just set up my properties I&#8217;ll be good to go. Finally the amount of commands to memorize goes WAY down or you can just look into the ANT build file and see the available possible commands.</p>
<p>Want to know what else is pretty slick? I&#8217;ve set up the ANT file for you. I&#8217;m thinking of making a nice GUI in AIR to help you out, but for now an ANT file will have to help.</p>
<p><strong><a name="required_downloads">Getting Started</a></strong><br />
The things you&#8217;ll need to get started with Air for Android.</p>
<ol>
<li>- <a href="http://developer.android.com/sdk/index.html">Download the Android SDK</a></li>
<li>- <a href="http://labs.adobe.com/technologies/air2/android/">Sign up for the Air for Android Prerelease program</a></li>
<li>- Download Air 2.5 from the prerelease site (if you don&#8217;t already have access to the prerelease site, you&#8217;ll have to wait for your email after you sign up for it)</li>
<li>- Download the prerelease Runtimes (emulator and device)</li>
<li>- <a href="http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4">Download the Flex 4 SDK</a></li>
<li>- Combine the Flex 4 SDK with the Air 2.5 SDK</li>
</ol>
<p><strong>Creating a Project</strong><br />
AIR for Android currently works best with either a Pure AS3 project (no Flex) in either Flash Builder or Flash Professional. If you are building with Flash Professional, there is an extension that Adobe has provided for you to help speed up the .apk build process. If you go through Flash Builder you&#8217;ll have to make this file. Again, with the ANT file I am providing either is a very simple path, so choose the development environment that you prefer.</p>
<ul>
<li>- <a href="http://unitedmindset.com/jonbcampos/2010/07/20/creating-a-flash-builder-android-project/">Creating a Flash Builder Project</a></li>
<li>-<a href="http://unitedmindset.com/jonbcampos/2010/07/20/creating-a-flash-professional-android-project/"> Creating a Flash Professional Project</a></li>
</ul>
<p><strong>Setting Up Your ANT File</strong><br />
<img src="http://unitedmindset.com/jonbcampos/wp-content/uploads/2010/07/Screen-shot-2010-07-18-at-10.26.45-PM.png" alt="" title="Screen shot 2010-07-18 at 10.26.45 PM" width="244" height="279" class="alignleft size-full wp-image-1693" />Once you have your projected set up you will be ready to add in the ANT build information. The ANT file that I will use for the rest of these posts is really easy to set up, just drop it (and base.properties) into your application in the root level.</p>
<p>This ANT file provides you the ability to install the device and emulator runtimes, install your application and test it on a device or runtime, set up a device, run the emulator and even run the Android Management device. Again, yes you can do all these things in the command line&#8230; but do you want to?</p>
<p>Then you need to create a build.properties text file. This is the file that you will put your own environment&#8217;s paths. So if you share this build file, everyone can have their own properties and the main build.xml is the same and unchanged.</p>
<p><strong>build.properties</strong></p>
<div class="codecolorer-container text dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"># Flex SDK File Location on your computer<br />
FLEX_HOME=/Applications/Adobe\ Flash\ Builder\ 4/sdks/android_flex_sdk_4.1.0.16076<br />
<br />
#Android SDK Folder on your computer<br />
ANDROID_SDK=${FLEX_HOME}/android/android-sdk-mac_86<br />
<br />
#Emulator zip files on your computer<br />
EMULATOR_RUNTIME_ZIP=${FLEX_HOME}/android/Runtime_Emulator_Froyo_20100705.apk.zip<br />
DEVICE_RUNTIME_ZIP=${FLEX_HOME}/android/Runtime_Device_Froyo_20100705.apk.zip<br />
<br />
#App Settings<br />
APP_NAME=AndroidTest<br />
<br />
#cert<br />
CERT_NAME=SelfSignedCertificate<br />
CERT_ORG_UNIT=Software Development<br />
CERT_ORG_NAME=YourOrgName<br />
CERT_PASSWORD=YourPassword</div></td></tr></tbody></table></div>
<p>You&#8217;ll probably notice that I put my Android SDK in the same folder as my Flex SDK. This isn&#8217;t necessary, I just thought it&#8217;d be nice that all the information for my development environment would be in one location.</p>
<p>In upcoming posts we&#8217;ll go through how to use the ANT file and manage your development environment.</p>
<p>Good luck in your Adventures with Android.</p>
<p><strong>Don&#8217;t miss this, this is the link for the ant files!</strong><br />
<a href='http://unitedmindset.com/jonbcampos/wp-content/uploads/2010/07/build.zip'><img src="http://unitedmindset.com/jonbcampos/wp-content/uploads/2010/07/Download-icon-150x150.png" alt="" title="ANT - Air for Android Build Files" width="100" height="100" class="alignnone size-thumbnail wp-image-1715" /></a></p>
<blockquote><p>
From here checkout how to <a href="http://unitedmindset.com/jonbcampos/2010/07/21/managing-the-android-development-environment/">manage your Android SDK environment</a>, <a href="http://unitedmindset.com/jonbcampos/2010/07/20/creating-a-flash-builder-android-project/">how to create a Flash Builder Android Project</a>, or <a href="http://unitedmindset.com/jonbcampos/2010/07/20/creating-a-flash-professional-android-project/">how to create a Flash Professional Android Project</a>.
</p></blockquote>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://unitedmindset.com/jonbcampos/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://unitedmindset.com/jonbcampos/2010/07/19/android-mobile-development/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Building an AIR Application with ANT</title>
		<link>http://unitedmindset.com/jonbcampos/2010/06/22/building-an-air-application-with-ant/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=building-an-air-application-with-ant</link>
		<comments>http://unitedmindset.com/jonbcampos/2010/06/22/building-an-air-application-with-ant/#comments</comments>
		<pubDate>Tue, 22 Jun 2010 14:00:04 +0000</pubDate>
		<dc:creator>Jonathan Campos</dc:creator>
				<category><![CDATA[Continuous Integration]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[air]]></category>
		<category><![CDATA[ANT]]></category>
		<category><![CDATA[ci]]></category>

		<guid isPermaLink="false">http://unitedmindset.com/jonbcampos/?p=1429</guid>
		<description><![CDATA[Building on my previous Continuous Integration series I felt there were a few more points that I needed to cover to help those others that may be running into some roadblocks with their Continuous Integration scripts. Let&#8217;s get into have to build and package an AIR application using ANT. Unlike building a web application you [...]]]></description>
			<content:encoded><![CDATA[<p>Building on my previous <a href="http://unitedmindset.com/jonbcampos/2010/02/09/the-master-flex-ant-file/">Continuous Integration series</a> I felt there were a few more points that I needed to cover to help those others that may be running into some roadblocks with their Continuous Integration scripts.</p>
<p>Let&#8217;s get into have to build and package an AIR application using ANT. Unlike building a web application you need more than just a SWF file to deploy your application. You will need to actually build the SWF file and then package that SWF file into an ANT file.</p>
<p>The Three (not so easy) Steps:<br />
1. Build a SWF File<br />
2. Make a Certificate<br />
3. Package your SWF with your Certificate<br />
<span id="more-1429"></span><br />
<strong>Starting Out</strong><br />
I&#8217;ve created a simple AIR Project called &#8220;AIRCI&#8221;.<br />
<img src="http://unitedmindset.com/jonbcampos/wp-content/uploads/2010/06/Screen-shot-2010-06-10-at-10.15.38-AM.png" alt="AIRCI Project Package Explorer" title="AIRCI Project Package Explorer" width="195" height="182" class="alignnone size-full wp-image-1566" /></p>
<p>Right now the AIRCI.mxml file is super super simple.</p>
<div class="codecolorer-container actionscript dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br /></div></td><td><div class="actionscript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #66cc66;">&lt;</span>?<span style="color: #0066CC;">xml</span> <span style="color: #0066CC;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #66cc66;">&gt;</span><br />
<span style="color: #66cc66;">&lt;</span>s:WindowedApplication xmlns:fx=<span style="color: #ff0000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;xmlns:s=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/spark&quot;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;xmlns:mx=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/mx&quot;</span><span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&lt;</span>fx:Declarations<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&lt;!</span>-- Place non-visual elements <span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>.<span style="color: #006600;">g</span>., services, value objects<span style="color: #66cc66;">&#41;</span> here --<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&lt;/</span>fx:Declarations<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&lt;</span>s:layout<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&lt;</span>s:VerticalLayout gap=<span style="color: #ff0000;">&quot;20&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; paddingBottom=<span style="color: #ff0000;">&quot;20&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; paddingLeft=<span style="color: #ff0000;">&quot;20&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; paddingRight=<span style="color: #ff0000;">&quot;20&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; paddingTop=<span style="color: #ff0000;">&quot;20&quot;</span><span style="color: #66cc66;">/&gt;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&lt;/</span>s:layout<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&lt;</span>s:Rect <span style="color: #0066CC;">width</span>=<span style="color: #ff0000;">&quot;100%&quot;</span> <span style="color: #0066CC;">height</span>=<span style="color: #ff0000;">&quot;100%&quot;</span><span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&lt;</span>s:fill<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&lt;</span>s:SolidColor <span style="color: #0066CC;">color</span>=<span style="color: #ff0000;">&quot;0xFF0000&quot;</span><span style="color: #66cc66;">/&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&lt;/</span>s:fill<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&lt;/</span>s:Rect<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&lt;</span>s:Rect <span style="color: #0066CC;">width</span>=<span style="color: #ff0000;">&quot;100%&quot;</span> <span style="color: #0066CC;">height</span>=<span style="color: #ff0000;">&quot;100%&quot;</span><span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&lt;</span>s:fill<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&lt;</span>s:SolidColor <span style="color: #0066CC;">color</span>=<span style="color: #ff0000;">&quot;0x00FF00&quot;</span><span style="color: #66cc66;">/&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&lt;/</span>s:fill<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&lt;/</span>s:Rect<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&lt;</span>s:Rect <span style="color: #0066CC;">width</span>=<span style="color: #ff0000;">&quot;100%&quot;</span> <span style="color: #0066CC;">height</span>=<span style="color: #ff0000;">&quot;100%&quot;</span><span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&lt;</span>s:fill<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&lt;</span>s:SolidColor <span style="color: #0066CC;">color</span>=<span style="color: #ff0000;">&quot;0x0000FF&quot;</span><span style="color: #66cc66;">/&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&lt;/</span>s:fill<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&lt;/</span>s:Rect<span style="color: #66cc66;">&gt;</span><br />
<span style="color: #66cc66;">&lt;/</span>s:WindowedApplication<span style="color: #66cc66;">&gt;</span></div></td></tr></tbody></table></div>
<p>And the app descriptor file that Flash Builder generated.</p>
<div class="codecolorer-container actionscript dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br />51<br />52<br />53<br />54<br />55<br />56<br />57<br />58<br />59<br />60<br />61<br />62<br />63<br />64<br />65<br />66<br />67<br />68<br />69<br />70<br />71<br />72<br />73<br />74<br />75<br />76<br />77<br />78<br />79<br />80<br />81<br />82<br />83<br />84<br />85<br />86<br />87<br />88<br />89<br />90<br />91<br />92<br />93<br />94<br />95<br />96<br />97<br />98<br />99<br />100<br />101<br />102<br />103<br />104<br />105<br />106<br />107<br />108<br />109<br />110<br />111<br />112<br />113<br />114<br />115<br />116<br />117<br />118<br />119<br />120<br />121<br />122<br />123<br />124<br />125<br />126<br />127<br />128<br />129<br />130<br />131<br />132<br />133<br />134<br />135<br />136<br />137<br />138<br /></div></td><td><div class="actionscript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #66cc66;">&lt;</span>?<span style="color: #0066CC;">xml</span> <span style="color: #0066CC;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span> standalone=<span style="color: #ff0000;">&quot;no&quot;</span>?<span style="color: #66cc66;">&gt;</span><br />
<span style="color: #66cc66;">&lt;</span>application xmlns=<span style="color: #ff0000;">&quot;http://ns.adobe.com/air/application/1.5.3&quot;</span><span style="color: #66cc66;">&gt;</span><br />
<br />
<span style="color: #66cc66;">&lt;!</span>-- Adobe AIR Application Descriptor File Template.<br />
<br />
&nbsp; &nbsp; <span style="color: #006600;">Specifies</span> parameters <span style="color: #b1b100;">for</span> identifying, installing, <span style="color: #0066CC;">and</span> launching AIR applications.<br />
<br />
&nbsp; &nbsp; <span style="color: #006600;">xmlns</span> - The Adobe AIR namespace: http:<span style="color: #808080; font-style: italic;">//ns.adobe.com/air/application/1.5.3</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; The last segment of the namespace specifies the <span style="color: #0066CC;">version</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; of the AIR runtime required <span style="color: #b1b100;">for</span> <span style="color: #0066CC;">this</span> application to run.<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #006600;">minimumPatchLevel</span> - The minimum patch <span style="color: #0066CC;">level</span> of the AIR runtime required to run <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; the application. <span style="color: #006600;">Optional</span>.<br />
--<span style="color: #66cc66;">&gt;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #66cc66;">&lt;!</span>-- The application identifier <span style="color: #0066CC;">string</span>, unique to <span style="color: #0066CC;">this</span> application. <span style="color: #006600;">Required</span>. --<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&lt;</span>id<span style="color: #66cc66;">&gt;</span>AIRCI<span style="color: #66cc66;">&lt;/</span>id<span style="color: #66cc66;">&gt;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #66cc66;">&lt;!</span>-- Used as the filename <span style="color: #b1b100;">for</span> the application. <span style="color: #006600;">Required</span>. --<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&lt;</span>filename<span style="color: #66cc66;">&gt;</span>AIRCI<span style="color: #66cc66;">&lt;/</span>filename<span style="color: #66cc66;">&gt;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #66cc66;">&lt;!</span>-- The <span style="color: #0066CC;">name</span> that is displayed <span style="color: #b1b100;">in</span> the AIR application installer. <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #006600;">May</span> have multiple values <span style="color: #b1b100;">for</span> <span style="color: #b1b100;">each</span> <span style="color: #0066CC;">language</span>. <span style="color: #006600;">See</span> samples or xsd schema file. <span style="color: #006600;">Optional</span>. --<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&lt;</span>name<span style="color: #66cc66;">&gt;</span>AIRCI<span style="color: #66cc66;">&lt;/</span>name<span style="color: #66cc66;">&gt;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #66cc66;">&lt;!</span>-- An application <span style="color: #0066CC;">version</span> designator <span style="color: #66cc66;">&#40;</span>such as <span style="color: #ff0000;">&quot;v1&quot;</span>, <span style="color: #ff0000;">&quot;2.5&quot;</span>, or <span style="color: #ff0000;">&quot;Alpha 1&quot;</span><span style="color: #66cc66;">&#41;</span>. <span style="color: #006600;">Required</span>. --<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&lt;</span>version<span style="color: #66cc66;">&gt;</span>v1<span style="color: #66cc66;">&lt;/</span>version<span style="color: #66cc66;">&gt;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #66cc66;">&lt;!</span>-- Description, displayed <span style="color: #b1b100;">in</span> the AIR application installer.<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #006600;">May</span> have multiple values <span style="color: #b1b100;">for</span> <span style="color: #b1b100;">each</span> <span style="color: #0066CC;">language</span>. <span style="color: #006600;">See</span> samples or xsd schema file. <span style="color: #006600;">Optional</span>. --<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&lt;!</span>-- <span style="color: #66cc66;">&lt;</span>description<span style="color: #66cc66;">&gt;&lt;/</span>description<span style="color: #66cc66;">&gt;</span> --<span style="color: #66cc66;">&gt;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #66cc66;">&lt;!</span>-- Copyright information. <span style="color: #006600;">Optional</span> --<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&lt;!</span>-- <span style="color: #66cc66;">&lt;</span>copyright<span style="color: #66cc66;">&gt;&lt;/</span>copyright<span style="color: #66cc66;">&gt;</span> --<span style="color: #66cc66;">&gt;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #66cc66;">&lt;!</span>-- Publisher ID. <span style="color: #006600;">Used</span> <span style="color: #b1b100;">if</span> you<span style="color: #ff0000;">'re updating an application created prior to 1.5.3 --&gt;<br />
&nbsp; &nbsp; &lt;!-- &lt;publisherID&gt;&lt;/publisherID&gt; --&gt;<br />
<br />
&nbsp; &nbsp; &lt;!-- Settings for the application'</span>s initial window. <span style="color: #006600;">Required</span>. --<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&lt;</span>initialWindow<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&lt;!</span>-- The main SWF or <span style="color: #0066CC;">HTML</span> file of the application. <span style="color: #006600;">Required</span>. --<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&lt;!</span>-- Note: <span style="color: #b1b100;">In</span> Flash Builder, the SWF reference is <span style="color: #0066CC;">set</span> automatically. --<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&lt;</span>content<span style="color: #66cc66;">&gt;</span><span style="color: #66cc66;">&#91;</span><span style="color: #0066CC;">This</span> value will be overwritten by Flash Builder <span style="color: #b1b100;">in</span> the output app.<span style="color: #0066CC;">xml</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&lt;/</span>content<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&lt;!</span>-- The title of the main window. <span style="color: #006600;">Optional</span>. --<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&lt;!</span>-- <span style="color: #66cc66;">&lt;</span>title<span style="color: #66cc66;">&gt;&lt;/</span>title<span style="color: #66cc66;">&gt;</span> --<span style="color: #66cc66;">&gt;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&lt;!</span>-- The <span style="color: #0066CC;">type</span> of <span style="color: #0066CC;">system</span> chrome to use <span style="color: #66cc66;">&#40;</span>either <span style="color: #ff0000;">&quot;standard&quot;</span> or <span style="color: #ff0000;">&quot;none&quot;</span><span style="color: #66cc66;">&#41;</span>. <span style="color: #006600;">Optional</span>. <span style="color: #000000; font-weight: bold;">Default</span> standard. --<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&lt;!</span>-- <span style="color: #66cc66;">&lt;</span>systemChrome<span style="color: #66cc66;">&gt;&lt;/</span>systemChrome<span style="color: #66cc66;">&gt;</span> --<span style="color: #66cc66;">&gt;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&lt;!</span>-- Whether the window is transparent. <span style="color: #006600;">Only</span> applicable when systemChrome is none. <span style="color: #006600;">Optional</span>. <span style="color: #000000; font-weight: bold;">Default</span> <span style="color: #000000; font-weight: bold;">false</span>. --<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&lt;!</span>-- <span style="color: #66cc66;">&lt;</span>transparent<span style="color: #66cc66;">&gt;&lt;/</span>transparent<span style="color: #66cc66;">&gt;</span> --<span style="color: #66cc66;">&gt;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&lt;!</span>-- Whether the window is initially <span style="color: #0066CC;">visible</span>. <span style="color: #006600;">Optional</span>. <span style="color: #000000; font-weight: bold;">Default</span> <span style="color: #000000; font-weight: bold;">false</span>. --<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&lt;!</span>-- <span style="color: #66cc66;">&lt;</span>visible<span style="color: #66cc66;">&gt;&lt;/</span>visible<span style="color: #66cc66;">&gt;</span> --<span style="color: #66cc66;">&gt;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&lt;!</span>-- Whether the user can minimize the window. <span style="color: #006600;">Optional</span>. <span style="color: #000000; font-weight: bold;">Default</span> <span style="color: #000000; font-weight: bold;">true</span>. --<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&lt;!</span>-- <span style="color: #66cc66;">&lt;</span>minimizable<span style="color: #66cc66;">&gt;&lt;/</span>minimizable<span style="color: #66cc66;">&gt;</span> --<span style="color: #66cc66;">&gt;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&lt;!</span>-- Whether the user can maximize the window. <span style="color: #006600;">Optional</span>. <span style="color: #000000; font-weight: bold;">Default</span> <span style="color: #000000; font-weight: bold;">true</span>. --<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&lt;!</span>-- <span style="color: #66cc66;">&lt;</span>maximizable<span style="color: #66cc66;">&gt;&lt;/</span>maximizable<span style="color: #66cc66;">&gt;</span> --<span style="color: #66cc66;">&gt;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&lt;!</span>-- Whether the user can resize the window. <span style="color: #006600;">Optional</span>. <span style="color: #000000; font-weight: bold;">Default</span> <span style="color: #000000; font-weight: bold;">true</span>. --<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&lt;!</span>-- <span style="color: #66cc66;">&lt;</span>resizable<span style="color: #66cc66;">&gt;&lt;/</span>resizable<span style="color: #66cc66;">&gt;</span> --<span style="color: #66cc66;">&gt;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&lt;!</span>-- The window<span style="color: #ff0000;">'s initial width. Optional. --&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;!-- &lt;width&gt;&lt;/width&gt; --&gt;<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;!-- The window'</span>s initial <span style="color: #0066CC;">height</span>. <span style="color: #006600;">Optional</span>. --<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&lt;!</span>-- <span style="color: #66cc66;">&lt;</span>height<span style="color: #66cc66;">&gt;&lt;/</span>height<span style="color: #66cc66;">&gt;</span> --<span style="color: #66cc66;">&gt;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&lt;!</span>-- The window<span style="color: #ff0000;">'s initial x position. Optional. --&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;!-- &lt;x&gt;&lt;/x&gt; --&gt;<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;!-- The window'</span>s initial y <span style="color: #0066CC;">position</span>. <span style="color: #006600;">Optional</span>. --<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&lt;!</span>-- <span style="color: #66cc66;">&lt;</span>y<span style="color: #66cc66;">&gt;&lt;/</span>y<span style="color: #66cc66;">&gt;</span> --<span style="color: #66cc66;">&gt;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&lt;!</span>-- The window<span style="color: #ff0000;">'s minimum size, specified as a width/height pair, such as &quot;400 200&quot;. Optional. --&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;!-- &lt;minSize&gt;&lt;/minSize&gt; --&gt;<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;!-- The window'</span>s initial maximum <span style="color: #0066CC;">size</span>, specified as a <span style="color: #0066CC;">width</span><span style="color: #66cc66;">/</span><span style="color: #0066CC;">height</span> pair, such as <span style="color: #ff0000;">&quot;1600 1200&quot;</span>. <span style="color: #006600;">Optional</span>. --<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&lt;!</span>-- <span style="color: #66cc66;">&lt;</span>maxSize<span style="color: #66cc66;">&gt;&lt;/</span>maxSize<span style="color: #66cc66;">&gt;</span> --<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&lt;/</span>initialWindow<span style="color: #66cc66;">&gt;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #66cc66;">&lt;!</span>-- The subpath of the standard <span style="color: #000000; font-weight: bold;">default</span> installation location to use. <span style="color: #006600;">Optional</span>. --<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&lt;!</span>-- <span style="color: #66cc66;">&lt;</span>installFolder<span style="color: #66cc66;">&gt;&lt;/</span>installFolder<span style="color: #66cc66;">&gt;</span> --<span style="color: #66cc66;">&gt;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #66cc66;">&lt;!</span>-- The subpath of the Programs <span style="color: #0066CC;">menu</span> to use. <span style="color: #66cc66;">&#40;</span>Ignored <span style="color: #0066CC;">on</span> operating systems without a Programs <span style="color: #0066CC;">menu</span>.<span style="color: #66cc66;">&#41;</span> Optional. --<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&lt;!</span>-- <span style="color: #66cc66;">&lt;</span>programMenuFolder<span style="color: #66cc66;">&gt;&lt;/</span>programMenuFolder<span style="color: #66cc66;">&gt;</span> --<span style="color: #66cc66;">&gt;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #66cc66;">&lt;!</span>-- The icon the <span style="color: #0066CC;">system</span> uses <span style="color: #b1b100;">for</span> the application. <span style="color: #b1b100;">For</span> at least one resolution,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;specify the path to a PNG file included <span style="color: #b1b100;">in</span> the AIR package. <span style="color: #006600;">Optional</span>. --<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&lt;!</span>-- <span style="color: #66cc66;">&lt;</span>icon<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&lt;</span>image16x16<span style="color: #66cc66;">&gt;&lt;/</span>image16x16<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&lt;</span>image32x32<span style="color: #66cc66;">&gt;&lt;/</span>image32x32<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&lt;</span>image48x48<span style="color: #66cc66;">&gt;&lt;/</span>image48x48<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&lt;</span>image128x128<span style="color: #66cc66;">&gt;&lt;/</span>image128x128<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&lt;/</span>icon<span style="color: #66cc66;">&gt;</span> --<span style="color: #66cc66;">&gt;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #66cc66;">&lt;!</span>-- Whether the application handles the update when a user double-clicks an update <span style="color: #0066CC;">version</span><br />
&nbsp; &nbsp; of the AIR file <span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span>, or the <span style="color: #000000; font-weight: bold;">default</span> AIR application installer handles the update <span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">false</span><span style="color: #66cc66;">&#41;</span>.<br />
&nbsp; &nbsp; <span style="color: #006600;">Optional</span>. <span style="color: #000000; font-weight: bold;">Default</span> <span style="color: #000000; font-weight: bold;">false</span>. --<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&lt;!</span>-- <span style="color: #66cc66;">&lt;</span>customUpdateUI<span style="color: #66cc66;">&gt;&lt;/</span>customUpdateUI<span style="color: #66cc66;">&gt;</span> --<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #66cc66;">&lt;!</span>-- Whether the application can be launched when the user clicks a link <span style="color: #b1b100;">in</span> a web browser.<br />
&nbsp; &nbsp; <span style="color: #006600;">Optional</span>. <span style="color: #000000; font-weight: bold;">Default</span> <span style="color: #000000; font-weight: bold;">false</span>. --<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&lt;!</span>-- <span style="color: #66cc66;">&lt;</span>allowBrowserInvocation<span style="color: #66cc66;">&gt;&lt;/</span>allowBrowserInvocation<span style="color: #66cc66;">&gt;</span> --<span style="color: #66cc66;">&gt;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #66cc66;">&lt;!</span>-- Listing of file types <span style="color: #b1b100;">for</span> which the application can register. <span style="color: #006600;">Optional</span>. --<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&lt;!</span>-- <span style="color: #66cc66;">&lt;</span>fileTypes<span style="color: #66cc66;">&gt;</span> --<span style="color: #66cc66;">&gt;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&lt;!</span>-- Defines one file <span style="color: #0066CC;">type</span>. <span style="color: #006600;">Optional</span>. --<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&lt;!</span>-- <span style="color: #66cc66;">&lt;</span>fileType<span style="color: #66cc66;">&gt;</span> --<span style="color: #66cc66;">&gt;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&lt;!</span>-- The <span style="color: #0066CC;">name</span> that the <span style="color: #0066CC;">system</span> displays <span style="color: #b1b100;">for</span> the registered file <span style="color: #0066CC;">type</span>. <span style="color: #006600;">Required</span>. --<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&lt;!</span>-- <span style="color: #66cc66;">&lt;</span>name<span style="color: #66cc66;">&gt;&lt;/</span>name<span style="color: #66cc66;">&gt;</span> --<span style="color: #66cc66;">&gt;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&lt;!</span>-- The extension to register. <span style="color: #006600;">Required</span>. --<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&lt;!</span>-- <span style="color: #66cc66;">&lt;</span>extension<span style="color: #66cc66;">&gt;&lt;/</span>extension<span style="color: #66cc66;">&gt;</span> --<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&lt;!</span>-- The description of the file <span style="color: #0066CC;">type</span>. <span style="color: #006600;">Optional</span>. --<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&lt;!</span>-- <span style="color: #66cc66;">&lt;</span>description<span style="color: #66cc66;">&gt;&lt;/</span>description<span style="color: #66cc66;">&gt;</span> --<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&lt;!</span>-- The MIME content <span style="color: #0066CC;">type</span>. --<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&lt;!</span>-- <span style="color: #66cc66;">&lt;</span>contentType<span style="color: #66cc66;">&gt;&lt;/</span>contentType<span style="color: #66cc66;">&gt;</span> --<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&lt;!</span>-- The icon to display <span style="color: #b1b100;">for</span> the file <span style="color: #0066CC;">type</span>. <span style="color: #006600;">Optional</span>. --<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&lt;!</span>-- <span style="color: #66cc66;">&lt;</span>icon<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&lt;</span>image16x16<span style="color: #66cc66;">&gt;&lt;/</span>image16x16<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&lt;</span>image32x32<span style="color: #66cc66;">&gt;&lt;/</span>image32x32<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&lt;</span>image48x48<span style="color: #66cc66;">&gt;&lt;/</span>image48x48<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&lt;</span>image128x128<span style="color: #66cc66;">&gt;&lt;/</span>image128x128<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&lt;/</span>icon<span style="color: #66cc66;">&gt;</span> --<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&lt;!</span>-- <span style="color: #66cc66;">&lt;/</span>fileType<span style="color: #66cc66;">&gt;</span> --<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&lt;!</span>-- <span style="color: #66cc66;">&lt;/</span>fileTypes<span style="color: #66cc66;">&gt;</span> --<span style="color: #66cc66;">&gt;</span><br />
<br />
<span style="color: #66cc66;">&lt;/</span>application<span style="color: #66cc66;">&gt;</span></div></td></tr></tbody></table></div>
<p>The <em>build.xml</em> file looks like&#8230;</p>
<div class="codecolorer-container xml dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><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><br />
<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 File&quot;</span> <span style="color: #000066;">basedir</span>=<span style="color: #ff0000;">&quot;.&quot;</span> <span style="color: #000066;">default</span>=<span style="color: #ff0000;">&quot;build&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">&lt;!--location of property file --&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">file</span>=<span style="color: #ff0000;">&quot;${basedir}/build.properties&quot;</span> <span style="color: #000066;">description</span>=<span style="color: #ff0000;">&quot;your specific properities for builds&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">&lt;!-- additional tasks --&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;taskdef</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;mxmlc&quot;</span> <span style="color: #000066;">classname</span>=<span style="color: #ff0000;">&quot;flex.ant.MxmlcTask&quot;</span> <span style="color: #000066;">classpath</span>=<span style="color: #ff0000;">&quot;${FLEX_TASKS}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;taskdef</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;compc&quot;</span> <span style="color: #000066;">classname</span>=<span style="color: #ff0000;">&quot;flex.ant.CompcTask&quot;</span> <span style="color: #000066;">classpath</span>=<span style="color: #ff0000;">&quot;${FLEX_TASKS}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;taskdef</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;asdoc&quot;</span> <span style="color: #000066;">classname</span>=<span style="color: #ff0000;">&quot;flex.ant.AsDocTask&quot;</span> <span style="color: #000066;">classpath</span>=<span style="color: #ff0000;">&quot;${FLEX_TASKS}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
<br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/project<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></td></tr></tbody></table></div>
<p>And the <em>build.properties</em> file&#8230;</p>
<div class="codecolorer-container text dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">#Flex Locations<br />
FLEX_HOME=/Applications/Adobe\ Flash\ Builder\ 4/sdks/4.0.0<br />
FLEX_TASKS=${FLEX_HOME}/ant/lib/flexTasks.jar</div></td></tr></tbody></table></div>
<p><strong>Build the SWF File</strong><br />
When building an AIR application we start by building the SWF file and then storing that build file to package with the certificate.</p>
<p>What I&#8217;ve done here is use the FlexTasks MXMLC task to build the SWF file. I&#8217;ve specified that this is an AIR build so that we use the <em>air-config.xml</em> provided by Adobe. This provides lots of settings for us such as manifest files and other settings. Then I specify the source folder, library folder, what file is the main application file, and finally where the built swf file will be output to.</p>
<div class="codecolorer-container xml dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; &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&quot;</span></span><br />
<span style="color: #009900;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">description</span>=<span style="color: #ff0000;">&quot;Compiles the AIR application to a SWF file and places SWF in a temp directory to be packaged.&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mxmlc</span> <span style="color: #000066;">file</span>=<span style="color: #ff0000;">&quot;${SOURCE_DIR}/${APP_NAME}.${APP_EXTENSION}&quot;</span></span><br />
<span style="color: #009900;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">output</span>=<span style="color: #ff0000;">&quot;${BUILD_DIR}/${APP_NAME}.swf&quot;</span></span><br />
<span style="color: #009900;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">locale</span>=<span style="color: #ff0000;">&quot;${LOCALE}&quot;</span></span><br />
<span style="color: #009900;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">static-rsls</span>=<span style="color: #ff0000;">&quot;true&quot;</span></span><br />
<span style="color: #009900;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">accessible</span>=<span style="color: #ff0000;">&quot;true&quot;</span></span><br />
<span style="color: #009900;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">configname</span>=<span style="color: #ff0000;">&quot;air&quot;</span></span><br />
<span style="color: #009900;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">debug</span>=<span style="color: #ff0000;">&quot;${DEBUG_FLAG}&quot;</span></span><br />
<span style="color: #009900;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">failonerror</span>=<span style="color: #ff0000;">&quot;true&quot;</span></span><br />
<span style="color: #009900;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">fork</span>=<span style="color: #ff0000;">&quot;true&quot;</span></span><br />
<span style="color: #009900;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">maxmemory</span>=<span style="color: #ff0000;">&quot;512m&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;source-path</span> <span style="color: #000066;">path-element</span>=<span style="color: #ff0000;">&quot;${SOURCE_DIR}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;external-library-path</span> <span style="color: #000066;">file</span>=<span style="color: #ff0000;">&quot;${FLEX_HOME}/frameworks/libs/air/airglobal.swc&quot;</span> <span style="color: #000066;">append</span>=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;library-path</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${LIBRARY_DIR}&quot;</span> <span style="color: #000066;">includes</span>=<span style="color: #ff0000;">&quot;*.swc&quot;</span> <span style="color: #000066;">append</span>=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/mxmlc<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></td></tr></tbody></table></div>
<p>And the properties&#8217;s file additions:</p>
<div class="codecolorer-container text dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">#App Settings<br />
APP_NAME=AIRCI<br />
APP_EXTENSION=mxml<br />
SOURCE_DIR=${basedir}/src<br />
LIBRARY_DIR=${basedir}/libs<br />
RELEASE_DIR=${basedir}/release<br />
BUILD_DIR=${basedir}/build<br />
<br />
#Etc Settings<br />
LOCALE=en_US<br />
DEBUG_FLAG=false</div></td></tr></tbody></table></div>
<p><strong>Make the Certificate</strong><br />
Next we need to build the certificate &#8211; especially if the certificate hasn&#8217;t been made yet. In the final file we&#8217;ll check if it exists and only create the certificate if it doesn&#8217;t, but for now we&#8217;ll just build the file. We&#8217;ll use the ADT executable to achieve the certificate creation.</p>
<div class="codecolorer-container xml dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; &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;certificate&quot;</span> <span style="color: #000066;">unless</span>=<span style="color: #ff0000;">&quot;CERTIFICATE_FLAG&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;java</span> <span style="color: #000066;">jar</span>=<span style="color: #ff0000;">&quot;${ADT}&quot;</span> <span style="color: #000066;">fork</span>=<span style="color: #ff0000;">&quot;true&quot;</span> </span><br />
<span style="color: #009900;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">failonerror</span>=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;-certificate&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;-cn&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;${CERT_NAME}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;-ou&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;${CERT_ORG_UNIT}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;-o&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;${CERT_ORG_NAME}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;-c&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;${CERT_COUNTRY}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;${CERT_KEY_TYPE}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;${KEYSTORE}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;${CERT_PASSWORD}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/java<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></td></tr></tbody></table></div>
<p>And the build properties added in this step:</p>
<div class="codecolorer-container text dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">#certificate<br />
STORETYPE=pkcs12<br />
KEYSTORE=cert.p12<br />
CERT_NAME=UnitedMindsetSelfSignedCertificate<br />
CERT_ORG_UNIT=Software Development<br />
CERT_ORG_NAME=UnitedMindset<br />
CERT_COUNTRY=US<br />
CERT_KEY_TYPE=2048-RSA<br />
CERT_PASSWORD=unitedmindsetNotARealPassword</div></td></tr></tbody></table></div>
<p><strong>Package and Release the AIR Application</strong><br />
Finally we&#8217;ll create the releasable application using the ADT executable with the application descriptor file, the swf file that was previously created, and the certificate.</p>
<div class="codecolorer-container xml dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; &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;package&quot;</span> <span style="color: #000066;">depends</span>=<span style="color: #ff0000;">&quot;compile, certificate&quot;</span></span><br />
<span style="color: #009900;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">description</span>=<span style="color: #ff0000;">&quot;Packages the build SWF file from a temp directory.&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;java</span> <span style="color: #000066;">jar</span>=<span style="color: #ff0000;">&quot;${ADT}&quot;</span> <span style="color: #000066;">fork</span>=<span style="color: #ff0000;">&quot;true&quot;</span> </span><br />
<span style="color: #009900;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">failonerror</span>=<span style="color: #ff0000;">&quot;true&quot;</span></span><br />
<span style="color: #009900;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">maxmemory</span>=<span style="color: #ff0000;">&quot;512m&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;-package&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;-storetype&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;${STORETYPE}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;-keystore&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;${KEYSTORE}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;-storepass&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;${CERT_PASSWORD}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;${RELEASE_DIR}/${APP_NAME}.air&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;${SOURCE_DIR}/${APP_NAME}-app.xml&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;-C&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;${BUILD_DIR}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;${BUILD_DIR}/${APP_NAME}.swf&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/java<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></td></tr></tbody></table></div>
<p>No additions were added to the build.properties file.</p>
<p><strong>Final build.xml File</strong></p>
<div class="codecolorer-container xml dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br />51<br />52<br />53<br />54<br />55<br />56<br />57<br />58<br />59<br />60<br />61<br />62<br />63<br />64<br />65<br />66<br />67<br />68<br />69<br />70<br />71<br />72<br />73<br />74<br />75<br />76<br />77<br />78<br />79<br />80<br />81<br />82<br />83<br />84<br />85<br />86<br />87<br />88<br />89<br />90<br />91<br />92<br />93<br />94<br />95<br />96<br />97<br />98<br />99<br />100<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><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><br />
<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 File&quot;</span> <span style="color: #000066;">basedir</span>=<span style="color: #ff0000;">&quot;.&quot;</span> <span style="color: #000066;">default</span>=<span style="color: #ff0000;">&quot;build&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">&lt;!--location of property file --&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">file</span>=<span style="color: #ff0000;">&quot;${basedir}/build.properties&quot;</span> <span style="color: #000066;">description</span>=<span style="color: #ff0000;">&quot;your specific properities for builds&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">&lt;!-- additional tasks --&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;taskdef</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;mxmlc&quot;</span> <span style="color: #000066;">classname</span>=<span style="color: #ff0000;">&quot;flex.ant.MxmlcTask&quot;</span> <span style="color: #000066;">classpath</span>=<span style="color: #ff0000;">&quot;${FLEX_TASKS}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;taskdef</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;compc&quot;</span> <span style="color: #000066;">classname</span>=<span style="color: #ff0000;">&quot;flex.ant.CompcTask&quot;</span> <span style="color: #000066;">classpath</span>=<span style="color: #ff0000;">&quot;${FLEX_TASKS}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;taskdef</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;asdoc&quot;</span> <span style="color: #000066;">classname</span>=<span style="color: #ff0000;">&quot;flex.ant.AsDocTask&quot;</span> <span style="color: #000066;">classpath</span>=<span style="color: #ff0000;">&quot;${FLEX_TASKS}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">&lt;!--</span><br />
<span style="color: #808080; font-style: italic;"> &nbsp; &nbsp;</span><br />
<span style="color: #808080; font-style: italic;"> &nbsp; &nbsp;</span><br />
<span style="color: #808080; font-style: italic;"> &nbsp; &nbsp; &nbsp; &nbsp;Build</span><br />
<span style="color: #808080; font-style: italic;"> &nbsp; &nbsp;</span><br />
<span style="color: #808080; font-style: italic;"> &nbsp; &nbsp;</span><br />
<span style="color: #808080; font-style: italic;"> &nbsp; &nbsp;--&gt;</span><br />
<br />
&nbsp; &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;build&quot;</span> <span style="color: #000066;">description</span>=<span style="color: #ff0000;">&quot;compiles application&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <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;init&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <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;package&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <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;cleanup&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <br />
&nbsp; &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&quot;</span></span><br />
<span style="color: #009900;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">description</span>=<span style="color: #ff0000;">&quot;Compiles the AIR application to a SWF file and places SWF in a temp directory to be packaged.&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mxmlc</span> <span style="color: #000066;">file</span>=<span style="color: #ff0000;">&quot;${SOURCE_DIR}/${APP_NAME}.${APP_EXTENSION}&quot;</span></span><br />
<span style="color: #009900;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">output</span>=<span style="color: #ff0000;">&quot;${BUILD_DIR}/${APP_NAME}.swf&quot;</span></span><br />
<span style="color: #009900;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">locale</span>=<span style="color: #ff0000;">&quot;${LOCALE}&quot;</span></span><br />
<span style="color: #009900;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">static-rsls</span>=<span style="color: #ff0000;">&quot;true&quot;</span></span><br />
<span style="color: #009900;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">accessible</span>=<span style="color: #ff0000;">&quot;true&quot;</span></span><br />
<span style="color: #009900;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">configname</span>=<span style="color: #ff0000;">&quot;air&quot;</span></span><br />
<span style="color: #009900;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">debug</span>=<span style="color: #ff0000;">&quot;${DEBUG_FLAG}&quot;</span></span><br />
<span style="color: #009900;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">failonerror</span>=<span style="color: #ff0000;">&quot;true&quot;</span></span><br />
<span style="color: #009900;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">fork</span>=<span style="color: #ff0000;">&quot;true&quot;</span></span><br />
<span style="color: #009900;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">maxmemory</span>=<span style="color: #ff0000;">&quot;512m&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;source-path</span> <span style="color: #000066;">path-element</span>=<span style="color: #ff0000;">&quot;${SOURCE_DIR}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;external-library-path</span> <span style="color: #000066;">file</span>=<span style="color: #ff0000;">&quot;${FLEX_HOME}/frameworks/libs/air/airglobal.swc&quot;</span> <span style="color: #000066;">append</span>=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;library-path</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${LIBRARY_DIR}&quot;</span> <span style="color: #000066;">includes</span>=<span style="color: #ff0000;">&quot;*.swc&quot;</span> <span style="color: #000066;">append</span>=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/mxmlc<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <br />
&nbsp; &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;certificate&quot;</span> <span style="color: #000066;">unless</span>=<span style="color: #ff0000;">&quot;CERTIFICATE_FLAG&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;java</span> <span style="color: #000066;">jar</span>=<span style="color: #ff0000;">&quot;${ADT}&quot;</span> <span style="color: #000066;">fork</span>=<span style="color: #ff0000;">&quot;true&quot;</span> </span><br />
<span style="color: #009900;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">failonerror</span>=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;-certificate&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;-cn&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;${CERT_NAME}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;-ou&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;${CERT_ORG_UNIT}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;-o&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;${CERT_ORG_NAME}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;-c&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;${CERT_COUNTRY}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;${CERT_KEY_TYPE}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;${KEYSTORE}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;${CERT_PASSWORD}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/java<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <br />
&nbsp; &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;package&quot;</span> <span style="color: #000066;">depends</span>=<span style="color: #ff0000;">&quot;compile, certificate&quot;</span></span><br />
<span style="color: #009900;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">description</span>=<span style="color: #ff0000;">&quot;Packages the build SWF file from a temp directory.&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;java</span> <span style="color: #000066;">jar</span>=<span style="color: #ff0000;">&quot;${ADT}&quot;</span> <span style="color: #000066;">fork</span>=<span style="color: #ff0000;">&quot;true&quot;</span> </span><br />
<span style="color: #009900;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">failonerror</span>=<span style="color: #ff0000;">&quot;true&quot;</span></span><br />
<span style="color: #009900;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">maxmemory</span>=<span style="color: #ff0000;">&quot;512m&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;-package&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;-storetype&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;${STORETYPE}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;-keystore&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;${KEYSTORE}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;-storepass&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;${CERT_PASSWORD}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;${RELEASE_DIR}/${APP_NAME}.air&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;${SOURCE_DIR}/${APP_NAME}-app.xml&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;-C&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;${BUILD_DIR}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;${BUILD_DIR}/${APP_NAME}.swf&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/java<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <br />
&nbsp; &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;init&quot;</span> <span style="color: #000066;">depends</span>=<span style="color: #ff0000;">&quot;clean&quot;</span></span><br />
<span style="color: #009900;">&nbsp; &nbsp; <span style="color: #000066;">description</span>=<span style="color: #ff0000;">&quot;Cleans the deploy file&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mkdir</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${BUILD_DIR}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mkdir</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${RELEASE_DIR}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;available</span> <span style="color: #000066;">file</span>=<span style="color: #ff0000;">&quot;${KEYSTORE}&quot;</span> <span style="color: #000066;">property</span>=<span style="color: #ff0000;">&quot;CERTIFICATE_FLAG&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <br />
&nbsp; &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;clean&quot;</span></span><br />
<span style="color: #009900;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">description</span>=<span style="color: #ff0000;">&quot;Cleans up old files.&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;delete</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${BUILD_DIR}&quot;</span> <span style="color: #000066;">failOnError</span>=<span style="color: #ff0000;">&quot;false&quot;</span> <span style="color: #000066;">includeEmptyDirs</span>=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;delete</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${RELEASE_DIR}&quot;</span> <span style="color: #000066;">failOnError</span>=<span style="color: #ff0000;">&quot;false&quot;</span> <span style="color: #000066;">includeEmptyDirs</span>=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <br />
&nbsp; &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;cleanup&quot;</span></span><br />
<span style="color: #009900;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">description</span>=<span style="color: #ff0000;">&quot;Cleans up old files.&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;delete</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${BUILD_DIR}&quot;</span> <span style="color: #000066;">failOnError</span>=<span style="color: #ff0000;">&quot;false&quot;</span> <span style="color: #000066;">includeEmptyDirs</span>=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/project<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></td></tr></tbody></table></div>
<p><strong>Final build.properties File</strong></p>
<div class="codecolorer-container text dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">#Flex Locations<br />
FLEX_HOME=/Applications/Adobe\ Flash\ Builder\ 4/sdks/4.0.0<br />
FLEX_TASKS=${FLEX_HOME}/ant/lib/flexTasks.jar<br />
<br />
#Compilers<br />
ADL=${FLEX_HOME}/bin/adl<br />
ADT=${FLEX_HOME}/lib/adt.jar<br />
<br />
#App Settings<br />
APP_NAME=AIRCI<br />
APP_EXTENSION=mxml<br />
SOURCE_DIR=${basedir}/src<br />
LIBRARY_DIR=${basedir}/libs<br />
RELEASE_DIR=${basedir}/release<br />
BUILD_DIR=${basedir}/build<br />
<br />
#Etc Settings<br />
LOCALE=en_US<br />
DEBUG_FLAG=false<br />
<br />
#certificate<br />
STORETYPE=pkcs12<br />
KEYSTORE=cert.p12<br />
CERT_NAME=UnitedMindsetSelfSignedCertificate<br />
CERT_ORG_UNIT=Software Development<br />
CERT_ORG_NAME=UnitedMindset<br />
CERT_COUNTRY=US<br />
CERT_KEY_TYPE=2048-RSA<br />
CERT_PASSWORD=unitedMindsetNotARealPassword</div></td></tr></tbody></table></div>
<blockquote><p>
One error you may see when trying to package your application is:<br />
<strong>[java] /Users/jonbcampos/Documents/work/dflex/AIRCI/src/AIRCI-app.xml(43): error 105: application.initialWindow.content contains an invalid value</strong></p>
<p>This is because the content in your application descriptor file isn&#8217;t set. When Flash Builder builds an AIR file it replaces the content tag in the application descriptor file.</p>
<div class="codecolorer-container xml dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #808080; font-style: italic;">&lt;!-- Note: In Flash Builder, the SWF reference is set automatically. --&gt;</span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;content<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>[This value will be overwritten by Flash Builder in the output app.xml]<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/content<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></td></tr></tbody></table></div>
<p>You may want to just switch it out for the name of your swf file:</p>
<div class="codecolorer-container xml dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;content<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>AIRCI.swf<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/content<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></td></tr></tbody></table></div>
</blockquote>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://unitedmindset.com/jonbcampos/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://unitedmindset.com/jonbcampos/2010/06/22/building-an-air-application-with-ant/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Konami Code</title>
		<link>http://unitedmindset.com/jonbcampos/2010/06/15/konami-code/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=konami-code</link>
		<comments>http://unitedmindset.com/jonbcampos/2010/06/15/konami-code/#comments</comments>
		<pubDate>Tue, 15 Jun 2010 14:00:00 +0000</pubDate>
		<dc:creator>Jonathan Campos</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[CodeManager]]></category>
		<category><![CDATA[Konami Code]]></category>

		<guid isPermaLink="false">http://unitedmindset.com/jonbcampos/?p=1522</guid>
		<description><![CDATA[One thing I made a while back just for fun was a little hidden code manager. This was originally created for a past 360&#124;Flex presentation I gave as a little bonus for those that came to my presentation. Honestly I thought I already created a blog post with this code so that other people could [...]]]></description>
			<content:encoded><![CDATA[<p>One thing I made a while back just for fun was a little hidden code manager. This was originally created for a past 360|Flex presentation I gave as a little bonus for those that came to my presentation.</p>
<p>Honestly I thought I already created a blog post with this code so that other people could also use it.</p>
<p>Play with the Konami Code by clicking on the example below and typing in the Konami Code on your keyboard &#8211; I&#8217;m not going to tell you what the code is&#8230;<br />

    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="swfobj_0" width="300/300" height="300">
      <param name="movie" value="http://unitedmindset.com/jonbcampos/wp-content/uploads/2010/06/KonamiCodeTest.swf" />
      <!--[if !IE]>-->
      <object type="application/x-shockwave-flash" data="http://unitedmindset.com/jonbcampos/wp-content/uploads/2010/06/KonamiCodeTest.swf" width="300/300" height="300">
      <!--<![endif]-->
        <p>The Flash plugin is required to view this object.</p>
      <!--[if !IE]>-->
      </object>
      <!--<![endif]-->
    </object>
 </p>
<p>You can view the source to the <a href="http://github.com/jonbcampos/UnitedMindsetFx4Library/blob/master/src/com/unitedmindset/managers/CodeManager.as">CodeManager here</a>.</p>
<blockquote><p>
Some other fun things I added into the manager. You can control how quickly the code was entered, enter in new codes with just the string, and just listen to the result that the code was successful.
</p></blockquote>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://unitedmindset.com/jonbcampos/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://unitedmindset.com/jonbcampos/2010/06/15/konami-code/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Revisiting Deep Linking with Flex</title>
		<link>http://unitedmindset.com/jonbcampos/2010/06/08/revisiting-deep-linking-with-flex/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=revisiting-deep-linking-with-flex</link>
		<comments>http://unitedmindset.com/jonbcampos/2010/06/08/revisiting-deep-linking-with-flex/#comments</comments>
		<pubDate>Tue, 08 Jun 2010 14:00:54 +0000</pubDate>
		<dc:creator>Jonathan Campos</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Browser Manager]]></category>
		<category><![CDATA[deep linking with flex]]></category>
		<category><![CDATA[deep-linking]]></category>
		<category><![CDATA[DeepLinkingManager]]></category>

		<guid isPermaLink="false">http://unitedmindset.com/jonbcampos/?p=1433</guid>
		<description><![CDATA[A few months *cough *cough over a year ago I posted some thoughts on Deep Linking within a Flex Application. Since making this post I have worked on a variety of different applications using AIR, Flex, and other RIA technologies. As time goes on I&#8217;ve changed my methods but the theory has stayed the same: [...]]]></description>
			<content:encoded><![CDATA[<p>A few months *cough *cough over a year ago I posted some thoughts on <a href="http://unitedmindset.com/jonbcampos/2009/01/27/deep-linking-seo-with-flex/" target="_blank">Deep Linking within a Flex Application</a>. Since making this post I have worked on a variety of different applications using AIR, Flex, and other RIA technologies.</p>
<p>As time goes on I&#8217;ve changed my methods but the theory has stayed the same: Get the URL, go to a specific state of the application.</p>
<p>The question is again how do we get this information, how do we determine where to go, and how do we mark updates in our application to the URL. We&#8217;re going to also want to have our application&#8217;s URL be shareable between applications.</p>
<p>More concisely, I&#8217;m going to talk about a very simple framework I&#8217;ve set up to speed up the programming behind deep linking. In no way is this framework complete, however it has served it&#8217;s purpose for some applications I&#8217;ve put together and can definitely help you. If you have feedback please let me know.</p>
<blockquote><p>
<a href="http://unitedmindset.com/jonbcampos/wp-content/flex_content/deeplinking/DeepLinking.html" target="_blank">Example (View Source Enabled)</a> | <a href="http://unitedmindset.com/jonbcampos/wp-content/flex_content/deeplinking/srcview/index.html" target="_blank">View Source</a>
</p></blockquote>
<p><span id="more-1433"></span><br />
Thinking of SEO and Search Engines we still don&#8217;t need to worry about search engines finding our content because we are going to use SWFObject and <em>Alternative Content</em> to show the data and text that belongs to the specified link. We can even still use HTML links within our alternative content so that search engines crawl and scrap our content&#8230; while the user will see your beautiful Flex application.</p>
<p>In this blog post I&#8217;m not going to talk about writing your alternative content, that was <a href="http://unitedmindset.com/jonbcampos/2009/01/27/deep-linking-seo-with-flex/" target="_blank">previously discussed</a>.</p>
<blockquote><p>
As discussed earlier, it is very beneficial to have this alternative content for your Flex Applications &#8211; especially if you are creating a Flex Application to be delivered to the open web. If a device that doesn&#8217;t support Flash runs into your site the alternative content will be shown and the user can keep getting your fabulous content.
</p></blockquote>
<p>My framework that will handle the Deep Linking is going to be built around a Singleton Class. Why? Well there is only one browser and I want to be able to update the single browser from anywhere in my application. When this class starts up we&#8217;ll get the initial URL and set the application&#8217;s initial state.</p>
<p><strong>Get the URL</strong><br />
In my <a href="http://unitedmindset.com/jonbcampos/2009/01/27/deep-linking-seo-with-flex/" target="_blank">previous post</a> I used server side code to set the initial vars and url for our application. I still believe that if you need to do some augmentation on your URL prior to reaching the Flex Application this is a perfectly legitimate method, but I also want to show a simpler route to getting your application&#8217;s url.</p>
<div class="codecolorer-container actionscript dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="actionscript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">url</span>:<span style="color: #0066CC;">String</span> = _browserManager.<span style="color: #0066CC;">url</span>;</div></td></tr></tbody></table></div>
<p><strong>Determine the application state</strong><br />
Once you have the URL the next step is easy. Parse the URL string for your application specific variables and move your application to that location.</p>
<p>As simple as this step is &#8211; this step is infinitely difficult to explain for your specific application. If you&#8217;re wondering when I will get to get to my framework, that time is now. Here is precisely where my framework helps your development. What you need to do is register components, in my example I will register a Spark List component.</p>
<div class="codecolorer-container actionscript dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="actionscript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">DeepLinkingManager.<span style="color: #006600;">getInstance</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">registerNavigationControl</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;list&quot;</span>, <span style="color: #0066CC;">list</span>, <span style="color: #ff0000;">&quot;selectedIndex&quot;</span>, <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span>;</div></td></tr></tbody></table></div>
<p>What I have done is register a List (the id is list), say that the name in the url will be &#8220;list&#8221; and that the property that we will be watching is &#8220;selectedIndex&#8221;. Finally I say that the default value is 0. So if the value is 0, we don&#8217;t worry about putting it into the url &#8211; keeps the URL pretty <img src='http://unitedmindset.com/jonbcampos/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
<p><strong>Mark Application State updates to the URL</strong><br />
When the application state changes the first thing you need to do is parse the current state of the application and turn that into a URL. Then, if the URL changes you need to reverse this process and set the application state based on the parsed URL.</p>
<p>To update the URL is really simple with the application, just call the updateUrl function.</p>
<div class="codecolorer-container actionscript dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="actionscript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">DeepLinkingManager.<span style="color: #006600;">getInstance</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">updateUrl</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div></td></tr></tbody></table></div>
<p>Whenever and whatever you want to trigger an update to the Url just mark the event with this code.</p>
<p>That&#8217;s it. The browser&#8217;s URL is set based on the application and the application&#8217;s state is set based on the URL. The roundtrip is complete and the application is deep linking compatible. I hope the framework helps you as much as it&#8217;s helped me. Again, I&#8217;m looking for feedback if you run into any troubles using it.</p>
<blockquote><p>
<a href="http://unitedmindset.com/jonbcampos/wp-content/flex_content/deeplinking/DeepLinking.html" target="_blank">Example (View Source Enabled)</a> | <a href="http://unitedmindset.com/jonbcampos/wp-content/flex_content/deeplinking/srcview/index.html" target="_blank">View Source</a>
</p></blockquote>
<blockquote><p>
You can get the code in my <a href="http://github.com/jonbcampos/UnitedMindsetFx4Library" target="_blank">public library on github</a>.<br />
Here is the source to the <a href="http://github.com/jonbcampos/UnitedMindsetFx4Library/blob/master/src/com/unitedmindset/managers/DeepLinkingManager.as" target="_blank">DeepLinkingManager</a>.
</p></blockquote>
<blockquote><p>
Update:<br />
Geez, I am a constant perfectionist when it comes to my code &#8211; blog post typos are a different story. I felt that if you are listening for a change on the instance then why am I forcing you to make ANOTHER handler function to just update the url. If you want this handled for you based on an event from the instance there is a new parameter on the register function that will allow you to enter that event type. Now you don&#8217;t even need to call the updateUrl if you don&#8217;t want to. Just do:<br />
<strong>DeepLinkingManager.getInstance().registerNavigationControl(&#8220;list&#8221;, list, &#8220;selectedIndex&#8221;, 0, IndexChangeEvent.CHANGE);</strong>
</p></blockquote>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://unitedmindset.com/jonbcampos/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://unitedmindset.com/jonbcampos/2010/06/08/revisiting-deep-linking-with-flex/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>9 Slice Scaling with Spark Skinning</title>
		<link>http://unitedmindset.com/jonbcampos/2010/05/27/9-slice-scaling-with-spark-skinning/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=9-slice-scaling-with-spark-skinning</link>
		<comments>http://unitedmindset.com/jonbcampos/2010/05/27/9-slice-scaling-with-spark-skinning/#comments</comments>
		<pubDate>Thu, 27 May 2010 15:00:05 +0000</pubDate>
		<dc:creator>Jonathan Campos</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[9 Slice Scaling]]></category>
		<category><![CDATA[spark skinning]]></category>

		<guid isPermaLink="false">http://unitedmindset.com/jonbcampos/?p=1519</guid>
		<description><![CDATA[Doing 9 Slice Scaling in Flex 4 Skins is actually very very easy however there were a few hurdles you had to be ready for if you want to do it right. Luckily the Flex team made some much requested changes to 9 Slice Scaling and now it is super easy. Let&#8217;s start by making [...]]]></description>
			<content:encoded><![CDATA[<p>Doing 9 Slice Scaling in Flex 4 Skins is actually very very easy however there were a few hurdles you had to be ready for if you want to do it right. Luckily the Flex team made some much requested changes to 9 Slice Scaling and now it is super easy.<br />
<img src="http://unitedmindset.com/jonbcampos/wp-content/uploads/2010/05/Screen-shot-2010-05-26-at-2.53.56-PM.png" alt="Scale9 Skin" title="9 Slice Scaling" width="392" height="342" class="alignnone size-full wp-image-1523" /><br />
<span id="more-1519"></span><br />
Let&#8217;s start by making a Spark Button in our Application and resizing it a few times:</p>
<div class="codecolorer-container actionscript dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br /></div></td><td><div class="actionscript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #66cc66;">&lt;</span>?<span style="color: #0066CC;">xml</span> <span style="color: #0066CC;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #66cc66;">&gt;</span><br />
<span style="color: #66cc66;">&lt;</span>s:Application xmlns:fx=<span style="color: #ff0000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;xmlns:s=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/spark&quot;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;xmlns:mx=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/mx&quot;</span><span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&lt;</span>fx:Script<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&lt;!</span><span style="color: #66cc66;">&#91;</span>CDATA<span style="color: #66cc66;">&#91;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">import</span> com.<span style="color: #006600;">unitedmindset</span>.<span style="color: #006600;">skins</span>.<span style="color: #006600;">ScalableSkin</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&lt;/</span>fx:Script<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&lt;</span>fx:Declarations<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&lt;!</span>-- Place non-visual elements <span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>.<span style="color: #006600;">g</span>., services, value objects<span style="color: #66cc66;">&#41;</span> here --<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&lt;/</span>fx:Declarations<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&lt;</span>s:layout<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&lt;</span>s:VerticalLayout gap=<span style="color: #ff0000;">&quot;20&quot;</span> paddingBottom=<span style="color: #ff0000;">&quot;20&quot;</span> paddingLeft=<span style="color: #ff0000;">&quot;20&quot;</span> paddingRight=<span style="color: #ff0000;">&quot;20&quot;</span> paddingTop=<span style="color: #ff0000;">&quot;20&quot;</span><span style="color: #66cc66;">/&gt;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&lt;/</span>s:layout<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&lt;</span>s:<span style="color: #0066CC;">Button</span> skinClass=<span style="color: #ff0000;">&quot;com.unitedmindset.skins.ScalableSkin&quot;</span> <span style="color: #0066CC;">width</span>=<span style="color: #ff0000;">&quot;20&quot;</span> <span style="color: #0066CC;">height</span>=<span style="color: #ff0000;">&quot;20&quot;</span><span style="color: #66cc66;">/&gt;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&lt;</span>s:<span style="color: #0066CC;">Button</span> skinClass=<span style="color: #ff0000;">&quot;com.unitedmindset.skins.ScalableSkin&quot;</span> <span style="color: #0066CC;">width</span>=<span style="color: #ff0000;">&quot;100&quot;</span> <span style="color: #0066CC;">height</span>=<span style="color: #ff0000;">&quot;100&quot;</span><span style="color: #66cc66;">/&gt;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&lt;</span>s:<span style="color: #0066CC;">Button</span> skinClass=<span style="color: #ff0000;">&quot;com.unitedmindset.skins.ScalableSkin&quot;</span> <span style="color: #0066CC;">width</span>=<span style="color: #ff0000;">&quot;300&quot;</span> <span style="color: #0066CC;">height</span>=<span style="color: #ff0000;">&quot;100&quot;</span><span style="color: #66cc66;">/&gt;</span><br />
<span style="color: #66cc66;">&lt;/</span>s:Application<span style="color: #66cc66;">&gt;</span></div></td></tr></tbody></table></div>
<p>You&#8217;ll notice I already have made my ScalableSkin, but right now it&#8217;s empty. This is just a stripped out version of the ButtonSkin created when using the &#8220;New > MXML Skin&#8221; Command.</p>
<p>The file current looks like this:</p>
<div class="codecolorer-container actionscript dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br />51<br />52<br />53<br /></div></td><td><div class="actionscript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #66cc66;">&lt;</span>?<span style="color: #0066CC;">xml</span> <span style="color: #0066CC;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #66cc66;">&gt;</span><br />
<br />
<span style="color: #66cc66;">&lt;!</span>--<br />
<br />
&nbsp; &nbsp; ADOBE SYSTEMS INCORPORATED<br />
&nbsp; &nbsp; Copyright <span style="color: #cc66cc;">2008</span> Adobe Systems Incorporated<br />
&nbsp; &nbsp; All Rights Reserved.<br />
<br />
&nbsp; &nbsp; <span style="color: #006600;">NOTICE</span>: Adobe permits you to use, modify, <span style="color: #0066CC;">and</span> distribute <span style="color: #0066CC;">this</span> file<br />
&nbsp; &nbsp; <span style="color: #b1b100;">in</span> accordance <span style="color: #0066CC;">with</span> the terms of the license agreement accompanying it.<br />
<br />
--<span style="color: #66cc66;">&gt;</span><br />
<br />
<span style="color: #66cc66;">&lt;!</span>--- The <span style="color: #000000; font-weight: bold;">default</span> skin <span style="color: #000000; font-weight: bold;">class</span> <span style="color: #b1b100;">for</span> the Spark <span style="color: #0066CC;">Button</span> component. &nbsp;<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #66cc66;">@</span>see spark.<span style="color: #006600;">components</span>.<span style="color: #0066CC;">Button</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">@</span>langversion <span style="color: #cc66cc;">3.0</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">@</span>playerversion Flash <span style="color: #cc66cc;">10</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">@</span>playerversion AIR <span style="color: #cc66cc;">1.5</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">@</span>productversion Flex <span style="color: #cc66cc;">4</span><br />
--<span style="color: #66cc66;">&gt;</span><br />
<span style="color: #66cc66;">&lt;</span>s:SparkSkin xmlns:fx=<span style="color: #ff0000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span> xmlns:s=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/spark&quot;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;xmlns:fb=<span style="color: #ff0000;">&quot;http://ns.adobe.com/flashbuilder/2009&quot;</span> minWidth=<span style="color: #ff0000;">&quot;10&quot;</span> minHeight=<span style="color: #ff0000;">&quot;10&quot;</span> alpha.<span style="color: #006600;">disabled</span>=<span style="color: #ff0000;">&quot;0.5&quot;</span><span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #66cc66;">&lt;!</span>-- host component --<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&lt;</span>fx:Metadata<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&lt;!</span><span style="color: #66cc66;">&#91;</span>CDATA<span style="color: #66cc66;">&#91;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">/** <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* @copy spark.skins.spark.ApplicationSkin#hostComponent<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;*/</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#91;</span>HostComponent<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;spark.components.Button&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#93;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&lt;/</span>fx:Metadata<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #66cc66;">&lt;!</span>-- states --<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&lt;</span>s:states<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&lt;</span>s:State <span style="color: #0066CC;">name</span>=<span style="color: #ff0000;">&quot;up&quot;</span> <span style="color: #66cc66;">/&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&lt;</span>s:State <span style="color: #0066CC;">name</span>=<span style="color: #ff0000;">&quot;over&quot;</span> <span style="color: #66cc66;">/&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&lt;</span>s:State <span style="color: #0066CC;">name</span>=<span style="color: #ff0000;">&quot;down&quot;</span> <span style="color: #66cc66;">/&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&lt;</span>s:State <span style="color: #0066CC;">name</span>=<span style="color: #ff0000;">&quot;disabled&quot;</span> <span style="color: #66cc66;">/&gt;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&lt;/</span>s:states<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #66cc66;">&lt;!</span>-- <span style="color: #0066CC;">text</span> --<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&lt;</span>s:Label id=<span style="color: #ff0000;">&quot;labelDisplay&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;textAlign=<span style="color: #ff0000;">&quot;center&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;verticalAlign=<span style="color: #ff0000;">&quot;middle&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;maxDisplayedLines=<span style="color: #ff0000;">&quot;1&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;horizontalCenter=<span style="color: #ff0000;">&quot;0&quot;</span> verticalCenter=<span style="color: #ff0000;">&quot;1&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0066CC;">left</span>=<span style="color: #ff0000;">&quot;10&quot;</span> <span style="color: #0066CC;">right</span>=<span style="color: #ff0000;">&quot;10&quot;</span> top=<span style="color: #ff0000;">&quot;2&quot;</span> bottom=<span style="color: #ff0000;">&quot;2&quot;</span><span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&lt;/</span>s:Label<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; <br />
<span style="color: #66cc66;">&lt;/</span>s:SparkSkin<span style="color: #66cc66;">&gt;</span></div></td></tr></tbody></table></div>
<p>Just a blank skin with the label.</p>
<p><strong>My Problem with Early Beta Builds</strong><br />
When I first got into 9 Slice Scaling I thought that all you had to do is make a s:Group &#8211; which has scale9 build into it. However <strong>at the time</strong> if you didn&#8217;t include a background element that engulfed the entirety of the scaled item, then the skin came out horribly wrong.</p>
<p><strong>Current Solution</strong><br />
The Flex team has since listened to our pain and updated the 9 Slice Scaling process. Now my current solution looks as such:</p>
<div class="codecolorer-container actionscript dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br />51<br />52<br />53<br />54<br />55<br />56<br />57<br />58<br />59<br />60<br />61<br /></div></td><td><div class="actionscript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #66cc66;">&lt;</span>?<span style="color: #0066CC;">xml</span> <span style="color: #0066CC;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #66cc66;">&gt;</span><br />
<br />
<span style="color: #66cc66;">&lt;!</span>--<br />
<br />
&nbsp; &nbsp; ADOBE SYSTEMS INCORPORATED<br />
&nbsp; &nbsp; Copyright <span style="color: #cc66cc;">2008</span> Adobe Systems Incorporated<br />
&nbsp; &nbsp; All Rights Reserved.<br />
<br />
&nbsp; &nbsp; <span style="color: #006600;">NOTICE</span>: Adobe permits you to use, modify, <span style="color: #0066CC;">and</span> distribute <span style="color: #0066CC;">this</span> file<br />
&nbsp; &nbsp; <span style="color: #b1b100;">in</span> accordance <span style="color: #0066CC;">with</span> the terms of the license agreement accompanying it.<br />
<br />
--<span style="color: #66cc66;">&gt;</span><br />
<br />
<span style="color: #66cc66;">&lt;!</span>--- The <span style="color: #000000; font-weight: bold;">default</span> skin <span style="color: #000000; font-weight: bold;">class</span> <span style="color: #b1b100;">for</span> the Spark <span style="color: #0066CC;">Button</span> component. &nbsp;<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #66cc66;">@</span>see spark.<span style="color: #006600;">components</span>.<span style="color: #0066CC;">Button</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">@</span>langversion <span style="color: #cc66cc;">3.0</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">@</span>playerversion Flash <span style="color: #cc66cc;">10</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">@</span>playerversion AIR <span style="color: #cc66cc;">1.5</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">@</span>productversion Flex <span style="color: #cc66cc;">4</span><br />
--<span style="color: #66cc66;">&gt;</span><br />
<span style="color: #66cc66;">&lt;</span>s:SparkSkin xmlns:fx=<span style="color: #ff0000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span> xmlns:s=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/spark&quot;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;xmlns:fb=<span style="color: #ff0000;">&quot;http://ns.adobe.com/flashbuilder/2009&quot;</span> minWidth=<span style="color: #ff0000;">&quot;10&quot;</span> minHeight=<span style="color: #ff0000;">&quot;10&quot;</span> alpha.<span style="color: #006600;">disabled</span>=<span style="color: #ff0000;">&quot;0.5&quot;</span><span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #66cc66;">&lt;!</span>-- host component --<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&lt;</span>fx:Metadata<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&lt;!</span><span style="color: #66cc66;">&#91;</span>CDATA<span style="color: #66cc66;">&#91;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">/** <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* @copy spark.skins.spark.ApplicationSkin#hostComponent<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;*/</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#91;</span>HostComponent<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;spark.components.Button&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#93;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&lt;/</span>fx:Metadata<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #66cc66;">&lt;!</span>-- states --<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&lt;</span>s:states<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&lt;</span>s:State <span style="color: #0066CC;">name</span>=<span style="color: #ff0000;">&quot;up&quot;</span> <span style="color: #66cc66;">/&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&lt;</span>s:State <span style="color: #0066CC;">name</span>=<span style="color: #ff0000;">&quot;over&quot;</span> <span style="color: #66cc66;">/&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&lt;</span>s:State <span style="color: #0066CC;">name</span>=<span style="color: #ff0000;">&quot;down&quot;</span> <span style="color: #66cc66;">/&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&lt;</span>s:State <span style="color: #0066CC;">name</span>=<span style="color: #ff0000;">&quot;disabled&quot;</span> <span style="color: #66cc66;">/&gt;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&lt;/</span>s:states<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #66cc66;">&lt;</span>s:Group <span style="color: #0066CC;">left</span>=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #0066CC;">right</span>=<span style="color: #ff0000;">&quot;0&quot;</span> top=<span style="color: #ff0000;">&quot;0&quot;</span> bottom=<span style="color: #ff0000;">&quot;0&quot;</span> scaleGridLeft=<span style="color: #ff0000;">&quot;2&quot;</span> scaleGridRight=<span style="color: #ff0000;">&quot;8&quot;</span> scaleGridTop=<span style="color: #ff0000;">&quot;2&quot;</span> scaleGridBottom=<span style="color: #ff0000;">&quot;8&quot;</span><span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&lt;</span>s:Path <span style="color: #0066CC;">data</span>=<span style="color: #ff0000;">&quot;M 0 2 L 2 0 H 8 L 10 2 V 8 L 8 10 H 2 L 0 8 V 0 2&quot;</span><span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&lt;</span>s:fill<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&lt;</span>s:SolidColor <span style="color: #0066CC;">color</span>=<span style="color: #ff0000;">&quot;0x000000&quot;</span><span style="color: #66cc66;">/&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&lt;/</span>s:fill<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&lt;/</span>s:Path<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&lt;/</span>s:Group<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #66cc66;">&lt;!</span>-- <span style="color: #0066CC;">text</span> --<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&lt;</span>s:Label id=<span style="color: #ff0000;">&quot;labelDisplay&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;textAlign=<span style="color: #ff0000;">&quot;center&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;verticalAlign=<span style="color: #ff0000;">&quot;middle&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;maxDisplayedLines=<span style="color: #ff0000;">&quot;1&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;horizontalCenter=<span style="color: #ff0000;">&quot;0&quot;</span> verticalCenter=<span style="color: #ff0000;">&quot;1&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0066CC;">left</span>=<span style="color: #ff0000;">&quot;10&quot;</span> <span style="color: #0066CC;">right</span>=<span style="color: #ff0000;">&quot;10&quot;</span> top=<span style="color: #ff0000;">&quot;2&quot;</span> bottom=<span style="color: #ff0000;">&quot;2&quot;</span><span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&lt;/</span>s:Label<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; <br />
<span style="color: #66cc66;">&lt;/</span>s:SparkSkin<span style="color: #66cc66;">&gt;</span></div></td></tr></tbody></table></div>
<p>And we get the result that we see from the above image. The Group defines the Left/Right/Bottom/Top scale slices and the s:Path defines the shape to scale within the Group.</p>
<p>Again, this is a huge improvement to skinning with 9 Slice Scaling in Flex 3.</p>
<blockquote><p>
If you want more information on Spark Skinning check out some of my other posts:<br />
<a href="http://unitedmindset.com/jonbcampos/2009/07/02/flex-4-spark-skinning/">Flex 4 Spark Skinning</a><br />
<a href="http://unitedmindset.com/jonbcampos/2010/03/21/new-spark-skinning-workflow/">New Spark Skinning Workflow</a><br />
<a href="http://unitedmindset.com/jonbcampos/2009/11/09/flash-catalyst-the-missing-visual-editor/">Spark Skinning with Flash Catalyst</a>
</p></blockquote>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://unitedmindset.com/jonbcampos/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://unitedmindset.com/jonbcampos/2010/05/27/9-slice-scaling-with-spark-skinning/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Migrating From Flex 3 to Flex 4</title>
		<link>http://unitedmindset.com/jonbcampos/2010/05/25/migrating-from-flex-3-to-flex-4/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=migrating-from-flex-3-to-flex-4</link>
		<comments>http://unitedmindset.com/jonbcampos/2010/05/25/migrating-from-flex-3-to-flex-4/#comments</comments>
		<pubDate>Tue, 25 May 2010 15:00:26 +0000</pubDate>
		<dc:creator>Jonathan Campos</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[fx3]]></category>
		<category><![CDATA[fx4]]></category>
		<category><![CDATA[migrating]]></category>

		<guid isPermaLink="false">http://unitedmindset.com/jonbcampos/?p=1510</guid>
		<description><![CDATA[The other day I was invited by Adobe to present for the Tech Wednesday group on Migrating from Flex 3 to Flex 4. I want to throw out some special thanks to Deepa Subramaniam and Terry Ryan for help with some of the content. The recording of this presentation: Connect Recording And the slides: Migrating [...]]]></description>
			<content:encoded><![CDATA[<p>The other day I was invited by Adobe to present for the Tech Wednesday group on Migrating from Flex 3 to Flex 4. I want to throw out some special thanks to <a href="http://www.iamdeepa.com/blog/">Deepa Subramaniam</a> and <a href="http://www.terrenceryan.com/">Terry Ryan</a> for help with some of the content.</p>
<p>The recording of this presentation:<br />
<a href="http://experts.na3.acrobat.com/p14749775/">Connect Recording</a></p>
<p>And the slides:</p>
<div style="width:425px" id="__ss_4204168"><strong style="display:block;margin:12px 0 4px"><a href="http://www.slideshare.net/jonbcampos/migrating-fx3tofx4" title="Migrating fx3tofx4">Migrating fx3tofx4</a></strong><object id="__sse4204168" width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=migratingfx3tofx4-100521112032-phpapp02&#038;stripped_title=migrating-fx3tofx4" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed name="__sse4204168" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=migratingfx3tofx4-100521112032-phpapp02&#038;stripped_title=migrating-fx3tofx4" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object>
<div style="padding:5px 0 12px">View more <a href="http://www.slideshare.net/">presentations</a> from <a href="http://www.slideshare.net/jonbcampos">Jonathan Campos</a>.</div>
</div>
<blockquote><p>
I have other blog posts made to help with some of the common migration pitfalls:</p>
<p><a href="http://unitedmindset.com/jonbcampos/2009/06/16/migrating-from-flex-3-to-flash-builder-4-nonvisual-classes-in-mxml/">Migrating From Flex 3 to Flash Builder 4: Nonvisual Classes in MXML</a><br />
<a href="http://unitedmindset.com/jonbcampos/2009/06/06/migrating-from-flex-3-to-flash-builder-4-mxcoreapplication/">Migrating From Flex 3 to Flash Builder 4: mx.core.Application</a>
</p></blockquote>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://unitedmindset.com/jonbcampos/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://unitedmindset.com/jonbcampos/2010/05/25/migrating-from-flex-3-to-flex-4/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Dynamically Resizing Your Flex Application</title>
		<link>http://unitedmindset.com/jonbcampos/2010/05/18/dynamically-resizing-your-flex-application/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=dynamically-resizing-your-flex-application</link>
		<comments>http://unitedmindset.com/jonbcampos/2010/05/18/dynamically-resizing-your-flex-application/#comments</comments>
		<pubDate>Tue, 18 May 2010 15:00:40 +0000</pubDate>
		<dc:creator>Jonathan Campos</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[browser integration]]></category>
		<category><![CDATA[resizing]]></category>

		<guid isPermaLink="false">http://unitedmindset.com/jonbcampos/?p=1374</guid>
		<description><![CDATA[This post could also be titled: Using the browser scroll bar with a Flex Application. A few years ago I was struggling with getting the Mac Wheel and the PC Wheel to work with a Flex App I had made. So rather than getting both of those inputs to work, I just had the Flex [...]]]></description>
			<content:encoded><![CDATA[<p>This post could also be titled: Using the browser scroll bar with a Flex Application.</p>
<p>A few years ago I was struggling with getting the Mac Wheel and the PC Wheel to work with a Flex App I had made. So rather than getting both of those inputs to work, I just had the Flex app dynamically change the size of the browser and used the browser&#8217;s internal scrollbars to have the user go up and down the application.</p>
<p>This may sound difficult but it isn&#8217;t, just mix and match ExternalInterface with a few nice javascript calls and you&#8217;re good to go.</p>
<p>If you want to see the <a href="http://unitedmindset.com/jonbcampos/wp-content/flex_content/resizebrowser/ResizeBrowserTest.html" target="_blank">final product just follow this link</a>. You&#8217;ll need to just enter in the size you want to resize your app to and hit the button.<br />
<span id="more-1374"></span><br />
So let&#8217;s look at what we&#8217;ve put together.</p>
<p>First I wanted this class to be a Singleton. I did that because I wanted to be able to access editing the size of the application from anywhere &#8211; and as there is only one browser instance &#8211; a Singleton made sense.</p>
<p>Now there are at minimum two javascript functions that I will need to create for this example to work. The first function will need to pull the application&#8217;s id so that we can reference that id in javascript. The second javascript function will need to resize the flash application.</p>
<p>To get these javascript functions to work though we need to inject them into the dom. This is actually easier than you would think.</p>
<p>What I did was use the ExternalInterface to call a function to check if the javascript function existed. If it doesn&#8217;t, add it into the dom. Then from that point on you just need to call the function directly. This strategy is very helpful because you don&#8217;t have to change the template and make sure the functions already exist, instead you add them into your HTML page at runtime.</p>
<p>Once the functions exist you just call them and you&#8217;re done.</p>
<p>Here is the source for the Singleton class I&#8217;ve created. I will let you know now that some of the javascript functionality was stolen from the iFrame Google Code class. They did a great job!</p>
<div class="codecolorer-container actionscript dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br />51<br />52<br />53<br />54<br />55<br />56<br />57<br />58<br />59<br />60<br />61<br />62<br />63<br />64<br />65<br />66<br />67<br />68<br />69<br />70<br />71<br />72<br />73<br />74<br />75<br />76<br />77<br />78<br />79<br />80<br />81<br />82<br />83<br />84<br />85<br />86<br />87<br />88<br />89<br />90<br />91<br />92<br />93<br />94<br />95<br />96<br />97<br />98<br />99<br />100<br />101<br />102<br />103<br />104<br />105<br />106<br />107<br />108<br />109<br />110<br />111<br />112<br />113<br />114<br />115<br />116<br />117<br />118<br />119<br />120<br />121<br />122<br />123<br />124<br />125<br />126<br />127<br />128<br />129<br />130<br />131<br />132<br />133<br />134<br />135<br />136<br />137<br />138<br />139<br />140<br />141<br />142<br />143<br />144<br />145<br />146<br />147<br />148<br />149<br />150<br />151<br />152<br />153<br />154<br />155<br />156<br />157<br />158<br />159<br />160<br />161<br />162<br />163<br /></div></td><td><div class="actionscript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">package com.<span style="color: #006600;">unitedmindset</span>.<span style="color: #006600;">managers</span><br />
<span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">external</span>.<span style="color: #006600;">ExternalInterface</span>;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">/**<br />
&nbsp; &nbsp; &nbsp;* Resized the Browser. <br />
&nbsp; &nbsp; &nbsp;* @author jonbcampos<br />
&nbsp; &nbsp; &nbsp;* <br />
&nbsp; &nbsp; &nbsp;*/</span> <br />
&nbsp; &nbsp; <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> BrowserSizeManager<br />
&nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">//---------------------------------------------------------------------</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">//</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// &nbsp;Singleton Methods</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">//</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">//---------------------------------------------------------------------</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #0066CC;">static</span> <span style="color: #000000; font-weight: bold;">var</span> _instance:BrowserSizeManager;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> BrowserSizeManager<span style="color: #66cc66;">&#40;</span>enforcer:SingletonEnforcer<span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">//set up function</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ExternalInterface.<span style="color: #0066CC;">call</span><span style="color: #66cc66;">&#40;</span>INSERT_FUNCTION_ASK_FOR_EMBED_OBJECT_ID<span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ExternalInterface.<span style="color: #0066CC;">call</span><span style="color: #66cc66;">&#40;</span>INSERT_FUNCTION_RESIZE_FLASH_APP<span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">//get application id</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _resolveEmbedObjectId<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">public</span> <span style="color: #0066CC;">static</span> <span style="color: #000000; font-weight: bold;">function</span> getInstance<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:BrowserSizeManager<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">!</span>_instance<span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _instance = <span style="color: #000000; font-weight: bold;">new</span> BrowserSizeManager<span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> SingletonEnforcer<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> _instance;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">//---------------------------------------------------------------------</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">//</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// &nbsp;Private Properties</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">//</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">//---------------------------------------------------------------------</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _applicationId:<span style="color: #0066CC;">String</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _randomIdentificationString:<span style="color: #0066CC;">Number</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">//---------------------------------------------------------------------</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">//</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// &nbsp;Javascript Methods</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">//</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">//---------------------------------------------------------------------</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #0066CC;">static</span> const FUNCTION_RESIZE_FLASH_APP:<span style="color: #0066CC;">String</span> = <span style="color: #ff0000;">&quot;resizeFlashApp&quot;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #0066CC;">static</span> <span style="color: #000000; font-weight: bold;">var</span> INSERT_FUNCTION_RESIZE_FLASH_APP:<span style="color: #0066CC;">String</span> = <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">&quot;document.insertScript = function ()&quot;</span> +<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">&quot;{ &quot;</span> +<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">&quot;if (document.&quot;</span>+FUNCTION_RESIZE_FLASH_APP+<span style="color: #ff0000;">&quot;==null)&quot;</span> + <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">&quot;{&quot;</span> + <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; FUNCTION_RESIZE_FLASH_APP+<span style="color: #ff0000;">&quot; = function (embedId, height)&quot;</span> +<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">&quot;{ &quot;</span> +<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">&quot;var flashApp = document.getElementById(embedId);&quot;</span> +<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">&quot;flashApp.style.height = height+'px';&quot;</span> +<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">&quot;}&quot;</span> +<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">&quot;}&quot;</span> +<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">&quot;}&quot;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #0066CC;">static</span> const FUNCTION_ASK_FOR_EMBED_OBJECT_ID:<span style="color: #0066CC;">String</span> = <span style="color: #ff0000;">&quot;askForEmbedObjectId&quot;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">/**<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* The Javascript code to call to insert the function that prompts the DOM objects<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* to find the SWF object id.<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;*/</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #0066CC;">static</span> <span style="color: #000000; font-weight: bold;">var</span> INSERT_FUNCTION_ASK_FOR_EMBED_OBJECT_ID:<span style="color: #0066CC;">String</span> =<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">&quot;document.insertScript = function ()&quot;</span> +<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">&quot;{ &quot;</span> +<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">&quot;if (document.&quot;</span>+FUNCTION_ASK_FOR_EMBED_OBJECT_ID+<span style="color: #ff0000;">&quot;==null)&quot;</span> +<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">&quot;{ &quot;</span> +<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; FUNCTION_ASK_FOR_EMBED_OBJECT_ID+<span style="color: #ff0000;">&quot; = function(randomString) &quot;</span> + <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">&quot;{ &quot;</span> + <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">&quot;try { &quot;</span> + <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">&quot;var embeds = document.getElementsByTagName('embed'); &quot;</span> + <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">&quot;for (var i = 0; i &lt; embeds.length; i++) { &quot;</span> + <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">&quot;var isTheGoodOne = embeds[i].checkObjectId(embeds[i].getAttribute('id'),randomString); &quot;</span> + <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">&quot;if(isTheGoodOne) { &quot;</span> + <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">&quot;return embeds[i].getAttribute('id'); &quot;</span> + <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">&quot;} &quot;</span> +<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">&quot;} &quot;</span> +<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">&quot;var objects = document.getElementsByTagName('object'); &quot;</span> + <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">&quot;for(i = 0; i &lt; objects.length; i++) { &quot;</span> + <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">&quot;var isTheGoodOne = objects[i].checkObjectId(objects[i].getAttribute('id'),randomString); &quot;</span> + <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">&quot;if(isTheGoodOne) { &quot;</span> + <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">&quot;return objects[i].getAttribute('id'); &quot;</span> + <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">&quot;} &quot;</span> + <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">&quot;} &quot;</span> +<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">&quot;} catch(e) {} &quot;</span> +<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">&quot;return null; &quot;</span> + <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">&quot;} &quot;</span> +<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">&quot;} &quot;</span> + <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">&quot;}&quot;</span>;<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">//---------------------------------------------------------------------</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">//</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// &nbsp;Public Methods</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">//</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">//---------------------------------------------------------------------</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">/**<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* Resizes the browser to a set size. <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* @param height<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;*/</span> &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> resizeBrowser<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">height</span>:<span style="color: #0066CC;">Number</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ExternalInterface.<span style="color: #0066CC;">call</span><span style="color: #66cc66;">&#40;</span>FUNCTION_RESIZE_FLASH_APP, _applicationId, <span style="color: #0066CC;">height</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">//---------------------------------------------------------------------</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">//</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// &nbsp;Private Methods</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">//</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">//---------------------------------------------------------------------</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">/**<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* @private<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* Get's the application Id. <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;*/</span> &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> _resolveEmbedObjectId<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">!</span>_applicationId<span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">try</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _randomIdentificationString=<span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">ceil</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">random</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">*</span><span style="color: #cc66cc;">9999</span><span style="color: #66cc66;">*</span><span style="color: #cc66cc;">1000</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ExternalInterface.<span style="color: #006600;">addCallback</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'checkObjectId'</span>, checkObjectId<span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> result:<span style="color: #0066CC;">Object</span>=ExternalInterface.<span style="color: #0066CC;">call</span><span style="color: #66cc66;">&#40;</span>FUNCTION_ASK_FOR_EMBED_OBJECT_ID, _randomIdentificationString.<span style="color: #0066CC;">toString</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>result<span style="color: #66cc66;">!</span>=<span style="color: #000000; font-weight: bold;">null</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _applicationId=<span style="color: #0066CC;">String</span><span style="color: #66cc66;">&#40;</span>result<span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">//dang... fail</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span> <span style="color: #0066CC;">catch</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">error</span>:<span style="color: #0066CC;">Error</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">//dang... fail</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">//---------------------------------------------------------------------</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">//</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// &nbsp;Protected Methods</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">//</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">//---------------------------------------------------------------------</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">/**<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* Return check that the random number's match. <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* @param id<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* @param randomCode<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* @return <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;*/</span> &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; protected <span style="color: #000000; font-weight: bold;">function</span> checkObjectId<span style="color: #66cc66;">&#40;</span>id:<span style="color: #0066CC;">String</span>, randomCode:<span style="color: #0066CC;">Number</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">Boolean</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #66cc66;">&#40;</span>_randomIdentificationString==randomCode<span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />
<span style="color: #66cc66;">&#125;</span><br />
<span style="color: #000000; font-weight: bold;">class</span> SingletonEnforcer<span style="color: #66cc66;">&#123;</span><span style="color: #66cc66;">&#125;</span></div></td></tr></tbody></table></div>
<blockquote><p>Further Development:</p>
<p>To continue making the class just perfect you could also have the class return the current size of the browser so that the flex app isn&#8217;t set to lower than the visible browser. Also you could have a listener so when the browser resizes, the app resizes (because once you set the height, it&#8217;s fixed &#8211; unless you set back to 100%). You could also set up a queue system so that functions aren&#8217;t called multiple times on within a frame, just wait for the next Enter Frame.</p></blockquote>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://unitedmindset.com/jonbcampos/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://unitedmindset.com/jonbcampos/2010/05/18/dynamically-resizing-your-flex-application/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>
