The naming scheme of your movie is very important for readability purposes. I mean that the type of the entity you are referring to should be obvious just by looking at its name. Your best bet then is to make your names phrases, or at least a series of words. Here's how I usually proceed:
I use a nice little sentence, everything lower case, with words separated by underscores. Keeping track of what a movie contains is not an easy thing, and giving them names like test01_b.swf will NOT help you to figure it out.
Function names usually begin with a lower case letter. It is very common for programmers to put a verb followed by a noun (first letter upper case). So if your function is supposed to get the position of a clip, it would be a good idea to call it getPosition(). You'll notice that this is how Macromedia named its own functions (startDrag, swapDepths, nextFrame).
Objects are capitalized. So are constructors. Instances of a class, on the other hand, begin with a lower case letter.
MyClass = function() {}; // constructor
aClass = new MyClass(); // instance
It is common practice to put constant names all upper case. Even if I never do it.
Variable names are a tiny bit more complicated. I'll start by what they should not be, and then will see the best practices.
function, if, while, for...), case, var, switch, MovieClip... I don't know the whole list, but if a variable name turns blue, it's usually not a good sign.8count = 0; // forbidden
_count.Now what you should do. This is not really critical, as Flash is not a strongly typed language, but it's better to precise the type anyway, one way or another.
If you have a movie clip of a line, call it mcLine. If it's an input string, make it sInput, an array of points aPoints and so on for the other types (textfield, date, sound, XML, color).
With the same examples, you'd have something like that: line_mc, input_str, points_arr.
There. That's about all I can think about. Once again, you don't HAVE TO use all this, but if you do, your code will be easier to read for everybody.
Just a final word before we wrap up. What you've seen here is freshly baked content without added preservatives, artificial intelligence, ads, and algorithm-driven doodads. A huge thank you to all of you who buy kirupa's books, became a paid subscriber, watch the videos, and/or interact on the forums.
Your support keeps this site going! 😇
- pom
:: Copyright KIRUPA 2026 //--