<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Good, Fast, Cheap</title>
	<atom:link href="http://chrisluebcke.com/blog/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://chrisluebcke.com/blog</link>
	<description>(Pick any two)</description>
	<lastBuildDate>Thu, 27 May 2010 21:39:49 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Quick Tip on Generating Test Cases with FlexUnit 4/Flash Builder 4</title>
		<link>http://chrisluebcke.com/blog/?p=47</link>
		<comments>http://chrisluebcke.com/blog/?p=47#comments</comments>
		<pubDate>Thu, 27 May 2010 20:49:16 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[flashbuilder]]></category>
		<category><![CDATA[flexunit]]></category>

		<guid isPermaLink="false">http://chrisluebcke.com/blog/?p=47</guid>
		<description><![CDATA[Updated just a little while after posting, see the end
In my Presentation on FlexUnit 4 and Flash Builder 4, I made a flippant comment about the "Class to test" field on the New Test Case wizard not doing anything very helpful.

It turns out I missed a benefit, one potentially more useful than having a variable ]]></description>
			<content:encoded><![CDATA[<p><em>Updated just a little while after posting, see the end</em></p>
<p>In my <a href="http://chrisluebcke.com/blog/?p=4">Presentation on FlexUnit 4 and Flash Builder 4</a>, I made a flippant comment about the "Class to test" field on the New Test Case wizard not doing anything very helpful.</p>
<p><a href="http://chrisluebcke.com/blog/wp-content/uploads/2010/05/Picture-27.png"><img src="http://chrisluebcke.com/blog/wp-content/uploads/2010/05/Picture-27-300x61.png" alt="" title="Picture 27" width="450" height="91" class="aligncenter size-medium wp-image-48" /></a></p>
<p>It turns out I missed a benefit, one potentially more useful than having a variable named classToTestRef created for me. But it turns out that enabling this option in the wizard allows you to choose "Next" instead of just "Finish".</p>
<p><a href="http://chrisluebcke.com/blog/wp-content/uploads/2010/05/Picture-26.jpg"><img src="http://chrisluebcke.com/blog/wp-content/uploads/2010/05/Picture-26-300x249.jpg" alt="" title="Picture-26" width="450" height="375" class="aligncenter size-medium wp-image-49" /></a></p>
<p>And the next screen is pretty useful in certain circumstances:</p>
<p><a href="http://chrisluebcke.com/blog/wp-content/uploads/2010/05/Picture-28.jpg"><img src="http://chrisluebcke.com/blog/wp-content/uploads/2010/05/Picture-28.jpg" alt="" title="Picture-28" width="450" height="395" class="aligncenter size-full wp-image-55" /></a></p>
<p>This screen allows you to automatically generate test method stubs for each selected method in the class under test. As I've been adding a lot of unit tests to an existing, mature application that had none, this has been very useful indeed. </p>
<p>The generated test methods immediately fail, which is reasonable:</p>
<pre class="actionscript">&nbsp;
<span style="color: #66cc66;">&#91;</span>Test<span style="color: #66cc66;">&#93;</span>
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> testUpdateTask<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
<span style="color: #66cc66;">&#123;</span>
	Assert.<span style="color: #006600;">fail</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Test method Not yet implemented&quot;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;</pre>
<p>However, if you don't have the option of completing all the tests before doing anything else, I think it's also reasonable to ignore the ones you just haven't got to yet. </p>
<pre class="actionscript">&nbsp;
<span style="color: #66cc66;">&#91;</span>Ignore<span style="color: #66cc66;">&#93;</span>
<span style="color: #66cc66;">&#91;</span>Test<span style="color: #66cc66;">&#93;</span>
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> testUpdateTask<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
<span style="color: #66cc66;">&#123;</span>
	Assert.<span style="color: #006600;">fail</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Test method Not yet implemented&quot;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;</pre>
<p>This raises the "ignored" count in your test run results, and an "ignore" count > 0 is a constant reminder that there is some work needing to be done. But I think that an unwritten test, while still a problem that needs to be addressed, is a different kind of problem than a failure in a test that should work. Maybe I'm just not hardcore enough.</p>
<p><strong>Update</strong></p>
<p>Actually it seems that this option doesn't even create the <code>classToTestRef</code> variable any more, so my original objection is now completely invalid, and I'm happy about it <img src='http://chrisluebcke.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://chrisluebcke.com/blog/?feed=rss2&amp;p=47</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Displaying Flex Log Messages In Your Flex Application</title>
		<link>http://chrisluebcke.com/blog/?p=42</link>
		<comments>http://chrisluebcke.com/blog/?p=42#comments</comments>
		<pubDate>Wed, 26 May 2010 16:51:13 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[log]]></category>
		<category><![CDATA[log target]]></category>
		<category><![CDATA[logging]]></category>

		<guid isPermaLink="false">http://chrisluebcke.com/blog/?p=42</guid>
		<description><![CDATA[One of the first things I want to do after spending any time in an application is enable logging. We all know that trace() is the moral equivalent of System.out.println(), sharing its ease of use, ubiquity and distastefulness. Logging (whether you use the Flex logging API or some other tool) is far superior, for reasons ]]></description>
			<content:encoded><![CDATA[<p>One of the first things I want to do after spending any time in an application is enable logging. We all know that <code>trace()</code> is the moral equivalent of <code>System.out.println()</code>, sharing its ease of use, ubiquity and distastefulness. Logging (whether you use the Flex logging API or some other tool) is far superior, for reasons best left to another post.</p>
<p>Usually the <code>TraceTarget</code> is good enough for my purposes as a developer, but I recently found myself tasked to build a utility application that would be testing the behavior of other components and loaded SWF files, and I want all of my lovely log messages to be displayed in a panel within the application itself. It turns out that this is very straightforward, just as long as you already know how to do it. Here's how (or at least here's how I did it).</p>
<h3>1. Create a Simple Log Target</h3>
<p>First, I created a simple log target that would provide an easy way for a visual component to display the log messages. I settled on creating a target that exposed a bindable <code>ArrayCollection</code>. To keep things from spinning wildly out of control, I added a configurable limit on the number of log message the ArrayCollection would retain, but other than that I didn't design this with performance in mind; it's a utility class for a utility application, and I'd want to do a more thorough job of analyzing how it would fare under high stress before it was deployed in a production application.</p>
<pre class="actionscript">&nbsp;
package com.<span style="color: #006600;">chrisluebcke</span>.<span style="color: #006600;">utils</span>
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #0066CC;">import</span> mx.<span style="color: #006600;">collections</span>.<span style="color: #006600;">ArrayCollection</span>;
	<span style="color: #0066CC;">import</span> mx.<span style="color: #006600;">core</span>.<span style="color: #006600;">mx_internal</span>;
	<span style="color: #0066CC;">import</span> mx.<span style="color: #006600;">logging</span>.<span style="color: #006600;">targets</span>.<span style="color: #006600;">LineFormattedTarget</span>;
&nbsp;
	use namespace mx_internal;
&nbsp;
	<span style="color: #808080; font-style: italic;">/**
	 * A log target that provdes an ArrayCollection (with a configurable maximum size) that can
	 * (for example) be used by UI components to display log messages on-screen.
	 */</span>
	<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> ArrayCollectionLogTarget <span style="color: #0066CC;">extends</span> LineFormattedTarget
	<span style="color: #66cc66;">&#123;</span>
		<span style="color: #66cc66;">&#91;</span>Bindable<span style="color: #66cc66;">&#93;</span>
		<span style="color: #66cc66;">&#91;</span>ArrayElementType<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;String&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#93;</span>
		<span style="color: #808080; font-style: italic;">/**
		 * The collection containing the log messages
		 */</span>
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">log</span> : ArrayCollection;
&nbsp;
		<span style="color: #808080; font-style: italic;">/**
		 * The maximum number of log messages.
		 */</span>
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> maxMessages : <span style="color: #0066CC;">Number</span> = <span style="color: #cc66cc;">10000</span>;
&nbsp;
		<span style="color: #808080; font-style: italic;">/**
		 * Constructor.
		 */</span>
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> ArrayCollectionLogTarget<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
		<span style="color: #66cc66;">&#123;</span>
			<span style="color: #0066CC;">super</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #0066CC;">log</span> = <span style="color: #000000; font-weight: bold;">new</span> ArrayCollection<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		override mx_internal <span style="color: #000000; font-weight: bold;">function</span> internalLog<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">message</span> : <span style="color: #0066CC;">String</span><span style="color: #66cc66;">&#41;</span> : <span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
			<span style="color: #0066CC;">log</span>.<span style="color: #006600;">disableAutoUpdate</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #0066CC;">log</span>.<span style="color: #006600;">addItem</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">message</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">log</span>.<span style="color: #0066CC;">length</span> &gt; maxMessages<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
				<span style="color: #0066CC;">log</span>.<span style="color: #006600;">removeItemAt</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #66cc66;">&#125;</span>
			<span style="color: #0066CC;">log</span>.<span style="color: #006600;">enableAutoUpdate</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span>
&nbsp;</pre>
<p>The bit about <code>mx_internal</code> is what takes you hours to figure out the first time you try to write a useful subclass of <code>LineFormattedTarget</code>. You're welcome. Other than that, this should be pretty straightforward. (It's very helpful to look at the code for <code>TraceTarget</code>, which is really even simpler than this, as a guide).</p>
<h3>2. Instantiate and Bind The Target</h3>
<p>To use the target, you need to declare it in MXML. I'm not sure if doing so somewhere besides your top-level <code>Application</code> (or subclass thereof) would work, but it always seems to go there. (I'm sure that you could create a more flexible system by creating your log targets via ActionScript. Another day).</p>
<pre class="xml">&nbsp;
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;utils:ArrayCollectionLogTarget</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;acLogTarget&quot;</span>
		<span style="color: #000066;">includeDate</span>=<span style="color: #ff0000;">&quot;false&quot;</span>
		<span style="color: #000066;">includeTime</span>=<span style="color: #ff0000;">&quot;true&quot;</span>
		<span style="color: #000066;">includeCategory</span>=<span style="color: #ff0000;">&quot;true&quot;</span>
		<span style="color: #000066;">includeLevel</span>=<span style="color: #ff0000;">&quot;true&quot;</span>
		<span style="color: #000066;">level</span>=<span style="color: #ff0000;">&quot;{LogEventLevel.DEBUG}&quot;</span><span style="font-weight: bold; color: black;">/&gt;</span></span>
