<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>I Am CaptainCode</title>
	<atom:link href="http://captaincode.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://captaincode.wordpress.com</link>
	<description>Journey&#039;s through code.</description>
	<lastBuildDate>Wed, 09 Feb 2011 17:51:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='captaincode.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>I Am CaptainCode</title>
		<link>http://captaincode.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://captaincode.wordpress.com/osd.xml" title="I Am CaptainCode" />
	<atom:link rel='hub' href='http://captaincode.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Introducing Binary Fusion</title>
		<link>http://captaincode.wordpress.com/2010/09/27/introducing-binary-fusion/</link>
		<comments>http://captaincode.wordpress.com/2010/09/27/introducing-binary-fusion/#comments</comments>
		<pubDate>Mon, 27 Sep 2010 17:12:02 +0000</pubDate>
		<dc:creator>captaincode</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Zend_Amf]]></category>

		<guid isPermaLink="false">http://captaincode.wordpress.com/?p=57</guid>
		<description><![CDATA[For the few of you that read my blog, you might be interested in knowing that along with some friends, I recently started a new business. We develop applications for mobile, for desktop, and for basically anything else that you might need. We have a lot of interesting things in the works for it, and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=captaincode.wordpress.com&amp;blog=5874573&amp;post=57&amp;subd=captaincode&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>For the few of you that read my blog, you might be interested in knowing that along with some friends, I recently started a <a href="http://www.mybinaryfusion.com/">new business</a>. We develop applications for mobile, for desktop, and for basically anything else that you might need. We have a lot of interesting things in the works for it, and would love to provide a <a href="http://www.mybinaryfusion.com/contact-binary-fusion.php">custom quote</a> for you to see how we can help meet your needs.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/captaincode.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/captaincode.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/captaincode.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/captaincode.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/captaincode.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/captaincode.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/captaincode.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/captaincode.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/captaincode.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/captaincode.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/captaincode.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/captaincode.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/captaincode.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/captaincode.wordpress.com/57/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=captaincode.wordpress.com&amp;blog=5874573&amp;post=57&amp;subd=captaincode&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://captaincode.wordpress.com/2010/09/27/introducing-binary-fusion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1caba5f859236a4a6c851bb237f8c1e8?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">captaincode</media:title>
		</media:content>
	</item>
		<item>
		<title>Undocumented functions in Flash. A huge annoyance: reset()</title>
		<link>http://captaincode.wordpress.com/2010/05/20/undocumented-functions-in-flash-a-huge-annoyance-reset/</link>
		<comments>http://captaincode.wordpress.com/2010/05/20/undocumented-functions-in-flash-a-huge-annoyance-reset/#comments</comments>
		<pubDate>Thu, 20 May 2010 23:00:36 +0000</pubDate>
		<dc:creator>captaincode</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Source Code]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[Bugs]]></category>
		<category><![CDATA[Custom Classes]]></category>
		<category><![CDATA[data intensive apps]]></category>
		<category><![CDATA[Flash CS5]]></category>
		<category><![CDATA[Hints]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[Workarounds]]></category>

		<guid isPermaLink="false">http://captaincode.wordpress.com/?p=47</guid>
		<description><![CDATA[Synopsis: Today has been a really frustrating day. I am writing a new game, and I&#8217;ve been making great progress so far. It&#8217;s highly optimized for memory performance (so far) and probably as OOP as I&#8217;ve ever done. Needless to say I&#8217;m rather proud of it so far. It&#8217;s been pretty smooth sailing all along, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=captaincode.wordpress.com&amp;blog=5874573&amp;post=47&amp;subd=captaincode&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h3>Synopsis:</h3>
<p>Today has been a really frustrating day. I am writing a new game, and I&#8217;ve been making great progress so far. It&#8217;s highly optimized for memory performance (so far) and probably as OOP as I&#8217;ve ever done. Needless to say I&#8217;m rather proud of it so far. It&#8217;s been pretty smooth sailing all along, until today. When I found that there is some undocumented behavior. I am using a methodology called <a href="http://en.wikipedia.org/wiki/Object_pool_pattern" target="_blank">Object Pooling</a>. Which basically means I am re-using instances rather than re-creating them. However, as I was going along I hit a nasty little problem. As items came up for re-use all of the visuals were missing. Everything else was there in memory, but the screen was blank. You can imagine my frustration. An to prevent others from experiencing the same frustration, I&#8217;ve decided to write what I found here.</p>
<h3>What I found:</h3>
<p>The items in question eventually inherit from flash.display.Sprite. I was also implementing a custom interface which defined a single method.<br />
<code>function reset():void;</code></p>
<p>I had this so that when I put the object back into the pool I could call this method which would restore the instance back to it&#8217;s default state. However it seems that there is an undocumented &#8220;feature&#8221; that won&#8217;t let me name my function &#8220;reset&#8221;. Maybe I&#8217;m blind, but I couldn&#8217;t find it here:   <a href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/Sprite.html#methodSummary">http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/Sprite.html#methodSummary</a> When I would call that function all of the visual elements of that class would be erased when I tried to add it back to the display list. As soon as I renamed the function to &#8220;resetItem&#8221; everything worked perfectly again.</p>
<h3>A Word of caution:</h3>
<p>Unless you too want to experience countless hours of frustration, *DO NOT* name your functions &#8220;reset&#8221; when extending from Sprite<strong>**</strong>.</p>
<p><strong>**</strong> I don&#8217;t know it it also occurs when extending other things. I didn&#8217;t want to take the time to check because I was pretty peeved.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/captaincode.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/captaincode.wordpress.com/47/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/captaincode.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/captaincode.wordpress.com/47/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/captaincode.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/captaincode.wordpress.com/47/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/captaincode.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/captaincode.wordpress.com/47/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/captaincode.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/captaincode.wordpress.com/47/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/captaincode.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/captaincode.wordpress.com/47/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/captaincode.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/captaincode.wordpress.com/47/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=captaincode.wordpress.com&amp;blog=5874573&amp;post=47&amp;subd=captaincode&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://captaincode.wordpress.com/2010/05/20/undocumented-functions-in-flash-a-huge-annoyance-reset/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1caba5f859236a4a6c851bb237f8c1e8?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">captaincode</media:title>
		</media:content>
	</item>
		<item>
		<title>A Great Personal Honor</title>
		<link>http://captaincode.wordpress.com/2010/05/13/a-great-personal-honor/</link>
		<comments>http://captaincode.wordpress.com/2010/05/13/a-great-personal-honor/#comments</comments>
		<pubDate>Thu, 13 May 2010 00:24:35 +0000</pubDate>
		<dc:creator>captaincode</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Random]]></category>
		<category><![CDATA[Flash CS5]]></category>
		<category><![CDATA[Flex and Flash]]></category>

		<guid isPermaLink="false">http://captaincode.wordpress.com/?p=42</guid>
		<description><![CDATA[The image pretty much speaks for itself if you look at the names listed @ the top.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=captaincode.wordpress.com&amp;blog=5874573&amp;post=42&amp;subd=captaincode&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The image pretty much speaks for itself if you look at the names listed @ the top.</p>
<div id="attachment_43" class="wp-caption alignleft" style="width: 520px"><a href="http://captaincode.files.wordpress.com/2010/05/name-in-cs5-credits.png"><img class="size-full wp-image-43" title="My Name In Flash CS5 Credits" src="http://captaincode.files.wordpress.com/2010/05/name-in-cs5-credits.png?w=510&#038;h=449" alt="" width="510" height="449" /></a><p class="wp-caption-text">My name in the credits.</p></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/captaincode.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/captaincode.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/captaincode.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/captaincode.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/captaincode.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/captaincode.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/captaincode.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/captaincode.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/captaincode.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/captaincode.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/captaincode.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/captaincode.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/captaincode.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/captaincode.wordpress.com/42/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=captaincode.wordpress.com&amp;blog=5874573&amp;post=42&amp;subd=captaincode&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://captaincode.wordpress.com/2010/05/13/a-great-personal-honor/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1caba5f859236a4a6c851bb237f8c1e8?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">captaincode</media:title>
		</media:content>

		<media:content url="http://captaincode.files.wordpress.com/2010/05/name-in-cs5-credits.png" medium="image">
			<media:title type="html">My Name In Flash CS5 Credits</media:title>
		</media:content>
	</item>
		<item>
		<title>Why mobile paradigms have permanently changed data consumption &#8211; The Data Revlolution</title>
		<link>http://captaincode.wordpress.com/2009/12/30/why-mobile-paradigms-have-permanently-changed-data-consumption-the-data-revlolution/</link>
		<comments>http://captaincode.wordpress.com/2009/12/30/why-mobile-paradigms-have-permanently-changed-data-consumption-the-data-revlolution/#comments</comments>
		<pubDate>Wed, 30 Dec 2009 07:07:38 +0000</pubDate>
		<dc:creator>captaincode</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Zend_Amf]]></category>
		<category><![CDATA[data intensive apps]]></category>
		<category><![CDATA[Hints]]></category>
		<category><![CDATA[mobile revolution]]></category>

		<guid isPermaLink="false">http://captaincode.wordpress.com/?p=36</guid>
		<description><![CDATA[Not long ago the world completely changed, and most people in the world completely missed it. At first, I was one of those people. As part of my duties at work, I have to be mindful of UX (user experience). One of the most difficult tasks of UX has always been how to present data in [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=captaincode.wordpress.com&amp;blog=5874573&amp;post=36&amp;subd=captaincode&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Not long ago the world completely changed, and most people in the world completely missed it.</p>
<p>At first, I was one of those people. As part of my duties at work, I have to be mindful of UX (user experience). One of the most difficult tasks of UX has always been how to present data in intuitive and meaningful ways. Previous to this data revolution, many UX engineers would satisfy themselves with a variable cornucopia of buttons, myriads of menus, and tons of raw power exposed to the most simplistic user. Creating some of the most complex applications and logical mazes known to man.<span id="more-36"></span></p>
<p>For an example of this, we can look at the UX engineering disaster known as Office XP. Well, anything before Office 2007 / 2010. When Microsoft decided to re-engineer the interface for Office, they started with some basic research to see what people wanted / needed. They discovered something interesting. 80% (as I remember from a release conference I attended) of the abilities requested were already in the software. There was just the simple problem of no-one understanding how to access the capabilities, or they were too terrified to try. (Some people I know really were terrified they would break something, so they stuck to only the basic tasks they knew.)</p>
<p>To be fair, when Office XP came out, people were ecstatic about its capabilities. It was excellent for its time. But it no longer fits the bill of what is expected as far as terms of usability go. How many people can you find that have gotten used  to the changes of the new office workflow (and it is a drastic change for the better) that will voluntarily go back to the profusion of menus?</p>
<p>So what exactly has changed, and what incited it? I believe it was led in large part by a two-part revolution.</p>
<h3>Part 1- The desktop RIA.</h3>
<p>Ask any C/C++ developer. Creating desktop applications that are beautiful and easy to use is a nightmare, to put it bluntly. Prior to the introduction of things such as Adobe AIR, or Flex applications, people were left to the same nightmarish user experience with most software platforms. For example, most custom business applications looked like a dos terminal threw-up on the screen. Many user applications were the same blah. Especially if the application was data intensive.</p>
<p>Enter the RIA. RIA&#8217;s brought a fundamental perspective change to the concept of a data-intensive application. Especially at the Enterprise level. No longer do complex business needs require applications that take three weeks training to use. The RIA allows for a rich interface on a budget. An interface that is both beautiful (which entices users to actually USE the application) and innovative to use. An excellent example of this is the <a href="http://redmonk.com/tv/2009/10/16/demo-fedex-critical-truck-tracking/" target="_blank">FedEx Custom Critical tracking demo</a> presented at <a href="http://max.adobe.com" target="_blank">Adobe Max 2009</a>. All of the information that a FedEx employee would need is directly at their fingertips. Easy access such as this system provides, enhances employee productivity and has an inherent coolness factor. <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Examples such as the FedEx demo are everywhere. Look through the <a href="http://www.adobe.com/cfusion/marketplace/index.cfm?event=marketplace.home&amp;marketplaceid=1" target="_blank">Adobe Air Marketplace</a>. You would be really surprised at how many applications these days are written using technologies such as Adobe Air and Adobe Flex. Go ahead &#8211; look through your hard-drive.</p>
<h3>Part 2 &#8211; The Mobile Revolution</h3>
<p>I know all of this probably sounds like it has nothing to do with mobile paradigms.  But it has the world to do with it. Can you imagine trying to navigate through a menu that is more than say one or two levels deep? Mobile, due to its limited screen real-estate, memory capacity, and small processing powers have forced developers on making applications significantly more intuitive and automated.</p>
<p>In application development, there is a concept known as <a href="http://en.wikipedia.org/wiki/Multitier_architecture" target="_blank">N-Tier architecture</a>s. The most popular of which is the <a href="http://en.wikipedia.org/wiki/Multitier_architecture#Three-tier_architecture" target="_blank">three-tier architecture</a>. Prior to the mobile revolution this was mainly used only for web applications. An application that utilizes three tiers is an application that is separates three distinct parts of any application from each other using interfaces to link them together. The UI (User Interface) is separated from the Business Logic (the heavy processing), which is separated from the Data, such as a Database Server. This allows all of the heavy processing to be done in a known environment. Somewhere that we know is going to have the processing power to do what is needed by the application. This includes retrieving / storing data. Processing it, etc. The results are then sent back to the application which shows the data to the user. This frees the user from the desktop. It frees businesses from expensive hardware purchases for all of their employees. It enhances hardware planning so that purchases can be controlled while reducing the overall design. It also allows users to have access to everything they need regardless of their location, provided they have an internet connection.</p>
<p>This concept is also frequently referred to as moving &#8220;to the <a href="http://en.wikipedia.org/wiki/Cloud_computing" target="_blank">cloud</a>.&#8221;</p>
<p>To be fair, not all applications that have taken advantage of the new paradigm are better, or even as good as their desktop counter-parts. Nor will they ever be. As with all paradigms, not everything will fit into it. Honestly we&#8217;d be stupid to try. Try putting every feature of Photoshop or any other highly complex application into an RIA, or mobile app, and you have a recipe for revolt from your engineers and customers. But subsets of commonly used features are highly appropriate for the paradigm. i.e. look at <a href="http://www.photoshop.com">photoshop.com</a>, or the Photoshop app on the iPhone. Can I go create amazing art from scratch? No. Can I do some pretty neat stuff to the picture I just took on my cell phone? Yes.</p>
<p>So why should you care?</p>
<p>If you write applications, you need to ask yourself how you can make your interfaces more elegant to use. Are they cluttered un-necessarily? Does it require fifteen steps to do a simple task? Your software will appreciate it. Your customers will appreciate you. Your developers may hate you at first, but once they use an application that simplifies things they will revolt when you try to go back.</p>
<p>If you are a customer, you should demand simplicity. Should the average application take three months to learn? Wouldn&#8217;t it be better if you could interact directly with your data? The days of complex forms and boring pages of raw data are numbered for many of us. In this enlightened age of technology we should settle for nothing short of excellence. Nothing short of usability. Nothing short of intuitiveness, and ingenuity in design.</p>
<p>It can be done, it is possible, but it takes work, foresight, and effort. And if we don&#8217;t do something to change along with these paradigms and concepts we will be left behind. The future is inexorably moving forward. It may not be exactly what we see before us, but it should be better. It must be better, because we must make it better.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/captaincode.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/captaincode.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/captaincode.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/captaincode.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/captaincode.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/captaincode.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/captaincode.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/captaincode.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/captaincode.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/captaincode.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/captaincode.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/captaincode.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/captaincode.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/captaincode.wordpress.com/36/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=captaincode.wordpress.com&amp;blog=5874573&amp;post=36&amp;subd=captaincode&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://captaincode.wordpress.com/2009/12/30/why-mobile-paradigms-have-permanently-changed-data-consumption-the-data-revlolution/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1caba5f859236a4a6c851bb237f8c1e8?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">captaincode</media:title>
		</media:content>
	</item>
		<item>
		<title>Persistent HTTP Connections and Flex Data Services w/ Zend_Amf</title>
		<link>http://captaincode.wordpress.com/2009/12/10/persistent-http-connections-and-flex-data-services-w-zend_amf/</link>
		<comments>http://captaincode.wordpress.com/2009/12/10/persistent-http-connections-and-flex-data-services-w-zend_amf/#comments</comments>
		<pubDate>Thu, 10 Dec 2009 04:12:50 +0000</pubDate>
		<dc:creator>captaincode</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[Zend_Amf]]></category>
		<category><![CDATA[Bugs]]></category>
		<category><![CDATA[Hints]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[Workarounds]]></category>

		<guid isPermaLink="false">http://captaincode.wordpress.com/2009/12/10/persistent-http-connections-and-flex-data-services-w-zend_amf/</guid>
		<description><![CDATA[I encountered some time ago, what I was convinced was a bug in the Zend_Amf protocols. It seemed to me that something was wrong with the ACL, or the way that things were being called. And it still may be, I don’t know. Here is what I was experiencing. Logical System: Lets say I had [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=captaincode.wordpress.com&amp;blog=5874573&amp;post=34&amp;subd=captaincode&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I encountered some time ago, what I was convinced was a bug in the Zend_Amf protocols. It seemed to me that something was wrong with the ACL, or the way that things were being called. And it still may be, I don’t know. Here is what I was experiencing.<span id="more-34"></span></p>
<h3>Logical System:</h3>
<p>Lets say I had a remote method call getDetails($params) that called a remote data service on my server, which would then do some calculations, maybe a database lookup or two, and send information back to the client. Let’s also say that I didn’t want anyone to be able to call this method, so it internally utilizes Zend_Acl to manage access control.</p>
<h3>Symptoms:</h3>
<p>When getDetails is called once at a time, with a gap in between calls everything works fine. You can even call it twice simultaneously, as internally Flash Player can handle two open HTTP protocols. The issue comes when you call it, say three or more times simultaneously. When this happens, the third and above call will fail due to Flash Player using what is known as a persistent HTTP connection. Now let me clarify. It will not always fail, but if you are using ACL, the initAcl function will be called with each function call, NOT each connection. That is when it fails. ACL cannot add a duplicate permission (same user, same permission group, etc.) I believe this is caused by the persistent connection, as your Zend session will remain in memory on the server since the connection was never terminated.</p>
<h3>Solutions:</h3>
<p>There are two feasible solutions that I see at this point. First, set an internal flag to check if the ACL has already been configured for that connection. The second option is that you can accomplish the same result, (albeit incredibly slower and more processor intensive) by wrapping every call to add to the ACL (in your initAcl function) in a try catch block. There is a third option. However, I don’t consider it highly feasible (as I don’t have a clue how to do it, but to be honest I haven’t taken the time to try to figure it out.) Change the HTTP header that Flash Player sends to be a version of HTTP that does not support persistent connections.</p>
<h3>Conclusion:</h3>
<p>This may be a bug, maybe its my own programming incompetence. I’m not sure. Let me know what you think in the comments.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/captaincode.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/captaincode.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/captaincode.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/captaincode.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/captaincode.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/captaincode.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/captaincode.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/captaincode.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/captaincode.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/captaincode.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/captaincode.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/captaincode.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/captaincode.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/captaincode.wordpress.com/34/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=captaincode.wordpress.com&amp;blog=5874573&amp;post=34&amp;subd=captaincode&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://captaincode.wordpress.com/2009/12/10/persistent-http-connections-and-flex-data-services-w-zend_amf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1caba5f859236a4a6c851bb237f8c1e8?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">captaincode</media:title>
		</media:content>
	</item>
		<item>
		<title>Minimum Age Validation Component</title>
		<link>http://captaincode.wordpress.com/2009/11/12/minimum-age-validation-component/</link>
		<comments>http://captaincode.wordpress.com/2009/11/12/minimum-age-validation-component/#comments</comments>
		<pubDate>Thu, 12 Nov 2009 16:39:52 +0000</pubDate>
		<dc:creator>captaincode</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Source Code]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[Custom Classes]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[Validation]]></category>

		<guid isPermaLink="false">http://captaincode.wordpress.com/?p=21</guid>
		<description><![CDATA[The other day I took my first foray into the world of Custom Validators. I have to admit, I was intimidated at first. However, I needed to provide some validation to a form that I was writing. Rather than writing a sub-routine that was only usable once, I decided that I should make something a little more re-usable. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=captaincode.wordpress.com&amp;blog=5874573&amp;post=21&amp;subd=captaincode&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The other day I took my first foray into the world of <a href="http://livedocs.adobe.com/flex/3/html/help.html?content=createvalidators_3.html#175459" target="_blank">Custom Validators</a>. I have to admit, I was intimidated at first. However, I needed to provide some validation to a form that I was writing. Rather than writing a sub-routine that was only usable once, I decided that I should make something a little more re-usable. Thus my MinimumAgeValidator was born. It can be used via straight AS, or in MXML. Code after the jump.<img title="More..." src="http://captaincode.wordpress.com/wp-includes/js/tinymce/plugins/wordpress/img/trans.gif?w=510" alt="" /><span id="more-21"></span></p>
<p>When using the validator, there are two options that you need to consider. First, the required minimum age and secondly if that age should be computed from a specific date (say by the end of a competition or sweepstakes) or from the current date. If you do not provide a date, the current date will be used to provide verification. The date, if provided, should be in the format MM/DD/YYYY. This format requirement also applies to the date being validated. The code formatting below sucks, so download the actual file.<br />
<code><br />
/**<br />
*<br />
* This code is provided AS-IS with no warranty of any kind, it was originally written by the<br />
* U.S. Institute of languages for use within Visual Link Languages. They have kindly allowed<br />
* me to post this code here. You may do whatever you want with this code, including use it in<br />
* commercial applications, or change it provided this notice remains in the source code.<br />
* Retrived from captaincode.wordpress.com<br />
**/<br />
package com.captaincode.utils<br />
{<br />
import mx.validators.Validator;<br />
import mx.validators.ValidationResult;</code></p>
<p><code>/**<br />
* Provide basic validation to ensure that a date given (specifically a birthdate generally) meets<br />
* the minumum age requirements.<br />
*<br />
**/<br />
public class MinimumAgeValidator extends Validator<br />
{<br />
/**<br />
* Hold the results of the validation attempts.<br />
* @var Array results<br />
* @private<br />
*/<br />
private var results:Array;</p>
<p>/**<br />
* Calculate the age from a specified date. If ommited, the current date is used.<br />
* It must be given in the format MM/DD/YYYY<br />
* @var String fromDate;<br />
*/<br />
public var fromDate:String = "";</p>
<p>/**<br />
* Set the minimum age required by the validator<br />
* @var int minAge<br />
*/<br />
public var minAge:int = 0;</p>
<p>/**<br />
* Set the error message to be displayed if the minimum age is not met.<br />
* @var int minAge<br />
*/<br />
public var tooYoungError:String = "You are not old enough.";</p>
<p>/**<br />
* Constructor. It only needs to call super(), as this validator is pretty basic.<br />
*/<br />
public function MinimumAgeValidator()<br />
{<br />
super();<br />
}</p>
<p>/**<br />
* This override function is where the guts of the validation take place.<br />
* It is automatically envoked by the Validation framework to perfome the validation.<br />
* @param Object value. Value contains the "data" from whatever property you have set the validator to function off of. i.e. .text on a TextInput component.<br />
* @return Array An array of ValidationResult objects that contain the results of the validation attempt.<br />
*/<br />
override protected function doValidation(value:Object):Array {<br />
var parts:Array = String(value).split("/");<br />
var year:int = int(parts[2]);<br />
var month:int = int(parts[0]);<br />
var days:int  = int(parts[1]);<br />
var fYear:int;<br />
var fMonth:int;<br />
var fDay:int;</p>
<p>//Are we calculating on the from date?<br />
if (fromDate == "")<br />
{<br />
var curDate:Date = new Date();<br />
fYear = curDate.getFullYear();<br />
fMonth = curDate.getMonth();<br />
fDay = curDate.getDay();<br />
}<br />
else<br />
{<br />
var fParts:Array = fromDate.split("/");<br />
if (fParts.length == 0)<br />
{<br />
results.push(new ValidationResult(true, null, "invalidDate", "The supplied fromDate is invalid."));<br />
return results;<br />
}<br />
fYear= int(fParts[2]);<br />
fMonth= int(fParts[0]);<br />
fDay= int(fParts[1]);</p>
<p>if (isNaN(fYear))<br />
{<br />
results.push(new ValidationResult(true, null, "invalidDate", "The supplied fromDate year is invalid."));<br />
return results;<br />
}<br />
if (isNaN(fMonth))<br />
{<br />
results.push(new ValidationResult(true, null, "invalidDate", "The supplied fromDate month is invalid."));<br />
return results;<br />
}<br />
if (isNaN(fDay))<br />
{<br />
results.push(new ValidationResult(true, null, "invalidDate", "The supplied fromDate day is invalid."));<br />
return results;<br />
}<br />
}</p>
<p>// Clear results Array.<br />
results = [];</p>
<p>// Call base class doValidation().<br />
results = super.doValidation(value);</p>
<p>// Return if there are errors.<br />
if (results.length &gt; 0)<br />
return results;</p>
<p>//Do they meet the minimum age based soley on the year of their birth?<br />
//Because, we only need to check the month and day if they were born on<br />
//the minimum year to be accepted.<br />
if (year == (fYear-minAge))<br />
{<br />
//Check months / days.<br />
if (month &lt; fMonth)<br />
{<br />
results.push(new ValidationResult(true, null, "tooYoung", tooYoungError));<br />
return results;<br />
}<br />
if (month == fMonth &amp;&amp; days &lt; fDay)<br />
{<br />
results.push(new ValidationResult(true, null, "tooYoung", tooYoungError));<br />
return results;<br />
}<br />
}<br />
else if (year &gt; (fYear-minAge))<br />
{<br />
//Not old enough.<br />
results.push(new ValidationResult(true, null, "tooYoung", tooYoungError));<br />
return results;<br />
}</p>
<p></code></p>
<p><code> return results;<br />
}<br />
}<br />
}<br />
</code></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/captaincode.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/captaincode.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/captaincode.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/captaincode.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/captaincode.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/captaincode.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/captaincode.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/captaincode.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/captaincode.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/captaincode.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/captaincode.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/captaincode.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/captaincode.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/captaincode.wordpress.com/21/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=captaincode.wordpress.com&amp;blog=5874573&amp;post=21&amp;subd=captaincode&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://captaincode.wordpress.com/2009/11/12/minimum-age-validation-component/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1caba5f859236a4a6c851bb237f8c1e8?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">captaincode</media:title>
		</media:content>

		<media:content url="http://captaincode.wordpress.com/wp-includes/js/tinymce/plugins/wordpress/img/trans.gif" medium="image">
			<media:title type="html">More...</media:title>
		</media:content>
	</item>
		<item>
		<title>Focus Management with the Flex Component Kit for Flash</title>
		<link>http://captaincode.wordpress.com/2009/11/05/focus-management-with-the-flex-component-kit-for-flash/</link>
		<comments>http://captaincode.wordpress.com/2009/11/05/focus-management-with-the-flex-component-kit-for-flash/#comments</comments>
		<pubDate>Thu, 05 Nov 2009 00:12:05 +0000</pubDate>
		<dc:creator>captaincode</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[Bugs]]></category>
		<category><![CDATA[Flex and Flash]]></category>
		<category><![CDATA[Workarounds]]></category>

		<guid isPermaLink="false">http://captaincode.wordpress.com/?p=12</guid>
		<description><![CDATA[At work today we found a bug in the Flex Component Kit for flash. The basic synopsis: when you create a &#8220;component&#8221; in flash using the CS3 component kit it automatically causes you to extend a base class known as mx.flash.UIMovieClip. This class is very useful, as according to it&#8217;s own documentation it allows you: [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=captaincode.wordpress.com&amp;blog=5874573&amp;post=12&amp;subd=captaincode&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>At work today we found a bug in the Flex Component Kit for flash. The basic synopsis: when you create a &#8220;component&#8221; in flash using the <a href="http://www.adobe.com/go/flex3_cs3_swfkit">CS3 component kit</a> it automatically causes you to extend a base class known as <a href="http://livedocs.adobe.com/flex/3/langref/mx/flash/UIMovieClip.html">mx.flash.UIMovieClip</a>. This class is very useful, as according to it&#8217;s own documentation it allows you:<span id="more-12"></span></p>
<blockquote><p>The UIMovieClip class implements the interfaces necessary for a Flash component to be used like a normal Flex component. Therefore, a subclass of UIMovieClip can be used as a child of a Flex container or as a skin, and it can respond to events, define view states and transitions, and work with effects in the same way as can any Flex component.</p></blockquote>
<p>I think you can see the use for that. You can develop rudimentary UI elements in flash (which it was designed for), and use them in a flex (MXML) application. In concept this is awesome, and it usually works. However, we were plagued by a seeming randomly occuring bug for quite a period of time. As with all such bugs, it&#8217;s not really random, we just hadn&#8217;t found the cause. We broke down and finally started rooting around for the cause. We eventually found it, and want to help prevent everyone else from experiencing it, or at least solve it once you do experience it.</p>
<h4>First, the error:</h4>
<blockquote><p><code>TypeError: Error #1009: Cannot access a property or method of a null object reference.<br />
at mx.flash::UIMovieClip/removeFocusEventListeners()[E:\dev\trunk\frameworks\proje cts\flash-integration\src\mx\flash\UIMovieClip.as:2466]<br />
at mx.flash::UIMovieClip/focusOutHandler()[E:\dev\trunk\frameworks\projects\flash- integration\src\mx\flash\UIMovieClip.as:2509]<br />
at flash.display::Stage/set focus()<br />
at fl.core::UIComponent/setFocus()<br />
at fl.managers::FocusManager/setFocus()<br />
at fl.managers::FocusManager/mouseDownHandler()</code></p></blockquote>
<h4>Next, the symptoms:</h4>
<p>This error is a common one, the null object reference. Combine this with the referenced FocusManager and it is the kind of thing out of nightmares for any experienced ActionScript Developer.<br />
We are creating basic visual assets in Flash, and some of them are using Flash components. At first we assumed this was the cause, but it turns out that it wasn&#8217;t. Frequently we would click somewhere outside the app (to loose focus) or click on another component (transfer focus) and that error would come up so often our app was useless. Even just going to the debugger would cause it.</p>
<h4>Next, the cause:</h4>
<p>In the end we discoverd the error. We would remove an asset that we had created in flash from the stage. This *does not* trigger the focus to be transferred. (it probably should, but it is what it is at the moment.) There in lies our problem. A component would be off stage, but the focus manager wouldn&#8217;t know that. As soon as we would interact with something else and it would attempt to transfer focus *BOOM* the error would occur. This would happen because the asset no longer had a stage from which to remove the even listeners that UIMovieClip is automatically trying to do in it&#8217;s focusOutHandler function.</p>
<h3>Last, the workaround:</h3>
<p>To workaround his issue isn&#8217;t incredibly complex thankfully. You just have to remember to transfer the focus to something else, such as the mxml stage, or something else before removing any flash components from the stage. Simple right? Yes, but highly frustrating when you forget to do it. <a href="http://www.danwize.com/blog/">Danwize</a>, one of my co-workers filed a bug on bugs.adobe.com. You can vote, follow or, whatever, here: <a href="https://bugs.adobe.com/jira/browse/SDK-24015">bug# SDK-24015</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/captaincode.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/captaincode.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/captaincode.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/captaincode.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/captaincode.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/captaincode.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/captaincode.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/captaincode.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/captaincode.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/captaincode.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/captaincode.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/captaincode.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/captaincode.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/captaincode.wordpress.com/12/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=captaincode.wordpress.com&amp;blog=5874573&amp;post=12&amp;subd=captaincode&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://captaincode.wordpress.com/2009/11/05/focus-management-with-the-flex-component-kit-for-flash/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1caba5f859236a4a6c851bb237f8c1e8?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">captaincode</media:title>
		</media:content>
	</item>
		<item>
		<title>Validating a checkbox in Flex via MXML</title>
		<link>http://captaincode.wordpress.com/2009/10/29/validating-a-checkbox-in-flex-via-mxml/</link>
		<comments>http://captaincode.wordpress.com/2009/10/29/validating-a-checkbox-in-flex-via-mxml/#comments</comments>
		<pubDate>Thu, 29 Oct 2009 19:44:27 +0000</pubDate>
		<dc:creator>captaincode</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[Hints]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[Validation]]></category>

		<guid isPermaLink="false">http://captaincode.wordpress.com/?p=3</guid>
		<description><![CDATA[The other day, I ran into some trouble where I needed to validate a checkbox in Flex. I wanted to use a built-in validator, mostly for it&#8217;s ease of use, and because I am trying to keep basic elements like that into the MXML where I can. I searched around, and found some great tutorials [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=captaincode.wordpress.com&amp;blog=5874573&amp;post=3&amp;subd=captaincode&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The other day, I ran into some trouble where I needed to validate a checkbox in Flex. I wanted to use a built-in validator, mostly for it&#8217;s ease of use, and because I am trying to keep basic elements like that into the MXML where I can. I searched around, and found some<a href="http://blog.flexexamples.com/2007/08/13/validating-flex-forms-using-the-validator-classes/"> great tutorials</a> on using Validators, but nothing on doing it to a checkbox. So I endeavored to figure this out on my own. In the end I used a StringValidator to accomplish this. When it attemts to validate on the checkbox, the “selected” property is automatically coerced into a string format. So in case anyone else wants to do the same thing, use the code below.<br />
<code><br />
&lt;mx:FormItem label=&quot;I agree to the terms of use&quot; required=&quot;true&quot;&gt;<br />
	&lt;mx:CheckBox id=&quot;terms&quot;/&gt;<br />
&lt;/mx:FormItem&gt;<br />
&lt;mx:StringValidator source=&quot;{terms}&quot; required=&quot;true&quot; property=&quot;selected&quot; maxLength=&quot;4&quot; requiredFieldError=&quot;You must agree to the Terms of Use.&quot; tooLongError=&quot;You must agree to the Terms of Use.&quot;/&gt;<br />
</code></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/captaincode.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/captaincode.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/captaincode.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/captaincode.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/captaincode.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/captaincode.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/captaincode.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/captaincode.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/captaincode.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/captaincode.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/captaincode.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/captaincode.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/captaincode.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/captaincode.wordpress.com/3/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=captaincode.wordpress.com&amp;blog=5874573&amp;post=3&amp;subd=captaincode&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://captaincode.wordpress.com/2009/10/29/validating-a-checkbox-in-flex-via-mxml/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1caba5f859236a4a6c851bb237f8c1e8?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">captaincode</media:title>
		</media:content>
	</item>
	</channel>
</rss>
