Oct 18, 2007 . Comments (1)
With the increase in Flex/Actionscript adoption and the increase in the size and complexity of applications being built, design patterns should be popping up on the radars of many developers who have not run across them before, especially Flash developers. You may already be using them and not even realize it, that was my case a few years ago. Simply put, design patterns are solutions to common problems that developers run across, normally with great frequency. Understanding what they are, how they work, and when to use them are things all good developers should be able to do. If you are new to design patterns there are two excellent books I would recommend reading.
The first book I read on design patterns was Head First Design Patterns. It is a very easy read on a very challenging topic. The samples are easy to understand (although in Java, which is close to AS3) and well presented. If you are new to design patterns this is a must read. My copy is well worn and marked up, always a good sign for a reference book.
The second book I highly recommend is one I just finished reading, Advanced Actionscript 3 with Design Patterns. This is a great resource book. It outlines practical uses for some common design patterns in actionscript projects. The patterns covered are explained thoroughly and the code examples are excellent. Just reading the code and following the logic will enhance your understanding of how to attack a problem and how to write clean, easy to follow code. An added bonus is the chapter on regular expressions and their use in AS3. It is likely the best explanation of regular expressions I have read in print.
I would suggest reading the Head First book first. It will give you an excellent foundational understanding of design patterns and clear up any foggy misconceptions you may have about what design patterns are and how to use them. I'm sure you will instantly discover a whole new way to approach development and architectural problems in your projects. Enjoy the reads.
Oct 17, 2007 . Comments (19)
One of the tedious tasks in creating a data intensive application is having to create value objects for all the business objects the application needs to work with. Typically these objects originate in a database somewhere and there is no easy way to automatically generate value objects that correspond to the database entities ... until now. The Value Object Creator allows you to easily convert database entities to AS3 classes. Run a simple SQL query (samples are provided in the application), go through 3 simple steps, and presto, you have nicely formatted AS3 value object classes. Download the application here. You will need the AIR runtime to run the application.
Oct 09, 2007 . Comments (8)
You may have noticed a new 'Captcha' widget on my site to test your 'humanness' and stop spammers. A few months ago I read a very interesting article in Wired about some work at Carnegie Mellon University by Luis von Ahn, creator of the original Captcha. The premise of the article is that humans are better suited to handle certain pattern recognition tasks than computers but in order to coax people into doing the tasks, they need to be stimulated somehow, ie make it fun. reCaptcha is exactly that, getting humans to help discern some scanned words that computers can not recognize.
The next-gen test presents two skewed words bisected by a line, making machine deciphering even harder. Both are taken from the Internet Archive's project to scan public-domain books. One word is known to the computer; the other couldn't be read by the Archive's scanners, so when you type it in you're doing a tiny bit of work for the project.
Check out reCaptcha.net to learn more about the project and how you can fight spam and help the human race.
Oct 03, 2007 . Comments (2)
I just ran across a very odd bug in Flex. If you want to change the background color of the application as it loads to anything other than the plain grey you can set the "
backgroundColor" attribute of the mx:Application container. This is the background color that gets displayed during the application loading, once it has loaded the background flips over to the gradient background (which you can also control). The "backgroundColor" attribute is the same for all flex components, and they all take any hex color value (ie #ffffff - white, #ff0000 - red, etc). All except the mx:Application that is. You have to prefix the value with '0x' (zero x) instead of '#'. I have no idea why, but it caused me a slight headache getting that little oddity sorted out so my application's background didn't flicker between white and black during loading.