&nbsp;</pre>
<p>(This is, naturally, exactly like setting up a <code>TraceTarget</code>.)</p>
<p>With that done, you can now use the target's <code>log</code> property (a bindable <code>ArrayCollection</code>) however you'd like. Say, in a <code>List</code>:</p>
<pre class="actionscript">&nbsp;
&lt;mx:Panel id=<span style="color: #ff0000;">&quot;logPanel&quot;</span> title=<span style="color: #ff0000;">&quot;Log&quot;</span> <span style="color: #0066CC;">width</span>=<span style="color: #ff0000;">&quot;100%&quot;</span> <span style="color: #0066CC;">height</span>=<span style="color: #ff0000;">&quot;50%&quot;</span> &gt;
	&lt;mx:<span style="color: #0066CC;">List</span> id=<span style="color: #ff0000;">&quot;logList&quot;</span>
			horizontalScrollPolicy=<span style="color: #ff0000;">&quot;on&quot;</span>
			<span style="color: #0066CC;">width</span>=<span style="color: #ff0000;">&quot;100%&quot;</span> <span style="color: #0066CC;">height</span>=<span style="color: #ff0000;">&quot;100%&quot;</span>
			dataProvider=<span style="color: #ff0000;">&quot;{acLogTarget.log}&quot;</span>/&gt;
