For your own sake and that of anyone who may later have to maintain or modify your Flash movie, it's good to include comments in your movie for documentation. Comments (which are not included in the published swf) can be added as separate lines, or appended to the end of a line. Comments can be included between /* and */ markers:

or following // on an individual line:

or following // at the end of an existing line:

In addition to documenting, another good way to tell what your movie is doing is to include trace statements in it. This allows you to examine (via the Output panel) the content of any variable while the movie is running. The format of the trace statement is simple:

You can include a single string, several strings concatenated with "+"s or concatenations of strings and variables as the parameter for trace. When the Flash compiler encounters a variable in the trace parameter that is not a string, it includes the command to run the class's toString function on that variable to convert it to a string before concatenating it with other strings in the parameter. When the movie is run, the parameter passed to the trace function is displayed in the Output panel. Here are some examples of trace statements. Paste this code in a new blank Flash movie and see if you get the same output shown here:
var i:Number = 5;
var street:String = "Maple Lane";
var names:Array = ["april", "may", "june"];
trace(i); // 5
trace('the value of i is ' + i); // the value of i is 5
trace(i + ' ' + street); // 5 Maple Lane
trace(names); // april,may,june (array elements separated by commas)
Discussed on this page:
single-line, multiline comments, use trace to debug