<?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>Nate&#039;s Code Vault</title>
	<atom:link href="http://natescodevault.com/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://natescodevault.com</link>
	<description>from the dark recesses of an anxious mind</description>
	<lastBuildDate>Mon, 30 Aug 2010 04:24:21 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Transmission AS3 gets a logo and forum support!</title>
		<link>http://natescodevault.com/?p=268</link>
		<comments>http://natescodevault.com/?p=268#comments</comments>
		<pubDate>Mon, 30 Aug 2010 03:45:01 +0000</pubDate>
		<dc:creator>Nate</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[AIR 2.0]]></category>
		<category><![CDATA[Transmission]]></category>

		<guid isPermaLink="false">http://natescodevault.com/?p=268</guid>
		<description><![CDATA[Just finished making a logo for Transmission.  Let me take you through my revision process.
I first started with kind of a retro-ish look.

Then I kind of toyed with the radio tower idea in the Transmission name for a little bit:

It was OK, but I still wasn&#8217;t loving it.  So I went in a different direction:

Then [...]]]></description>
			<content:encoded><![CDATA[<p>Just finished making a logo for Transmission.  Let me take you through my revision process.</p>
<p>I first started with kind of a retro-ish look.</p>
<p><a rel="attachment wp-att-275" href="http://natescodevault.com/?attachment_id=275"><img class="aligncenter size-full wp-image-275" title="transmission_rev1" src="http://natescodevault.com/wp-content/uploads/2010/08/transmission_rev1.png" alt="transmission_rev1" width="128" height="128" /></a></p>
<p>Then I kind of toyed with the radio tower idea in the Transmission name for a little bit:</p>
<p><a rel="attachment wp-att-276" href="http://natescodevault.com/?attachment_id=276"><img class="aligncenter size-full wp-image-276" title="transmission_rev2" src="http://natescodevault.com/wp-content/uploads/2010/08/transmission_rev2.png" alt="transmission_rev2" width="282" height="65" /></a></p>
<p>It was OK, but I still wasn&#8217;t loving it.  So I went in a different direction:</p>
<p><a rel="attachment wp-att-277" href="http://natescodevault.com/?attachment_id=277"><img class="aligncenter size-full wp-image-277" title="transmission_rev3" src="http://natescodevault.com/wp-content/uploads/2010/08/transmission_rev3.png" alt="transmission_rev3" width="282" height="65" /></a></p>
<p>Then finally I settled on a logo I liked.  Kind of coming full circle but with a more modern look.</p>
<p><a rel="attachment wp-att-269" href="http://natescodevault.com/?attachment_id=269"><img class="aligncenter size-full wp-image-269" title="transmission_logo_full" src="http://natescodevault.com/wp-content/uploads/2010/08/transmission_logo_full.png" alt="transmission_logo_full" width="285" height="77" /></a></p>
<p>I&#8217;m definitely not a designer and it&#8217;s pretty simple, but I kinda like it.  Let me know what you think!</p>
<p>We also have a <a title="Transmission forums" href="http://groups.google.com/group/transmission-as3" target="_self">forum</a> set up for questions.</p>
<p>As always, the code is hosted <a title="Transmission code" href="http://code.google.com/p/transmission-as3/" target="_self">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://natescodevault.com/?feed=rss2&amp;p=268</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Transmission AIR 2 to Java &#8212; Hide Java from Mac Dock</title>
		<link>http://natescodevault.com/?p=260</link>
		<comments>http://natescodevault.com/?p=260#comments</comments>
		<pubDate>Sun, 29 Aug 2010 16:35:03 +0000</pubDate>
		<dc:creator>Nate</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[AIR 2.0]]></category>
		<category><![CDATA[Transmission]]></category>

		<guid isPermaLink="false">http://natescodevault.com/?p=260</guid>
		<description><![CDATA[Often when developing an application for AIR 2.0 we realize that for whatever reason we simply can&#8217;t accomplish the task at hand without involving another language such as Java.  There are several reasons why this might be the case, the fact that AIR 2.0 doesn&#8217;t work with non-storage USB devices such as a MIDI [...]]]></description>
			<content:encoded><![CDATA[<p>Often when developing an application for AIR 2.0 we realize that for whatever reason we simply can&#8217;t accomplish the task at hand without involving another language such as Java.  There are several reasons why this might be the case, the fact that AIR 2.0 doesn&#8217;t work with non-storage USB devices such as a MIDI piano, another might be the use of Java multi-threaded capabilities for time sensitive operations that won&#8217;t bog down your UI.  For developers looking to easily integrate the 2 languages, <a href="http://code.google.com/p/transmission-as3">Transmission</a> holds the key for quick and effective communication between AIR and Java using AMF.</p>
<p>One pitfall I came across a few months ago dealt with the fact that Java applications always show up on the Mac dock, even while using Transmission.  This is problematic because starting up an AIR application which starts up Java shows 2 applications running on the Mac dock.  This might be confusing for users, plus it gives them the opportunity to kill the Java application which inhibits your AIR application from taking advantage of Java.  To resolve this issue I have provided a fix.  On the Windows side, you don&#8217;t need to worry.  Java will only show itself in the windows toolbar if UI code is present.  Otherwise it will be hidden by default.</p>
<p>The process to do this on a Mac is to wrap your application&#8217;s jars in a Mac OS X application.  To do this, we need to use a Utility called Jar Bundler.  This should be found here: /Developer/Applications/Utilities or you can pull it up in Spotlight.  When you open the application, you should see a screen like this:</p>
<div id="attachment_261" class="wp-caption aligncenter" style="width: 661px"><a rel="attachment wp-att-261" href="http://natescodevault.com/?attachment_id=261"><img class="size-full wp-image-261" title="Jar Bundler" src="http://natescodevault.com/wp-content/uploads/2010/08/Jar-Bundler.png" alt="Jar Bundler allows jars to be wrapped as an OSX application" width="651" height="599" /></a><p class="wp-caption-text">Jar Bundler allows jars to be wrapped as an OSX application</p></div>
<p>Here are the steps you&#8217;ll need to take in order to get an application:</p>
<p>1. Click on Choose next to the Main Class option.  Next, navigate to Transmission.jar that came with the transmission project and select it.  It should populate the Main Class field with transmission.Transmission automatically.</p>
<p>2. Under arguments type: -transmissionControllerPackage transmission.demo.TransmissionDemoController.  For your own project replace the TransmissionDemoController package with your own TransmissionController&#8217;s package and class name (make sure your own TransmissionController implements ITransmissionController).</p>
<p>3. Select the Classpath and Files tab and choose all other jars that belong to your project besides the Transmission jar you added in step 1.</p>
<p>4. Choose some properties in the Properties tab.</p>
<p>5. Click Create Application and choose a destination for the new application.</p>
<p>Bam!  Your application is completed.  Now we need to make sure it hides itself when it is run.  Right click on your application and choose &#8220;Show package contents&#8221;.  Navigate to Contents and open the Info.plist file.  This file contains the preferences you set in the Jar Bundler.  To make the application hide we need to add a couple more.  Before the Java item, add the following rows</p>
<p>1.  LSUIElement (in the value column enter &#8220;1&#8243;)</p>
<p>2. NSUIElement (in the value column enter &#8220;1&#8243;)</p>
<p>Your plist should now look something like this: <a rel="attachment wp-att-262" href="http://natescodevault.com/?attachment_id=262"><img class="aligncenter size-full wp-image-262" title="plist" src="http://natescodevault.com/wp-content/uploads/2010/08/plist.png" alt="plist" width="670" height="390" /></a></p>
<p>The last thing we need to do is configure the application inside of your Flex Transmission configuration.  In your Flex project, rather than doing Transmission.init() using the Java executable, the TransmissionController package, and the array of classpaths, simply do the following:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p260code2'); return false;">View Code</a> ACTIONSCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p2602"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p260code2"><pre class="actionscript" style="font-family:monospace;">Transmission.<span style="color: #006600;">getInstance</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">init</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;path/to/app/DemoApplication.app/Contents/MacOS/JavaApplicationStub&quot;</span><span style="color: #66cc66;">&#41;</span>;</pre></td></tr></table></div>

<p>Now everything should work!</p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://natescodevault.com/?feed=rss2&amp;p=260</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Transmission &#8211; AIR 2 to Java Communication Layer</title>
		<link>http://natescodevault.com/?p=258</link>
		<comments>http://natescodevault.com/?p=258#comments</comments>
		<pubDate>Mon, 23 Aug 2010 15:24:25 +0000</pubDate>
		<dc:creator>Nate</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[AIR 2.0]]></category>
		<category><![CDATA[Transmission]]></category>

		<guid isPermaLink="false">http://natescodevault.com/?p=258</guid>
		<description><![CDATA[A few months ago I wrote a few posts dealing with how to create a Merapi AIR to Java production environment.  If any of you have read those posts or tried doing it yourself you&#8217;d realize what a tricky and cumbersome process it is.  Now with AIR 2.0, we have native process available [...]]]></description>
			<content:encoded><![CDATA[<p>A few months ago I wrote a few posts dealing with how to create a Merapi AIR to Java production environment.  If any of you have read those posts or tried doing it yourself you&#8217;d realize what a tricky and cumbersome process it is.  Now with AIR 2.0, we have native process available which allows us to reduce this workload significantly.  To really take advantage of this new functionality, I built an AIR 2.0 to Java communication layer called Transmission.  No more custom installers, requiring Java to start AIR, and keep-alive processes to ensure Java is still running.</p>
<p>While architecting this, I decided I wanted to create an environment that would be familiar for people coming from Merapi.  There is still a concept of Message objects and MessageHandlers which respond whenever a Message object with its registered type is passed across Transmission.  The library is being <a href="http://code.google.com/p/transmission-as3">hosted on Google Code</a> and is licensed under the Apache 2.0 license which gives you the freedom to use it in commercial applications.  I included a demo in the repo that should help you get started.</p>
]]></content:encoded>
			<wfw:commentRss>http://natescodevault.com/?feed=rss2&amp;p=258</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>New AIR/Java app Piano Marvel hits the AIR Marketplace!</title>
		<link>http://natescodevault.com/?p=241</link>
		<comments>http://natescodevault.com/?p=241#comments</comments>
		<pubDate>Tue, 25 Aug 2009 14:27:24 +0000</pubDate>
		<dc:creator>Nate</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Merapi]]></category>
		<category><![CDATA[Piano Marvel]]></category>

		<guid isPermaLink="false">http://natescodevault.com/?p=241</guid>
		<description><![CDATA[Over the past year at Rain Interactive, I have spent all my time and energy as project manager and lead developer on the most revolutionary piano teaching software to date called Piano Marvel (not that I&#8217;m biased or anything  .  This unveiling also reveals the inspiration behind most of my posts over the last year.  Our team&#8217;s goal was to [...]]]></description>
			<content:encoded><![CDATA[<p>Over the past year at <a title="Rain Interactive website" href="http://www.mediarain.com">Rain Interactive</a>, I have spent all my time and energy as project manager and lead developer on the most revolutionary piano teaching software to date called <a title="Piano Marvel website" href="http://www.pianomarvel.com" target="_blank">Piano Marvel</a> (not that I&#8217;m biased or anything <img src='http://natescodevault.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .  This unveiling also reveals the inspiration behind most of my posts over the last year.  Our team&#8217;s goal was to create an application that could display interactive sheet music, record keystrokes on a MIDI keyboard, allow toggling of metronome and accompaniment playback, and give an evaluation based on the notes that were pressed.  The application has been in beta for a few months now and we have been amazed with the feedback we have received from students and teachers across the nation.<span id="more-241"></span></p>
<p>We decided to build Piano Marvel&#8217;s rich front-end with Adobe AIR because we have a lot of Flex expertise at Rain and the development time required to create beautiful UIs using this technology is very quick.  However, in order to make this application work, we also had to leverage Java in order to interact with a MIDI Keyboard since AIR is not able to do this natively.  Finally, we used Merapi to manage the communication between AIR and the invisible Java process through a socket.</p>
<p>Here are some of the amazing things we have been able to do with Piano Marvel:</p>
<p>1.  Create a rich interactive music notation engine.</p>
<p><a rel="attachment wp-att-243" href="http://natescodevault.com/?attachment_id=243"><img class="aligncenter size-full wp-image-243" title="pianomarvel_tooltip" src="http://natescodevault.com/wp-content/uploads/2009/08/pianomarvel_tooltip.png" alt="pianomarvel_tooltip" width="500" height="379" /></a></p>
<p>2.  Display immediate feedback on all correct and incorrect notes that were played.</p>
<p><a rel="attachment wp-att-242" href="http://natescodevault.com/?attachment_id=242"><img class="aligncenter size-full wp-image-242" title="pianomarvel_scoring" src="http://natescodevault.com/wp-content/uploads/2009/08/pianomarvel_scoring.png" alt="pianomarvel_scoring" width="500" height="209" /></a></p>
<p>3.  Have the ability to specify tempo, make music selections, and toggle fun accompaniment and metronome playback.</p>
<p><a rel="attachment wp-att-244" href="http://natescodevault.com/?attachment_id=244"><img class="aligncenter size-full wp-image-244" title="pianomarvel_controls" src="http://natescodevault.com/wp-content/uploads/2009/08/pianomarvel_controls.png" alt="pianomarvel_controls" width="500" height="124" /></a></p>
<p>4.  Create an environment that makes playing the piano addictive and entertaining</p>
<p><a rel="attachment wp-att-245" href="http://natescodevault.com/?attachment_id=245"><img class="aligncenter size-full wp-image-245" title="pianomarvel_lessons" src="http://natescodevault.com/wp-content/uploads/2009/08/pianomarvel_lessons.png" alt="pianomarvel_lessons" width="500" height="343" /></a></p>
<p>Piano Marvel has just hit the <a title="Adobe AIR Marketplace - Piano Marvel" href="http://www.adobe.com/cfusion/marketplace/index.cfm?event=marketplace.offering&amp;offeringid=11861&amp;marketplaceid=1" target="_blank">Adobe AIR Marketplace</a> as the first application that is not a traditional completely AIR application.  There is a free trial (no credit card required) that lasts for a month and if you download the application from the AIR Marketplace, it costs $12/month (instead of the usual $15).</p>
<p>Please get a MIDI keyboard and USB/MIDI connector and try it out.  Let me know what you think below!</p>
]]></content:encoded>
			<wfw:commentRss>http://natescodevault.com/?feed=rss2&amp;p=241</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Add alpha transparency to your DataGrid using StyleableDataGrid</title>
		<link>http://natescodevault.com/?p=229</link>
		<comments>http://natescodevault.com/?p=229#comments</comments>
		<pubDate>Sat, 01 Aug 2009 20:13:04 +0000</pubDate>
		<dc:creator>Nate</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[DataGrid]]></category>
		<category><![CDATA[StyleableDataGrid]]></category>

		<guid isPermaLink="false">http://natescodevault.com/?p=229</guid>
		<description><![CDATA[Recently, I ran into another issue with DataGrids.  I received a design comp from one of our designers who wanted alpha transparency in a DataGrid for alternating rows, the header, and highlight/selection.  Basically, he wanted something like this (I added a red gradient and vertical stripes on the background to make the alpha more apparent):

After [...]]]></description>
			<content:encoded><![CDATA[<p>Recently, I ran into another issue with DataGrids.  I received a design comp from one of our designers who wanted alpha transparency in a DataGrid for alternating rows, the header, and highlight/selection.  Basically, he wanted something like this (I added a red gradient and vertical stripes on the background to make the alpha more apparent):</p>
<p><a rel="attachment wp-att-233" href="http://natescodevault.com/?attachment_id=233"><img class="aligncenter size-full wp-image-233" title="StyleableDataGrid" src="http://natescodevault.com/wp-content/uploads/2009/08/StyleableDataGrid1.jpg" alt="StyleableDataGrid" width="265" height="145" /></a></p>
<p>After a quick look through the styles and properties of Flex 3&#8217;s DataGrid, I discovered that I wouldn&#8217;t be able to do these three requests unless I (once again) subclassed the DataGrid to add these behaviors.</p>
<p>In this component, I added the following styles:</p>
<p><code><br />
rollOverAlpha<br />
selectionAlpha<br />
alternatingItemAlphas (complements alternatingItemColors)<br />
headerAlphas<br />
headerSeparator (boolean -- draws the column separator on the header)<br />
</code></p>
<p>Note that the alternatingItemAlphas will not appear to work unless DataGrid&#8217;s backgroundAlpha style is set to zero.</p>
<p>To see an example with View Source enabled, <a title="See StyleableDataGrid in action" href="http://natescodevault.com/Flex/StyleableDataGrid/" target="_blank">click here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://natescodevault.com/?feed=rss2&amp;p=229</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>YouTube Embedded Player HTML Component</title>
		<link>http://natescodevault.com/?p=223</link>
		<comments>http://natescodevault.com/?p=223#comments</comments>
		<pubDate>Mon, 27 Jul 2009 03:14:30 +0000</pubDate>
		<dc:creator>Nate</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[YouTube]]></category>

		<guid isPermaLink="false">http://natescodevault.com/?p=223</guid>
		<description><![CDATA[A few months ago, I needed a quick way to include YouTube video content into an AIR application I was making.  Initially, I looked into creating my own video player and trying to use the as3youtubelib, however I ran into people who had many issues with YouTube changing their API which lead to broken videos.  I decided to [...]]]></description>
			<content:encoded><![CDATA[<p>A few months ago, I needed a quick way to include YouTube video content into an AIR application I was making.  Initially, I looked into creating my own video player and trying to use the <a title="as3youtubelib" href="http://www.adobe.com/cfusion/communityengine/index.cfm?event=showdetails&amp;postId=5741&amp;productId=2" target="_blank">as3youtubelib</a>, however I ran into people who had many <a title="as3youtubelib issue" href="http://code.google.com/p/as3youtubelib/issues/detail?id=3" target="_blank">issues</a> with YouTube changing their API which lead to broken videos.  I decided to avoid the hassles and time constraints of this approach and instead opted for another one.</p>
<div id="attachment_224" class="wp-caption aligncenter" style="width: 526px"><a rel="attachment wp-att-224" href="http://natescodevault.com/?attachment_id=224"><img class="size-full wp-image-224" title="youtubehtml_component" src="http://natescodevault.com/wp-content/uploads/2009/07/youtubehtml_component.jpg" alt="YouTubeHTML Component" width="516" height="477" /></a><p class="wp-caption-text">YouTubeHTML Component</p></div>
<p>I discovered <a title="YouTUbe Embedded Player Parameters API" href="http://code.google.com/apis/youtube/player_parameters.html">YouTube&#8217;s Embedded Player URL Parameters API</a> and decided to investigate the possibility of using an HTML component to point to a video on YouTube and change several optional parameters until the video player met my needs.  Turns out that this approach was extremely simple and worked beautifully.  To ease the transition of other developers learning the YouTube&#8217;s API, I decided to extend AIR&#8217;s HTML component and open up properties which could set the parameters automatically.  Note that because this component is based on the HTML component, <strong>it only works in AIR.</strong></p>
<p>Download the code <a title="Get the YouTubeHTML component here!" href="http://natescodevault.com/Flex/YouTubeHTML/YouTubeWindowExample.zip">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://natescodevault.com/?feed=rss2&amp;p=223</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>NestedDataGrid version 2.0 &#8211; XML dataProviders</title>
		<link>http://natescodevault.com/?p=210</link>
		<comments>http://natescodevault.com/?p=210#comments</comments>
		<pubDate>Sat, 27 Jun 2009 17:02:48 +0000</pubDate>
		<dc:creator>Nate</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[NestedDataGrid]]></category>

		<guid isPermaLink="false">http://natescodevault.com/?p=210</guid>
		<description><![CDATA[A few months ago, I created a component called NestedDataGrid, to address the annoying issue with DataGrids not being able to support nested properties within objects.  This component allows a DataGridColumn&#8217;s dataField property to contain a property chain such as:  &#8220;object.property.propertyList[2]&#8220;.  This is something that wasn&#8217;t possible with a default DataGrid.  However, being busy with school (just [...]]]></description>
			<content:encoded><![CDATA[<p><a title="NestedDataGrid" href="http://natescodevault.com/?p=61" target="_self">A few months ago</a>, I created a component called NestedDataGrid, to address the annoying issue with DataGrids not being able to support nested properties within objects.  This component allows a DataGridColumn&#8217;s dataField property to contain a property chain such as:  &#8220;object.property.propertyList[2]&#8220;.  This is something that wasn&#8217;t possible with a default DataGrid.  However, being busy with school (just got my <a title="BYU's MISM program" href="http://marriottschool.byu.edu/mism/" target="_blank">master&#8217;s degree</a> in April!  wahoo!) and work, I didn&#8217;t have time to build in support for XML-based dataProviders.  After a few requests, I decided to change that and update the NestedDataGrid to support XML.</p>
<p><a rel="attachment wp-att-219" href="http://natescodevault.com/?attachment_id=219"><img class="aligncenter size-full wp-image-219" title="NestedDataGrid" src="http://natescodevault.com/wp-content/uploads/2009/06/nesteddatagrid_code.png" alt="NestedDataGrid" width="486" height="136" /></a></p>
<p>As of today, the NestedDataGrid can display and sort complex Nested XML dataFields such as:  &#8220;xml.node.nodeList[3].@attribute&#8221;.  I hope that this update helps ease the frustration of having to flatten XML trees, define custom label functions and/or sort functions, or create custom item renderers to get around this issue.</p>
<p>See the demo and get the source <a title="NestedDataGrid example and source" href="http://natescodevault.com/Flex/NestedDataGrid/NestedDataGrid.html" target="_blank"><strong><span style="color: #0860a8;">here</span></strong></a> (Right click to View and Download Source).</p>
]]></content:encoded>
			<wfw:commentRss>http://natescodevault.com/?feed=rss2&amp;p=210</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>XML syntax highlighter for FlexBuilder</title>
		<link>http://natescodevault.com/?p=201</link>
		<comments>http://natescodevault.com/?p=201#comments</comments>
		<pubDate>Sat, 20 Jun 2009 17:20:33 +0000</pubDate>
		<dc:creator>Nate</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[dtd]]></category>
		<category><![CDATA[FlexBuilder]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[syntax highlighting]]></category>
		<category><![CDATA[xml]]></category>
		<category><![CDATA[XMLBuddy]]></category>

		<guid isPermaLink="false">http://natescodevault.com/?p=201</guid>
		<description><![CDATA[So a few days ago, I began a quest to find a good XML syntax highlighter for FlexBuilder.  Up until now I have been content to limp by using Eclipse&#8217;s standard text viewer for XML files, but if I am trying to debug a huge ant script or configuration XML file, the non-colored code just [...]]]></description>
			<content:encoded><![CDATA[<p>So a few days ago, I began a quest to find a good XML syntax highlighter for FlexBuilder.  Up until now I have been content to limp by using Eclipse&#8217;s standard text viewer for XML files, but if I am trying to debug a huge ant script or configuration XML file, the non-colored code just doesn&#8217;t work well for me.   I am aware that there is an XML viewer built into Eclipse as well, but I hate the XML tree node viewers with a passion, so that wasn&#8217;t an option.<span id="more-201"></span></p>
<p>Finally, after screwing up a build-config.xml file because I didn&#8217;t notice a line was commented out when it shouldn&#8217;t have been, I went on a hunt for an XML syntax highlighter.  So, I got on <a title="Eclipse Plugin Central" href="http://www.eclipseplugincentral.com/" target="_blank">Eclipse&#8217;s plugin site</a> and started searching.</p>
<div id="attachment_202" class="wp-caption alignright" style="width: 310px"><a href="http://www.xmlbuddy.com/"><img class="size-medium wp-image-202" title="eclipse" src="http://natescodevault.com/wp-content/uploads/2009/06/eclipse-300x232.jpg" alt="XMLBuddy for Eclipse" width="300" height="232" /></a><p class="wp-caption-text">XMLBuddy for Eclipse</p></div>
<p>After trying a couple out, I found one that was compatible and had the features I was looking for&#8230; drum roll please&#8230; <a title="XMLBuddy for Eclipse" href="http://www.xmlbuddy.com" target="_blank">XMLBuddy</a>!  This little buddy supports user configurable syntax highlighting for all sorts of XML tags.  It also offers XML code complete that is driven by the DTD or current document contents.  It also has a tree outline view that you can use and it even lets you generate a DTD from an example XML document.</p>
<p>To get it working with FlexBuilder, first go to <a title="XMLBuddy for Eclipse" href="http://www.xmlbuddy.com" target="_blank">XMLBuddy.com</a> and select download.  Accept the agreement and choose XMLBuddy (there is also a professional version with even more features that you can pay for if you want &#8212; I decided to use the free one).  There are a few different versions of the plugin that you can use based on your version of Eclipse.  I found that 2.0.9 worked great with Flex Builder 3.  To install it, go to your FB install directory (Program Files/Adobe/FlexBuilder for PC or Applications/Adobe/FlexBuilder on Mac).  Then unzip the XMLBuddy files unto your plugins directory.</p>
<p>After you have installed XMLBuddy, restart Flex Builder if it is running.  Then try to open an XML file.  If it is highlighted, you are done.  If it isn&#8217;t, go to Window &#8211;&gt; Preferences and search for &#8220;File Associations&#8221;.  Make sure that all *.xml or *.dtd files have XMLBuddy associated with them and that XMLBuddy is the default editor for these file types.  If you want to configure XMLBuddy, you can find it in Window &#8211;&gt; Preferences &#8211;&gt; XMLBuddy.</p>
]]></content:encoded>
			<wfw:commentRss>http://natescodevault.com/?feed=rss2&amp;p=201</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Creating a bundled AIR / Java Installer on a Mac</title>
		<link>http://natescodevault.com/?p=172</link>
		<comments>http://natescodevault.com/?p=172#comments</comments>
		<pubDate>Sat, 16 May 2009 04:31:03 +0000</pubDate>
		<dc:creator>Nate</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[AIR bundled runtime]]></category>
		<category><![CDATA[Mac installer]]></category>
		<category><![CDATA[Merapi]]></category>

		<guid isPermaLink="false">http://natescodevault.com/?p=172</guid>
		<description><![CDATA[A few weeks ago, I wrote a post detailing how to use Merapi in a Production Environment. That tutorial was primarily written to address managing Java and AIR on a Windows Platform including creating an installer that installs both the Adobe AIR Runtime, the Java-side of an application, and the AIR-side of an application. However, [...]]]></description>
			<content:encoded><![CDATA[<p>A few weeks ago, I wrote a post detailing how to use <a href="http://natescodevault.com/?p=102">Merapi in a Production Environment</a>. That tutorial was primarily written to address managing Java and AIR on a Windows Platform including creating an installer that installs both the Adobe AIR Runtime, the Java-side of an application, and the AIR-side of an application. However, I realized that I was neglecting those OS X enthusiasts out there, so this article is for you guys! However, I would still recommend reading <a href="http://natescodevault.com/?p=102">Merapi in a Production Environment</a> first for an in-depth overview of integrating Java and AIR through Merapi as this post is only for creating a Mac bundled installer.</p>
<p>The first thing I noticed while trying to make a Mac installer with the bundled Adobe AIR Runtime is that there is relatively little out there that addresses this issue. While there are some resources provided by Adobe after <a href="http://www.adobe.com/products/air/runtime_distribution1.html">applying for a distribution license</a>, there were still some questions that I had to answer on my own. What will follow is a step-by-step approach that I took to create a Mac installer.</p>
<h3>1. Create a Java Installer</h3>
<p>The Java installer will serve as the core of our installer. It is responsible for copying class files and jars into the Applications directory and it is also responsible for executing the Adobe AIR Runtime installer which will install both the AIR Runtime on the user&#8217;s computer (if they don&#8217;t have it already), and installing the AIR-side of the application. Much of this portion I discovered through <a href="http://www.centerkey.com/mac/java/">this post</a> and I won&#8217;t go into as much detail as Dem Pilafian covers that material very well.</p>
<p>The tool that I used to initially create a bundled Java app is called &#8220;Jar Bundler&#8221;. It is located in Developer/Applications/Utilities and is part of XCode. This tool allows you to specify your Main Class, any additional Classes or Jars that are part of the library, an icon, and some configuration options. When you click on the &#8220;Create Application&#8221; button, you will see that a MyJavaApp.app bundle is created. If you right-click the app bundle and select &#8220;Show Contents&#8221;, you will see what Jar Bundler created for you. In the Contents folder you will see a PList file (XML-based file which contains the properties for the application), a folder called MacOS which contains the executable, and another folder called Resouces which contains your icon and a subfolder called Java with all the Class and Jar files contained in your Java Application.</p>
<p>At this point you may also have realized what a pain the Jar Bundler is! If you haven&#8217;t yet, you will realize it the ump-teenth time you need to create another version of the installer. It doesn&#8217;t save an XML configuration file <a href="http://natescodevault.com/?p=102">like Launch4j does</a> on the PC, nor does it remember where your previous files selections were so you have to navigate through your Java application looking for class and jar files every single time. Plus, Jar Bundler does not support every application configuration option for your application.  That means you have to go into the PList file and do it manually every time.</p>
<p>To solve this problem, I wrote a script which automatically builds the jar files I need and copies them into MyJavaApp.app/Contents/Resources/Java automatically. It also overwrites the PList file that is generated by Jar Bundler to give me more configuration options. Basically, the only thing that remains from Jar Bundler is the executable.</p>
<h3>2. Include the AIR Application inside the bundle</h3>
<p>After you get the Java bundle set up, it is time to include the AIR portion of the application. Inside of MyJavaApp.app/Contents/Resources, create a directory called AIR. This directory will contain the Adobe AIR Runtime and MyAirApp.air. During the install process we will run the AIR Runtime and pass it a reference to MyAirApp.air to be installed with the runtime.</p>
<h3>3. Create an Install Package</h3>
<p>With the application bundle in place, we now need to generate an installer. This can be done by using PackageMaker (Developer/Applications/Utilities) or a third party app called <a href="http://s.sudre.free.fr/Software/Iceberg.html">Iceberg</a>. I prefer Iceberg due to its intuitive user interface and step-by-step process, however the choice is up to you although I will use Iceberg throughout this tutorial.</p>
<p>Mac install packages are very handy and much easier to create than Windows EXE executables in my opinion. However there are a few things to keep in mind. If you have any custom welcome text, license information, or README this can be displayed in the installer as well. Iceberg allows you to specify text files for each of these three functions in the Documents section. Also, there are Perl or Bash scripts that can be executed during different stages of the install process. You can find these in the Scripts section of Iceberg in their order of execution.</p>
<ul>
<li><strong>preinstall:</strong>  This script is run before files are installed.</li>
<li><strong>preinstall:</strong>  This script is run after the preinstall script, but before files are installed.  This script is only run if the application has not been installed previously on the target machine.</li>
<li><strong>preupgrade:</strong>  This script is run after the preinstall script, but before files are installed.  This script is only run if the application has already been installed on the target machine.</li>
<li><strong>postinstall:</strong>  This script is run after files have been installed and before the postflight script.  This script is only run if the application has no been installed previously on the target machine.</li>
<li><strong>postupgrade:</strong>  This script is run after files have been installed and before the postflight script.  This script is only run if the application has already been installed on the target machine.</li>
<li><strong>postflight:</strong>  This script is run after files have been installed.</li>
</ul>
<p>Also, keep in mind that each script must return zero.  If it doesn&#8217;t, the installer will determine that they have failed.  For my application, I created a preflight script that checked to see if there were any previous versions of the app and then I removed them.  I also created a postflight script that installed the .air application inside of the already created MyApp.air inside of the Applications directory.  The script contained a couple of lines that looked something like this:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p172code4'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p1724"><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code" id="p172code4"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>Applications<span style="color: #000000; font-weight: bold;">/</span>myApp.app<span style="color: #000000; font-weight: bold;">/</span>Contents<span style="color: #000000; font-weight: bold;">/</span>Resources<span style="color: #000000; font-weight: bold;">/</span>AIR
&nbsp;
Adobe_AIR_Installer.app<span style="color: #000000; font-weight: bold;">/</span>Contents<span style="color: #000000; font-weight: bold;">/</span>MacOS<span style="color: #000000; font-weight: bold;">/</span>Adobe\ AIR\ Installer -silent -location <span style="color: #000000; font-weight: bold;">/</span>Applications<span style="color: #000000; font-weight: bold;">/</span>myApp.app<span style="color: #000000; font-weight: bold;">/</span>Contents<span style="color: #000000; font-weight: bold;">/</span>Resources<span style="color: #000000; font-weight: bold;">/</span>AIR MyAirApp.air</pre></td></tr></table></div>

<div class="line">Note that the Adobe_AIR_Installer.app is the AIR Runtime Installer and myApp.app is the application bundle that contains the Java application made by the Jar Bundler with the AIR files inside of an AIR directory.  The second line basically makes a call to the &#8220;Adobe AIR Installer&#8221; executable and tells it to run silently.  It also specifies where the AIR application will be installed (The AIR directory), and the path to MyAirApp.air.</div>
<p>Now that I have explained some of the components of a Package, let&#8217;s open up Iceberg and get started.  First, create a new project and go through each of the steps customizing the installer to fit your specifications.  Add any custom text files or scripts and then define where your app will be installed.  I put MyApp.app under the Applications directory.  When you are finished configuring the package, go to the Build menu and select Build and Run.  This will allow you to test your package and scripts to see how well they work.  Also, make sure to save your project when you are finished.  This will keep your configuration settings as a .packproj file that you can use to make future builds.</p>
]]></content:encoded>
			<wfw:commentRss>http://natescodevault.com/?feed=rss2&amp;p=172</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Making Yahoo&#8217;s AutoCompleteManager work with defaultButton</title>
		<link>http://natescodevault.com/?p=164</link>
		<comments>http://natescodevault.com/?p=164#comments</comments>
		<pubDate>Wed, 29 Apr 2009 17:29:09 +0000</pubDate>
		<dc:creator>Nate</dc:creator>
				<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://natescodevault.com/?p=164</guid>
		<description><![CDATA[I recently came across a discussion on LinkedIn about what AutoComplete solutions are out there for Flex. I never realized how many AutoComplete implementations are out there! As for myself, I have only tried two&#8230; the first was Adobe&#8217;s AutoComplete component and the second was Yahoo&#8217;s AutoCompleteManager.
I tried Adobe&#8217;s AutoComplete component first because I figured [...]]]></description>
			<content:encoded><![CDATA[<p>I recently came across a discussion on LinkedIn about what AutoComplete solutions are out there for Flex. I never realized how many AutoComplete implementations are out there! As for myself, I have only tried two&#8230; the first was <a href="http://www.adobe.com/cfusion/exchange/index.cfm?event=extensionDetail&amp;extid=1047291">Adobe&#8217;s AutoComplete component</a> and the second was <a href="http://developer.yahoo.com/flash/astra-flex/autocompletemanager/">Yahoo&#8217;s AutoCompleteManager</a>.<span id="more-164"></span></p>
<p>I tried Adobe&#8217;s AutoComplete component first because I figured it would be the best. I mean, come on, it&#8217;s Adobe right? Didn&#8217;t they write the Flex framework or something? This component is based off of a ComboBox which allows for a slick looking animated dropdown, plus it comes with hooks to tie into Local Storage. After closer inspection, I noticed an annoying flickering whenever a key is pressed. Plus there were a few issues with it that I found <a href="http://www.websector.de/blog/2008/04/30/quick-tip-avoid-issues-using-adobes-autocomplete-input-component-using-flex-3/">here</a> (make sure to read all the comments). Plus, since it is not based on TextInput, there are a few properties that got left out that I had to implement on my own (maxChars for example). In the end, I concluded that the component seemed a little underdeveloped and unstable.</p>
<p>The second place I went to was Yahoo&#8217;s AutoCompleteManager. This component is based off of EventDispatcher, allows you to reference 1 or multiple TextInput controls, and allows for Local Storage. Although it doesn&#8217;t have the glitz of Adobe&#8217;s AutoComplete animated dropdown, it doesn&#8217;t have the flicker either. All-in-all, I found this component to be much better and required me to do fewer modifications than Adobe&#8217;s component. However, there was still one issue &#8212; the defaultButton wasn&#8217;t firing on the Keyboard.ENTER event.</p>
<p>For those of you who are having issues with this, I have provided a fix. It resides in the keyDownHandler. Normally, when an enter key is pressed, the TextInput will notify the defaultButton that is should be clicked. However, AutoCompleteManager prevents the propagation of this event because ENTER is reserved for selecting an option from the autocomplete dropdown. Luckily, the fix is easy.</p>
<p>Here is the original code&#8230;</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p164code7'); return false;">View Code</a> ACTIONSCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p1647"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code" id="p164code7"><pre class="actionscript" style="font-family:monospace;"><span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>event.<span style="color: #006600;">keyCode</span> == Keyboard.<span style="color: #0066CC;">LEFT</span> <span style="color: #66cc66;">||</span> event.<span style="color: #006600;">keyCode</span> == Keyboard.<span style="color: #0066CC;">RIGHT</span> <span style="color: #66cc66;">||</span> event.<span style="color: #006600;">keyCode</span> == Keyboard.<span style="color: #0066CC;">ENTER</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#123;</span>
    <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>_currentDropdown <span style="color: #66cc66;">&amp;</span>amp;<span style="color: #66cc66;">&amp;</span>amp; _currentCollection<span style="color: #66cc66;">&#41;</span>
    <span style="color: #66cc66;">&#123;</span>
        ... <span style="color: #cc66cc;">4</span> lines of code I am too lazy to <span style="color: #0066CC;">type</span> ...
    <span style="color: #66cc66;">&#125;</span>
&nbsp;
    _inKeyDown = <span style="color: #000000; font-weight: bold;">false</span>;
    display<span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">false</span>, textInput<span style="color: #66cc66;">&#41;</span>;
    event.<span style="color: #006600;">stopPropagation</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

<p>And here is the fix&#8230;</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p164code8'); return false;">View Code</a> ACTIONSCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p1648"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
</pre></td><td class="code" id="p164code8"><pre class="actionscript" style="font-family:monospace;"><span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>event.<span style="color: #006600;">keyCode</span> == Keyboard.<span style="color: #0066CC;">LEFT</span> <span style="color: #66cc66;">||</span> event.<span style="color: #006600;">keyCode</span> == Keyboard.<span style="color: #0066CC;">RIGHT</span> <span style="color: #66cc66;">||</span> event.<span style="color: #006600;">keyCode</span> == Keyboard.<span style="color: #0066CC;">ENTER</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#123;</span>
    <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>_currentDropdown <span style="color: #66cc66;">&amp;</span>amp;<span style="color: #66cc66;">&amp;</span>amp; _currentCollection<span style="color: #66cc66;">&#41;</span>
    <span style="color: #66cc66;">&#123;</span>
        ... <span style="color: #cc66cc;">4</span> lines of code I am too lazy to <span style="color: #0066CC;">type</span> ...
&nbsp;
        <span style="color: #006600;">event</span>.<span style="color: #006600;">stopPropagation</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
    <span style="color: #66cc66;">&#125;</span>
&nbsp;
    _inKeyDown = <span style="color: #000000; font-weight: bold;">false</span>;
    display<span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">false</span>, textInput<span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

<p>In case you don&#8217;t see it, I moved event.stopPropagation(); up into the if statement. This makes it so that the event is blocked only when the dropdown is showing. When the dropdown is not showing, ENTER is allowed to propagate to allow TextInput to receive the event and notify the defaultButton.</p>
]]></content:encoded>
			<wfw:commentRss>http://natescodevault.com/?feed=rss2&amp;p=164</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
