The CHALLENGE:

Use the OOP methodology in Actionscript 3.0 to create a database application that allows users to register, order products and check for the order status. Also provide database admin access to the data.

The APPROACH:

First had to obtain the appropriate database. Decided on the Northwind sample database that shipped with MS Access. Exported the tables to Excel spreadsheets. Saved the Excel files as text based CSV files. Wrote a short Perl script to scrub the data and ensure data integrity for import to mySQL database.
Created tables on mySQL including indexes and primary keys using phpMyAdmin and hand coded SQL commands. Set up auto_increment, and date stamped columns.
Used an open source PHP script (bigdump) for batch upload of CSV files to mySQL database.
In Flash, imported GUI graphics created in Photoshop and Illustrator. Also used the new Filters feature in Flash CS3 to sharpen the vector based graphics that were made in the Flash authoring environment.
The Actionscript 3.0 code was designed using the “good old” MVC architecture. Even though I had to make some minor adjustments to the View component. Also used OOP design patterns like Abstract Factory (AS 3.0 does not support abstract classes but you can improvise), Strategy, and Singleton. The Yahoo Astra Flash library also came in handy. Since Adobe decided to remove the alert box from Flash CS3 and put it in Flex (much to my chagrin initially), but it made me discover Astra which has some really cool UI components.
The process was not without its challenges and some sleepless nights – Flash has some quirky ways of working that simply need getting used to. Sometimes even Google could not find the solution I was looking for. However I was able to get a working prototype published on my site and currently working on improving the user experience.

PostScript:

Lessons learned from this mini project include the vital importance of using OOP patterns, even when they may seem unnecessary. Most times some unforeseen bug turns up and there’s usually a pattern that will fix it. Also have to make the extra effort to write comments on all my files and decide on the best naming convention for my class files.