Becoming proficient in programming ActionScript in Flash takes more than spewing object-oriented buzzwords and writing complex classes only decipherable to elite Flash geeks. In my opinion, there are three lost arts in Flash programming; in this article we’ll talk briefly about commenting.
How could such fundamental techniques as these actually be on the verge of extinction, you ask? The answer is obvious: Amidst the daily whirlwind of demanding clients and looming project deadlines, it’s easier (and faster) to code projects without taking the time to include explanations for each line of code you type.
The reality however, is this: The time you take up front to properly comment your code and add meaningful trace statements within your ActionScript, the more time that will be saved when you revisit this file in 2 weeks, 2 months or 2 years. It also serves as the key to other developers who may need to jump in on your project or make updates in your absence. If you’re already commenting your code, I applaud you and grant you the permission to skip the rest of this article and spread the gospel.
Commenting Your Code
Commenting your ActionScript should be second-nature. It’s probably the easiest element you can contribute to your Flash application. There are countless techniques and preferences on how commenting should be formatted. The most important aspect of commenting is that you are clear and concise, so that your functionality will make sense to someone else (and even yourself) later down the road. Comment every variable, function and loop in your application so it reads fluently as a step-by-step guide to how your brain works. Also make sure you use variable and function names that make sense (one of the ‘lost arts’ to be covered in a subsequent article).
While programming your app, it’s helpful to keep the following in mind:
- Will someone else be able to understand how I programmed this app?
- In 2 weeks (months, years), will I be able to understand how I programmed this app?
Wow, that’s a short list. That’s because commenting should be an integral part of your workflow. Taking the extra time to type a few comments will save you (or someone else) their time and their sanity, and make you look like a well-balanced, ‘big picture’ oriented Flash programmer.
Category: Flash AS2, Flash AS3
Leave a Reply



