03.09.2010 / Queue N Cache

As promised, below you can find the source code and slides from my Queue N Cache presentation from the 360|Flex conference. For those who were there, thanks for coming. I really enjoy learning with you all and being able to share when I can.

First, the sample application for queuing and caching. Keep in mind that images loaded into the application will be cached in the browser, so depending on what you’re wanting to test you may need to clear your browser cache between tests. Right-click the application to access the source.

Second, the presentation slides. Here they are as a “slidecast” but they’re a little different than the live ones. I think the live video will be made available shortly so if you’re looking for that check back later. Also, this slidecast was made through SlideShare and their audio-syncing tool is a little limiting so the audio might get unsynced for a moment. In any case, enjoy!


02.10.2010 / Sneak Peek: Queue N Cache

The 360|Flex conference is nigh upon us. Don’t miss out on an excellent opportunity to be one with your species and discuss all things Flex. If you haven’t yet picked up your ticket, you best get on it! The conference starts on the 7th of March and runs through the 10th in sunny San Jose, CA.

This year, yours truly will be presenting the topic Queue N Cache. With a name like that, I’m sure flexers worldwide will be scrambling for a seat. I know I know, you’re thinking, “Queuing and caching? That oughtta be a party.” No. It’s Queue *N* Cache and that’s one party that runs year-round. Oh sure, we’ll talk a little about the ho-hum of your grandma’s queues and caches, but this is where rubber meets the road with real-world projects and situations where queuing and caching can achieve greatness. Have you ever sat back and wondered:

  • How could I improve user experience by paying more attention to the user’s focus?
  • How could I have greater control over my service calls and asset loaders? Timeouts and retries? Call me crazy.
  • How could I decrease memory usage and processing load by sharing image data?
  • How could I increase responsiveness through improved data management?
  • How could I show progress of shared image data in multiple locations?

If you can’t make it (Tuesday @ 2:30) or just can’t get enough, I’ll post my slides and code after the preso and you can dig in to your heart’s content. See you there!


02.04.2010 / Flex 4 with a Hint of AIR 2

Here’s my presentation from today’s training at Rain entitled Flex 4 with a Hint of AIR 2. Enjoy!


12.19.2009 / Finding nodes with a namespaced attribute using e4x

When digging through XML, e4x is definitely your friend but it can be tricky sometimes. I recently came across a situation where I needed to find all nodes with a certain namespaced attribute. I didn’t care what the attribute’s value was; I just needed to know which nodes had the attribute. Continue reading »


11.08.2009 / Insurance and Pre-existing Conditions

Ah, “pre-existing conditions.” A couple words that bring us all together in peace and harmony and close the gap amongst parties, races, and economic classes. Uniting words for all of us to use as joint artillery against the evil insurance companies that stand behind their faceless discriminatory practices. A concept that the most inhumane of inhumane would indisputably agree is inhumane.

Except me. Wikipedia defines insurance as “a form of risk management primarily used to hedge against the risk of a contingent loss. Insurance is defined as the equitable transfer of the risk of a loss, from one entity to another, in exchange for a premium, and can be thought of as a guaranteed and known small loss to prevent a large, possibly devastating loss.”

In other words, insurance is basically a big group of people that are willing to pay a little now to prevent the possibility of paying a large amount later due to some unfortunate, unforeseen occurrence. Insurance can exist because only a relatively small portion of insured are going to become critically injured or sick. From another perspective, this means that a majority of the insured are putting in more than they are taking out. But they keep putting money in because they know they may someday be one of the lucky losers. Not all the insured will or can be lucky losers; not enough money would exist to pay for the expenses. Insurance would cease to exist. Continue reading »


10.17.2009 / Showing Progress for Multiple Loaders

A common thing to do in most any rich application is to show progress while loading remote assets. In ActionScript, the bytesLoaded and bytesTotal properties of classes such as LoaderInfo and URLLoader provide the needed information to show a fancy percentage-based progress indicator. The bytesLoaded property is updated as more and more of the asset is loaded in. Divide that by the bytesTotal and you have the percentage loaded.

Easy enough. How about multiple loaders? Lets say you have a group of 10 images and you’d like to show progress for all the images collectively. Because you have 10 different images you also have 10 different URLLoader instances (or Loader instances, whatever suits your fancy)–one for each image. Math would say that you divide the sum of bytesLoaded by the sum of bytesTotal and that gives you the percentage complete. Two issues arise: Continue reading »


09.02.2009 / Piano Marvel: Interactive Piano Lessons

Rain, where I work, has released yet another super-duper app. It’s called Piano Marvel and it’s set to revolutionize how people learn how to play the piano. I’m not a piano player myself, but I do remember taking piano lessons as a kid. I hated it. It was monotonous, inconvenient, and felt like a chore. I wasn’t intrigued and I don’t believe I was the only kid that felt this way.

A while back, Guitar Hero hit the gaming industry by storm and kids flocked to learning the guitar. Sure, it wasn’t a real guitar, but it was still an instrument of sorts and kids were still learning hand-eye-ear coordination, rhythm, and other music essentials. The game was a huge success, bringing in over $1 billion in sales in the first 26 months and set an industry record.

Why such a difference in my experience learning how to play the piano years ago and kids learning the pseudo-guitar with Guitar Hero? Guitar Hero provides objectivity, benchmarking, competition, and addiction. You can play with your friends in a fun atmosphere. Piano Marvel takes these concepts and applies them to learning the piano. Students play along to accompaniment, see exactly which notes they hit and when they hit them, and earn trophies as they complete increasingly difficult exercises. They can practice whenever they choose and can even battle it out with their piano-playing comrades. Continue reading »


08.30.2009 / Kelly Clarkson iPhone App

The company I work at, Rain, has officially entered the iPhone development arena. This week we released an application for Kelly Clarkson (i.e., Sony BMG) called Kelly Clarkson: Open Mic. While I didn’t personally work on this application, I am proud of my co-workers and their serious skills at taking the app from scratch to the big show. Continue reading »


08.23.2009 / Skinnable Knob Component

Recently I went searching for Flex knob components on the web and found they either weren’t equipped for my needs or closed source. So, I cooked up my own knob (or dial) component that hopefully someone out there can use. Go do something cool with it. Continue reading »


08.14.2009 / Loading a Remote Module into a Local App

At work, we deal a lot with loading modules residing on remote servers into our applications running locally.  By locally I mean from a local path on our hard drives (the default Flex Builder run/debug settings), not on a local web server instance (localhost).  Depending on what type of module we are loading, we would normally use one of Flex’s built-in functions to load modules:

// Loading a language resource module:
resourceManager.loadResourceModule('http://aaronhardy.com/en_US_ResourceModule.swf');
 
// Loading a style module (e.g., a compiled font swf):
StyleManager.loadStyleDeclarations("http://aaronhardy.com/fonts/Astroid.swf");
 
// Loading miscellaneous modules:
var moduleInfo:IModuleInfo = ModuleManager.getModule('http://aaronhardy.com/MyModule.swf');
moduleInfo.load();

But these methods of importing modules result in errors like the following:

Unable to load resource module from http://aaronhardy.com/en_US_ResourceModule.swf
Error: Unable to load style(SWF is not a loadable module): http://aaronhardy.com/fonts/Astroid.swf.

Continue reading »