&lt;/mx:Panel&gt;
&nbsp;</pre>
<p>Now any logger statements that exceed your log level (and match any filters) will show up in UI, as well as any other targets you've configured. I've found this quite useful, and I hope you do too.</p>
]]></content:encoded>
			<wfw:commentRss>http://chrisluebcke.com/blog/?feed=rss2&amp;p=42</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>The Official Flex Singleton</title>
		<link>http://chrisluebcke.com/blog/?p=32</link>
		<comments>http://chrisluebcke.com/blog/?p=32#comments</comments>
		<pubDate>Sun, 04 Apr 2010 18:21:37 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://chrisluebcke.com/blog/?p=32</guid>
		<description><![CDATA[Didn't know there was one, didja? Well, you was wrong.
&#160;
package mx.core
&#123;
&#160;
&#91;ExcludeClass&#93;
&#160;
/**
 *  @private
 *  This all-static class serves as a singleton registry.
 *
 *  For example, pop-up management throughout a Flex application
 *  is provided by a single instance of the PopUpManagerImpl class,
 *  even when the main application loads ]]></description>
			<content:encoded><![CDATA[<p>Didn't know there was one, didja? Well, you was wrong.</p>
<pre class="actionscript">&nbsp;
package mx.<span style="color: #006600;">core</span>
<span style="color: #66cc66;">&#123;</span>
&nbsp;
<span style="color: #66cc66;">&#91;</span>ExcludeClass<span style="color: #66cc66;">&#93;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">/**
 *  @private
 *  This all-static class serves as a singleton registry.
 *
 *  For example, pop-up management throughout a Flex application
 *  is provided by a single instance of the PopUpManagerImpl class,
 *  even when the main application loads modules and sub-applications
 *  each of which might have PopUpManagerImpl linked in.
 *
 *  The factory class for a framework-based application
 *  or a module (i.e., SystemManager or FlexModuleFactory,
 *  both of which implements IFlexModuleFactory) calls
 *  the registerClass() method to populate the registry.
 *
 *  Later, other classes call getInstance() to access
 *  the singleton instance.
 *
 *  The registry policy is &quot;first class in wins&quot;.
 *  For example, if the main application registers its
 *  PopUpManagerImpl, then a loaded SWF will use that one.
 *  However, if the main application doesn't contain
 *  a PopUpManagerImpl, then it registers null,
 *  and the first loaded SWF containing a PopUpManagerImpl
 *  will register that one.
 */</span>
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> Singleton
&nbsp;</pre>
<p>Etcetera. </p>
<p>I actually completely get why it's there, and also why it's as far out of view as an open source class could be. It's there to support the myriad <code>*Manager</code> classes (and for a few other things, like the <code>IEmbeddedFontFactory</code> and <code>ITextFieldFactory</code>), by both providing a registry for them and helping to enforce their singleton-ness. It's on the down low, I imagine, because it would probably be abused to hell if it weren't. I mean, sure, common wisdom these days trends towards calling them "Stinkletons" and throwing rotten fruit at them, but look at the <a href="http://www.google.com/search?q=flex+singleton&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a">sheer amount of bandwidth</a> that's been devoted to making them bulletproof. If you build an inviting home for singletons, people will start stacking them ten deep.</p>
<p>Singletons: Smelly, yet appealing</p>
<p>The truth is, this thing isn't a singleton; it's a static registry, and it doesn't have anything to do with implementing a <a href="http://en.wikipedia.org/wiki/Singleton_pattern">singleton pattern</a>. What it does is make sure that you can only register a class for a given interface once (hence the dreaded errors when some module, rather than the main application, happens to be the first to register a manager class), and it conveniently calls <code>getInstance()</code> when you want an instance of the interface in question, but that's about it.</p>
<p>Still, having elevated the profile of this class in my own small way, I have to say that you probably shouldn't use it unless you're doing the exact same thing--registering a manager or factory of the type that already use this. Resist at all costs the creeping suspicion that you've finally found a good point to which to affix your data model, and go get yourself some dependency injection.</p>
]]></content:encoded>
			<wfw:commentRss>http://chrisluebcke.com/blog/?feed=rss2&amp;p=32</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Loading Files Into Flex Applications&#8211;Now Server-Free!</title>
		<link>http://chrisluebcke.com/blog/?p=26</link>
		<comments>http://chrisluebcke.com/blog/?p=26#comments</comments>
		<pubDate>Sat, 03 Apr 2010 20:11:36 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://chrisluebcke.com/blog/?p=26</guid>
		<description><![CDATA[Okay, maybe it's been server-free for a while, and there are apparently limitations, but this is still pretty cool. Turns out that as of later versions of Flash Player 9 (and continuing on to today), you can inspect a file selected by a user for upload without having to send it off to a server ]]></description>
			<content:encoded><![CDATA[<p>Okay, maybe it's been server-free for a while, and there are apparently limitations, but this is still pretty cool. Turns out that as of later versions of Flash Player 9 (and continuing on to today), you can inspect a file selected by a user for upload without having to send it off to a server and get it back again. I stumbled across <a href="http://www.flexpasta.com/index.php/2010/02/21/uploading-files-with-firefox-solution/#comments">this</a> while poking around for resources on the nitty gritty details of the Spark architecture--it wasn't what I was looking for, but it was a nice surprise, since the last time I'd been asked to look into this (a couple years ago), the answer seemed to be a pretty resounding "no".</p>
<p>Behold:</p>
<div id="attachment_27" class="wp-caption alignleft" style="width: 584px"><a href="http://chrisluebcke.com/blog/wp-content/uploads/2010/04/Screen-shot-2010-04-03-at-12.58.02-PM.png"><img class="size-full wp-image-27 " title="Awesome" src="http://chrisluebcke.com/blog/wp-content/uploads/2010/04/Screen-shot-2010-04-03-at-12.58.02-PM.png" alt="Screen shot showing MXML file loaded locally into Flex application" width="574" height="467" /></a><p class="wp-caption-text">Awesome. And meta.</p></div>
<p>The code for the above is quite simple:</p>
<pre class="actionscript">&nbsp;
&lt;?<span style="color: #0066CC;">xml</span> <span style="color: #0066CC;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?&gt;
&lt;s:Application xmlns:fx=<span style="color: #ff0000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span>
			   xmlns:s=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/spark&quot;</span>
			   xmlns:mx=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/mx&quot;</span>&gt;
&nbsp;
	&lt;fx:Script&gt;
		&lt;!<span style="color: #66cc66;">&#91;</span>CDATA<span style="color: #66cc66;">&#91;</span>
			<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> fr : FileReference = <span style="color: #000000; font-weight: bold;">new</span> FileReference<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
			<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> getFile<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> : <span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
				fr.<span style="color: #006600;">browse</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
				fr.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">SELECT</span>, handleSelect<span style="color: #66cc66;">&#41;</span>;
				fr.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">COMPLETE</span>, handleComplete<span style="color: #66cc66;">&#41;</span>;
			<span style="color: #66cc66;">&#125;</span>
&nbsp;
			<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> handleSelect<span style="color: #66cc66;">&#40;</span>event : Event<span style="color: #66cc66;">&#41;</span> : <span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
				fr.<span style="color: #0066CC;">load</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #66cc66;">&#125;</span>
&nbsp;
			<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> handleComplete<span style="color: #66cc66;">&#40;</span>event : Event<span style="color: #66cc66;">&#41;</span> : <span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
				contents.<span style="color: #0066CC;">text</span> = <span style="color: #0066CC;">String</span><span style="color: #66cc66;">&#40;</span>fr.<span style="color: #0066CC;">data</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #66cc66;">&#125;</span>
&nbsp;
			protected <span style="color: #000000; font-weight: bold;">function</span> button1_clickHandler<span style="color: #66cc66;">&#40;</span>event:MouseEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
			<span style="color: #66cc66;">&#123;</span>
				getFile<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#93;</span>&gt;
	&lt;/fx:Script&gt;
&nbsp;
	&lt;s:layout&gt;
		&lt;s:VerticalLayout paddingLeft=<span style="color: #ff0000;">&quot;10&quot;</span> paddingRight=<span style="color: #ff0000;">&quot;10&quot;</span> paddingBottom=<span style="color: #ff0000;">&quot;10&quot;</span> paddingTop=<span style="color: #ff0000;">&quot;10&quot;</span> gap=<span style="color: #ff0000;">&quot;10&quot;</span>/&gt;
	&lt;/s:layout&gt;
&nbsp;
	&lt;s:<span style="color: #0066CC;">Button</span> label=<span style="color: #ff0000;">&quot;Select File&quot;</span> click=<span style="color: #ff0000;">&quot;button1_clickHandler(event)&quot;</span>/&gt;
	&lt;s:Label <span style="color: #0066CC;">text</span>=<span style="color: #ff0000;">&quot;File Contents:&quot;</span>/&gt;
	&lt;s:TextArea id=<span style="color: #ff0000;">&quot;contents&quot;</span> <span style="color: #0066CC;">width</span>=<span style="color: #ff0000;">&quot;100%&quot;</span> <span style="color: #0066CC;">height</span>=<span style="color: #ff0000;">&quot;100%&quot;</span>/&gt;
&lt;/s:Application&gt;
&nbsp;</pre>
<p>The original point of the <a href="http://www.flexpasta.com/index.php/2010/02/21/uploading-files-with-firefox-solution/#comments">post at Flex Pasta</a> (which I'm new to, but seems delicious, although filling) was to get around upload bugs with Firefox, and various commenters pointed out additional limitations in using this technique for uploading data to a server. That said, this seems imminently useful in a number of applications-for example, reading a CSV into a data grid (yeah, that's the kind of super-sleek development I do a lot of).</p>
]]></content:encoded>
			<wfw:commentRss>http://chrisluebcke.com/blog/?feed=rss2&amp;p=26</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Unit Testing Flex with FlexUnit 4 and Flash Builder 4</title>
		<link>http://chrisluebcke.com/blog/?p=4</link>
		<comments>http://chrisluebcke.com/blog/?p=4#comments</comments>
		<pubDate>Wed, 31 Mar 2010 03:28:01 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[flashbuilder]]></category>
		<category><![CDATA[flexunit]]></category>

		<guid isPermaLink="false">http://chrisluebcke.com/blog/?p=4</guid>
		<description><![CDATA[I had a great time giving a presentation on these subjects at the Silicon Valley Flex User Group (forevermore referred to as "silvafug") last week--actually twice, once for the San Francisco meting and the next day in San Jose. I'm not going to try to recreate the presentation in this post, but I wanted to ]]></description>
			<content:encoded><![CDATA[<p>I had a great time giving a presentation on these subjects at the <a href="http://silvafug.org">Silicon Valley Flex User Group</a> (forevermore referred to as "silvafug") last week--actually twice, once for the San Francisco meting and the next day in San Jose. I'm not going to try to recreate the presentation in this post, but I wanted to provide some resources. Before I move on, though, I again want to thank <a href="http://blogs.digitalprimates.net/codeSlinger/">Mike Labriola</a> at <a href="http://www.digitalprimates.net/">Digital Primates</a> for graciously answering my largely esoteric questions in detail.</p>
<p>This was the first time I used Apple's Keynote, so that's the native form for my presentation. I had a great time experimenting with the builds and transitions, and I'm sure nobody enjoyed all the pizazz more than me. I've also exported it to PowerPoint for the majority of you out there; the transitions came across pretty chunky, but I really didn't feel like spending a couple hours cleaning it up for PPT. Sorry, Windows users. Anyway, here are both versions:</p>
<ul>
<li>Keynote version:<a href="/blog/wp-content/uploads/2010/03/UnitTestingFB4.key_.txt"> UnitTestingFB4.key_.txt</a> (You'll need to change the extension to just ".key"; either WordPress or my penny-ante hosting provider didn't like that extension, for reasons that are obvious but silly)</li>
<li>PowerPoint version: <a href="/blog/wp-content/uploads/2010/03/UnitTestingFB4.ppt">UnitTestingFB4.ppt</a></li>
</ul>
<p>Keynote also has a handy export-to-PDF feature which, thanks to all the aforementioned pizazz, resulted in a PDF that was approximately 15 MB, 150 pages, and had half the text colors switched to black. You didn't really want that, so I'm not going to try and give it to you.</p>
<p>That said, if you weren't at the presentation (or don't already know a bit about the subject matter) these won't be easy to follow. I use slides to support what I'm saying, rather than as something to read in front of a crowd of people, so they work better with me talking over them. We're working on getting the recorded presentations posted, and I'll update this with the link when they're ready.</p>
<p>Now for the useful stuff--link party!</p>
<p><strong>FlexUnit 4</strong></p>
<ul>
<li><a href="http://flexunit.org/">http://flexunit.org/</a></li>
<li><a href="http://blogs.digitalprimates.net/codeslinger/index.cfm?mode=entry&amp;entry=09AC8A62-1372-FA49-997009270D1793FC">http://blogs.digitalprimates.net/codeslinger/index.cfm?mode=entry&amp;entry=09AC8A62-1372-FA49-997009270D1793FC</a></li>
</ul>
<p><strong>Flash Builder 4 and FlexUnit</strong></p>
<ul>
<li><a href="http://help.adobe.com/en_US/Flex/4.0/UsingFlashBuilder/WS27ECA937-059A-4308-A2E2-F3A3AAB64337.html">http://help.adobe.com/en_US/Flex/4.0/UsingFlashBuilder/WS27ECA937-059A-4308-A2E2-F3A3AAB64337.html</a></li>
</ul>
<p><strong>FlexUnit is Not the Only Game In Town</strong></p>
<ul>
<li><a href="http://asunit.org/">http://asunit.org/</a></li>
</ul>
<p><strong>General Unit Testing Topics<br />
</strong></p>
<ul>
<li><a href="http://en.wikipedia.org/wiki/Unit_testing">http://en.wikipedia.org/wiki/Unit_testing</a></li>
<li><a href="http://en.wikipedia.org/wiki/XUnit">http://en.wikipedia.org/wiki/XUnit</a></li>
<li><a href="http://en.wikipedia.org/wiki/List_of_unit_testing_frameworks">http://en.wikipedia.org/wiki/List_of_unit_testing_frameworks</a></li>
<li><a href="http://xunitpatterns.com/Book%20Outline%20Diagrams.html">http://xunitpatterns.com/Book%20Outline%20Diagrams.html</a></li>
</ul>
<p><strong>Test-Driven Development</strong></p>
<ul>
<li><a href="http://en.wikipedia.org/wiki/Test_driven_development">http://en.wikipedia.org/wiki/Test_driven_development</a></li>
<li><a href="http://192.150.8.60/devnet/flex/articles/flashbuilder4_tdd_02.html">http://192.150.8.60/devnet/flex/articles/flashbuilder4_tdd_02.html</a></li>
</ul>
<p><strong>Code Coverage</strong></p>
<ul>
<li><a href="http://code.google.com/p/flexcover/">http://code.google.com/p/flexcover/</a></li>
</ul>
<p>Thanks to everyone who came out.</p>
<div id="attachment_10" class="wp-caption aligncenter" style="width: 472px"><a href="http://chrisluebcke.com/blog/wp-content/uploads/2010/03/Picture-29.png"><img class="size-full wp-image-10 " title="Beck the Creator" src="http://chrisluebcke.com/blog/wp-content/uploads/2010/03/Picture-29.png" alt="Image of Kent Beck, creator of SUnit, superimposed on Michaelangelo's &quot;Creation&quot; from the Sistene Chapel" width="462" height="220" /></a><p class="wp-caption-text">Kent Beck, the Creator of SUnit (a clip from one of my slides; that&#39;s God bringing Adam to life in the Sistine Chapel, if you didn&#39;t get it.)</p></div>
]]></content:encoded>
			<wfw:commentRss>http://chrisluebcke.com/blog/?feed=rss2&amp;p=4</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

