Flash CS4 Professional ActionScript 2.0

Single-line comments

You use single-line comments to add a comment to a single line in your code. You might comment out a single line of code, or add a short description of what a piece of code accomplishes. To indicate that a line or portion of a line is a comment, precede the comment with two forward slashes (//), as shown in the following code:

// The following sets a local variable for age.
var myAge:Number = 26;

Single-line comments are typically used to explain a small code snippet. You can use single-line comments for any short comments that fit on a single line. The following example includes a single-line comment:

while (condition) {
    // handle condition with statements