<?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"
	>

<channel>
	<title>FlexFusion</title>
	<atom:link href="http://flexfusion.archfamily.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://flexfusion.archfamily.com</link>
	<description>Flex, AIR, ColdFusion, and everything in between</description>
	<pubDate>Wed, 11 Jun 2008 11:31:21 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<item>
		<title>New job</title>
		<link>http://flexfusion.archfamily.com/2008/06/new-job/</link>
		<comments>http://flexfusion.archfamily.com/2008/06/new-job/#comments</comments>
		<pubDate>Wed, 11 Jun 2008 11:31:21 +0000</pubDate>
		<dc:creator>Gareth</dc:creator>
		
		<category><![CDATA[Professional]]></category>

		<category><![CDATA[ColdFusion]]></category>

		<category><![CDATA[KForce]]></category>

		<category><![CDATA[new job]]></category>

		<guid isPermaLink="false">http://flexfusion.archfamily.com/?p=17</guid>
		<description><![CDATA[It was a tough decision for me, but I just started a new job at KForce I had some good friends at eAutoclaims, and the coding was always something new, but hopefully I&#8217;ll be able to keep my skills in Flex by writing my own code at home, or perhaps even doing some contract gigs.
I&#8217;ll [...]]]></description>
			<content:encoded><![CDATA[<p>It was a tough decision for me, but I just started a new job at <a href="http://www.kforce.com" target="_blank">KForce</a> I had some good friends at <a href="http://www.eautoclaims.com" target="_blank">eAutoclaims</a>, and the coding was always something new, but hopefully I&#8217;ll be able to keep my skills in Flex by writing my own code at home, or perhaps even doing some contract gigs.</p>
<p>I&#8217;ll be back to developing mainly with ColdFusion again, but there definitely seems to be some momentum for a push towards Flex.  I&#8217;ve still got my fingers crossed that they&#8217;ll go to CF8 soon due to its struct/object creation improvements, and the LCDS express data transfer back to Flex.  They&#8217;re using the <a href="http://www.mach-ii.com/" target="_blank">Mach-II</a> framework (which I have done zero work with before, but looks very similar to just about every other framework out there), which will be nice to get my feet wet.</p>
<p>I&#8217;m still going to continue publishing Flex content on the site, but as I&#8217;m not going to be working with it at my job as much, I may not have as much to talk about (considering my last post was May 22nd, I had better start writing more often or I&#8217;ll be posting once a year <img src='http://flexfusion.archfamily.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> ).</p>
]]></content:encoded>
			<wfw:commentRss>http://flexfusion.archfamily.com/2008/06/new-job/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Adding space before and after parentheses</title>
		<link>http://flexfusion.archfamily.com/2008/05/adding-space-before-and-after-parentheses/</link>
		<comments>http://flexfusion.archfamily.com/2008/05/adding-space-before-and-after-parentheses/#comments</comments>
		<pubDate>Thu, 22 May 2008 18:22:53 +0000</pubDate>
		<dc:creator>Gareth</dc:creator>
		
		<category><![CDATA[ColdFusion]]></category>

		<category><![CDATA[Eclipse]]></category>

		<category><![CDATA[Errors]]></category>

		<category><![CDATA[Regular Expressions]]></category>

		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://flexfusion.archfamily.com/?p=16</guid>
		<description><![CDATA[I had previously written a regular expression that adds extra space within parentheses, so (test) would become ( test ).  However, this gets more complex the more parentheses that are added to the mix.  ((test)) and (((test))) require a much more complex regex statement to work correctly (and find the correct ending parenthesis [...]]]></description>
			<content:encoded><![CDATA[<p>I had previously written a regular expression that adds extra space within parentheses, so (test) would become ( test ).  However, this gets more complex the more parentheses that are added to the mix.  ((test)) and (((test))) require a much more complex regex statement to work correctly (and find the correct ending parenthesis to match up with the correct starting parenthesis).</p>
<p>I was rethinking how I did this and came up with a new method.  The only difference is that this test will need to be run twice, once for the opening parenthesis and once for the closing parenthesis.  As I usually just do a &#8220;Replace All&#8221;, I figured it wasn&#8217;t that much more difficult than doing it the old way (plus this will work for a much parenthesis nesting as a user puts in).</p>
<p>The Regular Expression is:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript">Find: \<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>?<span style="color: #66cc66;">!</span> <span style="color: #66cc66;">|</span>\<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
Replace: <span style="color: #ff0000;">&quot;( &quot;</span></pre></div></div>

<p>remove the double quotes first&#8230;I just wanted to make the space visible.</p>
<p>This regular expression means:<br />
Find an opening parenthesis</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript">\<span style="color: #66cc66;">&#40;</span></pre></div></div>

<p>Then check the next character (but do not include/consume it in the &#8220;find&#8221;).  If it is not a space or a closing parenthesis, match the statement</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript"><span style="color: #66cc66;">&#40;</span>?<span style="color: #66cc66;">!</span> <span style="color: #66cc66;">|</span>\<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span></pre></div></div>

<p>This will work on something like:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript"><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>test<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span></pre></div></div>

<p>which, after the first run, becomes</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript"><span style="color: #66cc66;">&#40;</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #66cc66;">&#40;</span> test<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span></pre></div></div>

<p>Then the second Regular Expression would be:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript">Find: <span style="color: #66cc66;">&#40;</span>?<span style="color: #66cc66;">&lt;!</span> <span style="color: #66cc66;">|</span>\<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>\<span style="color: #66cc66;">&#41;</span>
Replace: <span style="color: #ff0000;">&quot; )&quot;</span></pre></div></div>

<p>remove the double quotes first&#8230;I just wanted to make the space visible.</p>
<p>This regular expression means (starting from the right this time):<br />
Find a closing parenthesis</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript">\<span style="color: #66cc66;">&#41;</span></pre></div></div>

<p>Then check the <em>previous</em> character (but don&#8217;t include/consume it in the &#8220;find&#8221;).  If it is not a space or opening parenthesis, match the statement.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript"><span style="color: #66cc66;">&#40;</span>?<span style="color: #66cc66;">&lt;!</span> <span style="color: #66cc66;">|</span>\<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span></pre></div></div>

<p>This will take the previous finished example of:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript"><span style="color: #66cc66;">&#40;</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #66cc66;">&#40;</span> test<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span></pre></div></div>

<p>and change it to:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript"><span style="color: #66cc66;">&#40;</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #66cc66;">&#40;</span> test<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span></pre></div></div>

<p>By adding the extra space to my code, I think it makes everything a little bit easier to read.  This will work for any type of brackets (or any character for that matter).  In the first find statement, you can replace the parenthesis in \) and \( with \[ or \] or whatever you want.  The same goes for the second find statement.  I don&#8217;t know why I didn&#8217;t think of doing it this way before instead of trying to figure out how to code a really long match for the opening and closing parentheses.  It will definitely make my life easier.</p>
]]></content:encoded>
			<wfw:commentRss>http://flexfusion.archfamily.com/2008/05/adding-space-before-and-after-parentheses/feed/</wfw:commentRss>
		</item>
		<item>
		<title>The supplied index is out of bounds ( image instantiation )</title>
		<link>http://flexfusion.archfamily.com/2008/04/the-supplied-index-is-out-of-bounds-image-instantiation/</link>
		<comments>http://flexfusion.archfamily.com/2008/04/the-supplied-index-is-out-of-bounds-image-instantiation/#comments</comments>
		<pubDate>Fri, 18 Apr 2008 15:04:14 +0000</pubDate>
		<dc:creator>Gareth</dc:creator>
		
		<category><![CDATA[Errors]]></category>

		<category><![CDATA[Flex]]></category>

		<category><![CDATA[code]]></category>

		<category><![CDATA[Error]]></category>

		<category><![CDATA[Instantiation]]></category>

		<guid isPermaLink="false">http://flexfusion.archfamily.com/?p=15</guid>
		<description><![CDATA[A coworker of mine has created a drag &#8216;n&#8217; drop component that allows dragging between 2 items (base component is a ListBase, so it allows for greater flexibility of the list dataProviders).  Today I needed to enable or disable the list components, but all it could do was disable the entire component.  If [...]]]></description>
			<content:encoded><![CDATA[<p>A coworker of mine has created a drag &#8216;n&#8217; drop component that allows dragging between 2 items (base component is a ListBase, so it allows for greater flexibility of the list dataProviders).  Today I needed to enable or disable the list components, but all it could do was disable the entire component.  If the component was completely disabled, the user would not be able to scroll the list and see all of the items in it.  We had decided that rather than just disabling everything, that we would just disable drag &#8216;n&#8217; drop between the lists and remove the directional arrows that are also part of the component (left arrow pushes items from right to left, and vice versa for the right arrow).</p>
<p>I decided to override the enabled property of the component that this component was extending.  Within this enabled, I was checking for initialization, then disabling drag for both lists and making the arrows invisible; however, once I compiled and ran the code I received a</p>
<pre>RangeError: Error #2006: The supplied index is out of bounds.
at flash.display::DisplayObjectContainer/getChildAt()</pre>
<p>I decided to try running debugger to see if it would give me the line of code that was throwing the error, but to no avail.  I had tried gradually removing all of the items that I had added, but nothing worked.  I even cleaned out my project and recompiled everything, but still no luck.  It wasn&#8217;t until I undid everything I had added that it worked (as it should), but when I was testing, I had removed (almost) everything that I had added.  The only thing I had not done was delete some image variables that I had moved from a private function to private variables at the top of the page, so I could access them within my &#8220;enabled&#8221; function.  I put all of my code back in again and did not instantiate the image variables when I declared them, but rather in the creationComplete function, and <em>no error</em>.</p>
<p>After finally narrowing it down to the image instantiation, I tried instantiating the images on declaration and in the creationComplete function and, again, no error was thrown, so apparently it has something to do with trying to reference an image variable that is instantiated before creationComplete.  I guess this goes hand-in-hand with &#8220;only instantiate your variables when you are going to use them&#8221;.  Now that&#8217;s figured out&#8230;back to work <img src='http://flexfusion.archfamily.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
			<wfw:commentRss>http://flexfusion.archfamily.com/2008/04/the-supplied-index-is-out-of-bounds-image-instantiation/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Regular Expressions are fun!</title>
		<link>http://flexfusion.archfamily.com/2008/04/regular-expressions-are-fun/</link>
		<comments>http://flexfusion.archfamily.com/2008/04/regular-expressions-are-fun/#comments</comments>
		<pubDate>Thu, 17 Apr 2008 18:10:41 +0000</pubDate>
		<dc:creator>Gareth</dc:creator>
		
		<category><![CDATA[Eclipse]]></category>

		<category><![CDATA[Regular Expressions]]></category>

		<category><![CDATA[code]]></category>

		<category><![CDATA[RegEx]]></category>

		<guid isPermaLink="false">http://flexfusion.archfamily.com/?p=13</guid>
		<description><![CDATA[Whenever I&#8217;m coding I like things just so   I&#8217;m pretty sure it&#8217;s a very mild case of OCD as it really does bug me when things are different.  Not so much that I get any kind of other disorders from this, but enough that I want to go in and make my [...]]]></description>
			<content:encoded><![CDATA[<p>Whenever I&#8217;m coding I like things <em>just</em> so <img src='http://flexfusion.archfamily.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  I&#8217;m pretty sure it&#8217;s a very mild case of <a href="http://en.wikipedia.org/wiki/Obsessive-compulsive_disorder" target="_blank">OCD</a> as it really does bug me when things are different.  Not so much that I get any kind of <em>other</em> disorders from this, but enough that I want to go in and make my changes/fixes to put in the way I like it.  In order to help me through this, I have started writing many regular expressions that will fix the code, and hopefully be quicker than manually editing the pages.</p>
<p>My company has come up with a set of standards that we&#8217;re trying to follow when writing our code, so, if anyone else joins the company and edits/creates new code they can just follow the guidelines we already have set up.  In order to keep track of all of the regular expressions I&#8217;m writing (and so others can use them if they wish), I&#8217;ve created a <a href="http://flexfusion.archfamily.com/regular-expressions/">Regular Expressions page</a> that I&#8217;ll periodically be updating with new regular expressions each time I use them.  I know they&#8217;re useful to me, so I&#8217;m sure that at least one other person will have a use for them too :).</p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://flexfusion.archfamily.com/2008/04/regular-expressions-are-fun/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Regular Expressions in Flex Builder</title>
		<link>http://flexfusion.archfamily.com/2008/04/regular-expressions-in-flex-builder/</link>
		<comments>http://flexfusion.archfamily.com/2008/04/regular-expressions-in-flex-builder/#comments</comments>
		<pubDate>Wed, 16 Apr 2008 01:54:22 +0000</pubDate>
		<dc:creator>Gareth</dc:creator>
		
		<category><![CDATA[Flex]]></category>

		<category><![CDATA[code]]></category>

		<category><![CDATA[Eclipse]]></category>

		<category><![CDATA[Flex Builder]]></category>

		<category><![CDATA[RegEx]]></category>

		<category><![CDATA[Regular Expression]]></category>

		<guid isPermaLink="false">http://flexfusion.archfamily.com/?p=12</guid>
		<description><![CDATA[Up until a couple of months ago, I had not really used the regular expression Find/Replace in Eclipse. I&#8217;d read several blog posts about it, but hadn&#8217;t really played around with it much. This all changed after I was, once again, manually replacing some items in Eclipse (setting multiple properties of an object to those [...]]]></description>
			<content:encoded><![CDATA[<p>Up until a couple of months ago, I had not really used the regular expression Find/Replace in Eclipse. I&#8217;d read several blog posts about it, but hadn&#8217;t really played around with it much. This all changed after I was, once again, manually replacing some items in Eclipse (setting multiple properties of an object to those of an item that had been passed in to the function). About halfway through, I figured I would try using regular expressions to automate the task a bit.  From this point on, just about every find/replace I did was using a regular expression.</p>
<p>All of these examples are for ActionScript, by the way, but could easily be converted to be useful in any other programming language:</p>
<p>For example: <b>(Make sure to remove the double quotes from these examples also.</b>)</p>
<p>I prefer curly braces in my functions to be on the same line as the actual function definition rather than on the next line so I wrote this</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript">Find: <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\s</span>+<span style="color: #000099; font-weight: bold;">\{</span>&quot;</span>
Replace: <span style="color: #ff0000;">&quot; {&quot;</span></pre></div></div>

<p>This will take something like:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript"><span style="color: #000000; font-weight: bold;">function</span> testing<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
<span style="color: #66cc66;">&#123;</span></pre></div></div>

<p>and change it to</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript"><span style="color: #000000; font-weight: bold;">function</span> testing<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span></pre></div></div>

<p>Not a huge deal to most, but my code OCD <img src='http://flexfusion.archfamily.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> and our in-house coding standards like it on the same line. If I don&#8217;t have to manually do this, it certainly makes things easier.</p>
<p>Now this isn&#8217;t that complex and in most other IDE&#8217;s could be handled pretty easily. However, try doing something like this next example without using some kind of regular expression <img src='http://flexfusion.archfamily.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>(This example is pretty long, so make sure to remove the carriage return before the &#8220;return this&#8221; statement when pasting into your Replace field)</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript">Find: <span style="color: #ff0000;">&quot;public var (<span style="color: #000099; font-weight: bold;">\w</span>+):( )?(<span style="color: #000099; font-weight: bold;">\w</span>+)( ?= ?[^;]+)?;(([^<span style="color: #000099; font-weight: bold;">\t</span>])+(<span style="color: #000099; font-weight: bold;">\t</span>)(<span style="color: #000099; font-weight: bold;">\t</span>+)?(<span style="color: #000099; font-weight: bold;">\s</span>+)?)&quot;</span>
Replace: <span style="color: #ff0000;">&quot;private var _$1:$3$4;$5$5public function get $1():$3 {$5$7
return this._$1;$5}$5$5 public function set $1( value:$3 ):void {$5$7this._$1 = value;$5}$5$5&quot;</span></pre></div></div>

<p>This example will take something like:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript"><span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> companyId:uint;
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> companyName:<span style="color: #0066CC;">String</span> = <span style="color: #ff0000;">&quot;&quot;</span>;
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> isLegit:<span style="color: #0066CC;">Boolean</span> = <span style="color: #000000; font-weight: bold;">false</span>;</pre></div></div>

<p>Will be converted to multiple accessors (i.e.setters and getters). I won&#8217;t show all 3, but this is what the first one would be converted to:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript"><span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _companyId:uint;
&nbsp;
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">get</span> companyId<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:uint <span style="color: #66cc66;">&#123;</span>
    <span style="color: #b1b100;">return</span> <span style="color: #0066CC;">this</span>._companyId;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">set</span> companyId<span style="color: #66cc66;">&#40;</span> value:uint <span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
    <span style="color: #0066CC;">this</span>._companyId = value;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>That has saved me so much coding time.</p>
<p>Anyway, I wish I had started using these earlier as I&#8217;m now setting up a nice little library of scripts that I can run whenever I need to modify my code. I&#8217;m sure someone has set up a site with a library of these things, but these are just a few that I&#8217;ve set up.</p>
<p>And one very important thing to remember with these:</p>
<p><b>Make sure to check the Regular Expressions checkbox in Find/Replace</b> or it will probably never find anything <img src='http://flexfusion.archfamily.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
			<wfw:commentRss>http://flexfusion.archfamily.com/2008/04/regular-expressions-in-flex-builder/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Returning typed objects to Flex from ColdFusion</title>
		<link>http://flexfusion.archfamily.com/2008/04/returning-typed-objects-to-flex-from-coldfusion/</link>
		<comments>http://flexfusion.archfamily.com/2008/04/returning-typed-objects-to-flex-from-coldfusion/#comments</comments>
		<pubDate>Mon, 14 Apr 2008 16:22:27 +0000</pubDate>
		<dc:creator>Gareth</dc:creator>
		
		<category><![CDATA[ColdFusion]]></category>

		<category><![CDATA[Flex]]></category>

		<category><![CDATA[code]]></category>

		<category><![CDATA[ActionScript]]></category>

		<category><![CDATA[Flex Data Services]]></category>

		<guid isPermaLink="false">http://flexfusion.archfamily.com/?p=11</guid>
		<description><![CDATA[Back in January I saw Brian Kotek&#8217;s post about returning typed structs to Flex. When I first read this article, I wasn&#8217;t sure how useful it was (I guess I was getting a little confused with the addition of Transfer and AOP in the article, and figured it was just something for that framework). A [...]]]></description>
			<content:encoded><![CDATA[<p>Back in January I saw Brian Kotek&#8217;s <a href="http://www.briankotek.com/blog/index.cfm/2008/1/28/Returning-Typed-Structs-vs-CFCs-to-Flex" target="_blank">post</a> about returning typed structs to Flex. When I first read this article, I wasn&#8217;t sure how useful it was (I guess I was getting a little confused with the addition of Transfer and AOP in the article, and figured it was just something for that framework). A few weeks later I came across <a href="http://rachaelandtom.info/node/1505" target="_blank">another article</a> about the same idea, and something clicked and I realized just how brilliant this was.</p>
<p>Previously in order to return a typed object to Flex from Coldfusion, you would usually set up aliasing within both your ActionScript object and your CFC</p>
<p>AS:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript"><span style="color: #66cc66;">&#91;</span>RemoteClass<span style="color: #66cc66;">&#40;</span>alias=<span style="color: #ff0000;">&quot;com.mySite.UserVO&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#93;</span>
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> UserVO <span style="color: #66cc66;">&#123;</span></pre></div></div>

<p>CFC:</p>

<div class="wp_syntax"><div class="code"><pre class="cfm"><span style="color: #333333;"><span style="color: #990000;">&lt;cfcomponent</span> alias<span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;com.mySite.UserVO&quot;</span><span style="color: #990000;">&gt;</span></span></pre></div></div>

<p>Then, when you transfer objects back and forth between ActionScript and ColdFusion, they are automagically converted to that specific type (along with all of the methods that go along with them). The only bad thing with this method, is that in order to transfer the CFC VO back from ColdFusion to ActionScript, you have to create that object in ColdFusion. Now this doesn&#8217;t create much overhead for one object, but if you query the database and return those query rows as separate objects, you have to createObject on each query row, which is an insane hog of memory and server resources. Plus, ActionScript cannot use any of the extra methods that CF is returning, so really anything other than the CFC object&#8217;s properties are just extraneous information.</p>
<p>Using the newly discovered technique, you can return the CFC object&#8217;s properties as structs rather than having to use createobject each time. You create the properties of the CFC as keys in the struct, such as</p>

<div class="wp_syntax"><div class="code"><pre class="cfm">myStruct['firstName'] = &quot;John&quot;;
mystruct['lastName'] = &quot;Doe&quot;;</pre></div></div>

<p>All that&#8217;s needed is to set one extra key in the struct e.g. myStruct['__type__'] = &#8220;com.mySite.UserVO&#8221; When the items are returned to ActionScript any struct that has __type__ as a key is automagically converted to an object of that type. What&#8217;s even more brilliant is if any items within the struct also have an __type__ (e.g. if the user has a company, and that company is returned as a company struct using the same __type__ methodology) then they also get converted to that typed object, so some sort of recursion is happening also.</p>
<p>Now for the sad news (on my part at least). After spending 3 days trying to get this to work on CFMX7 (I had read in a couple of different places that this supposedly would work in CFMX7), I finally found that it apparently only works via LiveCycle or CF8 (which has Flex Data Services Express, I think). After trying everything imaginable, I ended up just having to write a function to convert the returned data to objects. Now I&#8217;m hoping that my company will upgrade to CF8, but I don&#8217;t think that will be happening. It looks more likely to be Java + WebORB. I&#8217;m not sure if this same capability is possible with WebORB, but I&#8217;m hoping it does. Certainly is a nice feature to have. Anyway, hopefully this post will be informative for those with CF8 (or LiveCycle) and save those others with CFMX7 from going down the same path as me for 3 days <img src='http://flexfusion.archfamily.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>The original post with a little more details is on the <a href="http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:55258" target="_blank">CFTalk Mailing List</a></p>
]]></content:encoded>
			<wfw:commentRss>http://flexfusion.archfamily.com/2008/04/returning-typed-objects-to-flex-from-coldfusion/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Weirdness with livedocs</title>
		<link>http://flexfusion.archfamily.com/2008/04/weirdness-with-livedocs/</link>
		<comments>http://flexfusion.archfamily.com/2008/04/weirdness-with-livedocs/#comments</comments>
		<pubDate>Thu, 10 Apr 2008 19:12:48 +0000</pubDate>
		<dc:creator>Gareth</dc:creator>
		
		<category><![CDATA[Flex]]></category>

		<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://flexfusion.archfamily.com/?p=10</guid>
		<description><![CDATA[Lately there has been some strangeness with the Adobe livedocs for Flex.  Every now and then the page will just constantly reload in a never ending cycle.  This seems to only be happening on on the Flex 3 livedocs.
Update:
Looks like the Flex Doc Team will be fixing the problem soon and will get [...]]]></description>
			<content:encoded><![CDATA[<p>Lately there has been some strangeness with the Adobe livedocs for Flex.  Every now and then the page will just constantly reload in a never ending cycle.  This seems to only be happening on on the Flex 3 livedocs.</p>
<p>Update:<br />
Looks like the Flex Doc Team will be <a href="http://blogs.adobe.com/flexdoc/2008/04/coldfusion_and_flex_livedocs_a.html" target="_blank">fixing the problem soon</a> and will get it working as it once was.  They even posted a link to a <a href="http://livedocs.adobe.com/flex/3/flex3_documentation.zip" target="_blank">downloadable</a> version of them (It&#8217;s 67MB so be prepared for a small wait).  I prefer to use this method for access any documentation rather than going online to access them mainly due to the fact if I&#8217;m out and about and don&#8217;t have an internet connection (I know, not very common any longer, but still&#8230;), then I still have access to the documentation.  Plus, the livedocs weren&#8217;t exactly speedy to begin with, as they had to load the javascript and frames and all of the other fun they&#8217;ve put in there.  The local version is nice and quick to open.  Hopefully I&#8217;ll get a chance soon to write an AIR version using the Flex documentation (something like <a href="http://blog.brianflove.com/articles/2008/02/19/cfdocs-on-air" target="_blank">CFDocs</a> which is very quick and has a nice interface)</p>
]]></content:encoded>
			<wfw:commentRss>http://flexfusion.archfamily.com/2008/04/weirdness-with-livedocs/feed/</wfw:commentRss>
		</item>
		<item>
		<title>isDate function for Flex&#8230;found!</title>
		<link>http://flexfusion.archfamily.com/2008/04/isdate-function-for-flexfound/</link>
		<comments>http://flexfusion.archfamily.com/2008/04/isdate-function-for-flexfound/#comments</comments>
		<pubDate>Wed, 09 Apr 2008 13:12:42 +0000</pubDate>
		<dc:creator>Gareth</dc:creator>
		
		<category><![CDATA[Flex]]></category>

		<category><![CDATA[code]]></category>

		<category><![CDATA[ColdFusion]]></category>

		<guid isPermaLink="false">http://flexfusion.archfamily.com/?p=9</guid>
		<description><![CDATA[Well, sort of&#8230;
ColdFusion has a very nice &#8220;isDate()&#8221; function that allows you to pass in a variety of formats, and check whether the passed in value is a date.  I had been searching for something similar in Flex, but had very little success until I started playing around with different functions myself.
I had been [...]]]></description>
			<content:encoded><![CDATA[<p>Well, sort of&#8230;</p>
<p>ColdFusion has a very nice &#8220;isDate()&#8221; function that allows you to pass in a variety of formats, and check whether the passed in value is a date.  I had been searching for something similar in Flex, but had very little success until I started playing around with different functions myself.</p>
<p>I had been writing a custom controller for a datagrid which allowed passing in data from an object or table and displaying it in an editable datagrid. The problem I ran into was that depending on the data returned, trying to set those values back to the object that I was using, caused me some issues (such as trying to set a date stored in a text field, back to the object as a &#8220;new Date&#8221; value). After trying many different kinds of things, I found that the parse function of date works very nicely.</p>
<p>You can do something like</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript">    <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">Date</span>.<span style="color: #006600;">parse</span><span style="color: #66cc66;">&#40;</span> myDateField.<span style="color: #0066CC;">text</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
        myObj.<span style="color: #006600;">recordingDate</span> = <span style="color: #0066CC;">Date</span>.<span style="color: #006600;">parse</span><span style="color: #66cc66;">&#40;</span> myDateField.<span style="color: #0066CC;">text</span> <span style="color: #66cc66;">&#41;</span>;
    <span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>If you pass it a value that is not a valid date, the statement returns false.</p>
<p>Anyway, I had been searching around for a while trying to find something that would allow me to check for isDate and this fit the bill nicely. It also allows you to pass in quite a varied type of date formatting and it still recognizes it. Very powerful feature, it seems.</p>
]]></content:encoded>
			<wfw:commentRss>http://flexfusion.archfamily.com/2008/04/isdate-function-for-flexfound/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Déjà vu?</title>
		<link>http://flexfusion.archfamily.com/2008/04/deja-vu/</link>
		<comments>http://flexfusion.archfamily.com/2008/04/deja-vu/#comments</comments>
		<pubDate>Wed, 09 Apr 2008 13:05:55 +0000</pubDate>
		<dc:creator>Gareth</dc:creator>
		
		<category><![CDATA[Site Updates]]></category>

		<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://flexfusion.archfamily.com/?p=8</guid>
		<description><![CDATA[I have started to copy over some of my blog posts from ColdFusion Community in order to keep everything that I&#8217;m typing localized in one spot.  Hopefully this will save me from having to search 2 places when I&#8217;m trying to figure out an answer to something I&#8217;ve already solved previously.  So, if you have [...]]]></description>
			<content:encoded><![CDATA[<p>I have started to copy over some of my blog posts from <a href="http://flexfusion.archfamily.com/wp-admin/www.coldfusioncommunity.org" target="_blank">ColdFusion Community</a> in order to keep everything that I&#8217;m typing localized in one spot.  Hopefully this will save me from having to search 2 places when I&#8217;m trying to figure out an answer to something I&#8217;ve already solved previously.  So, if you have a feeling of Déjà vu, it may be you were enjoying my nonsense before.</p>
]]></content:encoded>
			<wfw:commentRss>http://flexfusion.archfamily.com/2008/04/deja-vu/feed/</wfw:commentRss>
		</item>
		<item>
		<title>I won a copy of Attest!</title>
		<link>http://flexfusion.archfamily.com/2008/04/i-won-a-copy-of-attest/</link>
		<comments>http://flexfusion.archfamily.com/2008/04/i-won-a-copy-of-attest/#comments</comments>
		<pubDate>Wed, 09 Apr 2008 03:12:57 +0000</pubDate>
		<dc:creator>Gareth</dc:creator>
		
		<category><![CDATA[Flex]]></category>

		<category><![CDATA[Attest]]></category>

		<category><![CDATA[certification]]></category>

		<category><![CDATA[coding]]></category>

		<category><![CDATA[pxl designs]]></category>

		<guid isPermaLink="false">http://flexfusion.archfamily.com/?p=7</guid>
		<description><![CDATA[Yay me!  The guys over at pxl designs ran a contest today that gave away 3 copies of their excellent Flex 2 certification practice exam, Attest,  for free to anyone who answered 3 flex questions correctly.  Apparently they were only medium difficulty as I was able to answer them all correctly  [...]]]></description>
			<content:encoded><![CDATA[<p>Yay me!  The guys over at <a title="Pxl Designs" href="http://www.pxldesigns.com" target="_blank">pxl designs</a> ran a contest today that gave away 3 copies of their excellent Flex 2 certification practice exam, <a title="attest" href="http://www.pxldesigns.com/pxlblog/?itemid=21" target="_blank">Attest</a>,  for free to anyone who answered 3 flex questions correctly.  Apparently they were only medium difficulty as I was able to answer them all correctly <img src='http://flexfusion.archfamily.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  I had previously only downloaded the trial version and found the questions to be well written, difficult enough to make you think (and question whether you are selecting the correct answer because of the excellent potential alternate answers), with excellent, concise answers explaining why a certain answer was correct over another.</p>
<p>A co-worker has been nudging me to take the Flex certification exam, for nothing other than proof that I know what I&#8217;m talking about, or that I can flash my Certification when I&#8217;m giving a demonstration to my team <img src='http://flexfusion.archfamily.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  He already passed his exam with no exam studying, just one year of intense self-study-by-doing.  I had been putting off taking the exam month after month, saying to myself &#8220;once I download the practice exam and go through it a few times, I&#8217;ll take the test&#8221;.  Well, now I&#8217;ve got the practice exam and have no excuses for not taking the certification.</p>
<p>I&#8217;ll have to take the practice tests a few times, just to make sure I&#8217;ve got everything, and read up on some of the documentation over at livedocs, but after that, I&#8217;m certification bound <img src='http://flexfusion.archfamily.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
			<wfw:commentRss>http://flexfusion.archfamily.com/2008/04/i-won-a-copy-of-attest/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
