Recently (yesterday in fact), I decided to finally finish up a small project that I had on the go for a couple of days now of converting over an AS2 FLA to AS3 and redo all the code in it. When I first got into it I didn’t expect to be working for more than an hour or so but it in fact turned into a few hours and change. I was quite surprised at the extent of code I ended up writing to do the same thing in AS2.
The project was to redo the top menu/banner area for FMSGuru.com. Looking at it, you wouldn’t think too much of it. It has 6 buttons plus the logo and some text based links up in the top right. Those stayed as they were. The buttons had to all be recoded with the addEventListener scheme and of course set to be buttons so the hand would show up when moused over. Then there is the banner video animation that shows up, and last but not least a little surprise for new users to the site (kinda like an easter egg but easy to find). It’s a video animation too but doesn’t run the same as the banner.
So I needed to recode two netConnections (one local, one remote), two netStreams to go with that and then also a shared object to keep track of things. Shared objects are handy things..
With that, I had an idea for a winter theme, so I converted some old AS2 code for that, did some photoshop stuff (that was a couple of hours on it’s own) and in the end finally got a project that I was content enough with to call “good enough”. All in all, a simple idea to get some code up to date in AS3 took over a day.
The moral of this story is that some things don’t just get converted over. We have clients come to us ALL THE TIME, asking if we could convert over or rebuild an AS2 project (we tend to not even work on AS2 items unless they are VERY small). There seem to be a lot of developers out there still that are working in AS2. Essentially they have messed up the project and when those clients finally make it to us with their spaghetti mess of a file, we then have to tell their now empty wallets that we can’t really work with whoever’s pile of crap that they spent all their money on and need to start from scratch.
Ever seen the show “Holmes on homes”? That’s how we feel all the time..
Anyways, so we recommend rebuilding. It’s going to cost. It sucks, we get it and do our best to lessen the blow, but in the end you’re going to have a better set of files that can actually be built on to. Far less or even zero bugs in comparison and it’s going to be more efficient and work better. This rebuilding of the banner really reminded me that even a small project that took maybe an hour or two in AS2 to put together, can take a few hours or more in AS3. Ideas will come to mind, functionality will be made more modular and when it comes to building on or changing that file I’ll be able to do so with ease. I used up time now to save later. Now that’s a theme that a lot of our almost clients don’t see. What do they do? They go find the cheap guy again to “fix the code”. In the end.. they’ve lost out. They’ve now spent more money on more crap that when it finally does come down to doing right, is going to really cost them an arm and a leg. Not only in time but also money.
Sad but true story, we see this way too often. Luckily the clients that do come on board and drink the koolaid with trepidation end up far happier in the end and when they come back for that “small change”, it usually is a small change and something simple to get in. We’ve modularized the code, broken things up nicely to build on to and made it efficient and understandable. A good example was something very recent, a video player, that was 3 files before with about 1800 lines? I can’t recall exactly, and turned into about 20 files all nicely separated out. They had a couple of changes that needed to be made, no problem, change this here in this descriptive file name and change that over there in that descriptive file name. Simple.
As Mike would say, do it right the first time. If you didn’t, then do it right the second time learning from the first time. Sometimes you have to take two steps back to go forward three.
If anybody figures out the easter egg, let me know what you think 🙂