Trailing comments

You use trailing comments to add a comment on the same line as your code. These comments appear on the same line as your ActionScript code. Developers commonly use trailing comments to indicate what a variable contains or to describe or note the value that returns from a line of ActionScript. Format trailing comments as follows:

var myAge:Number = 26; // variable for my age
trace(myAge); // 26

Space the comments to the right so readers can distinguish them from the code. Try to have the comments line up with each other, if possible, as shown in the following code.

var myAge:Number = 28;            // my age
var myCountry:String = "Canada"; // my country
var myCoffee:String = "Hortons"; // my coffee preference

If you use autoformatting (click the Auto Format button in the Actions panel), trailing comments move to the next line. Add these comments after you format your code, or you must modify their placement after using the Auto Format button.


Flash CS3


 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/flash/9.0/main/00000693.html