MACROMEDIA FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH Manual page 743

Learning actionscript 2.0 in flash
Table of Contents

Advertisement

For more information on writing comments in your ActionScript code, see the following
sections:
"Writing good comments" on page 743
"Adding comments to classes" on page 744
Writing good comments
Using comments consistently in your ActionScript 2.0 code allows you to describe complex
areas of code or important interactions that are not otherwise clear. Comments must clearly
explain the intent of the code and not just translate the code. If something is not readily
obvious in the code, add comments to it.
If you use the Auto Format tool with your code, you will notice that trailing comments (see
"Trailing comments" on page
you format your code, or you must modify the comment's new placement after you use the
Auto Format tool.
For information on using comments in classes, see
on page
744.
Use the following guidelines when you add comments to your code:
Use block comments (/* and */) for multiline comments and single-line comments ( // )
for short comments.
You can also use a trailing comment on the same line as the ActionScript code if necessary.
Make sure you don't use comments to translate your ActionScript code.
You don't need to comment on elements that are obvious in the ActionScript code.
Comment on elements that are not readily obvious in the code.
In particular, add comments when the subject is not described in the surrounding
paragraphs.
Do not use cluttered comments.
A line of cluttered comments often contains equal signs (=) or asterisks (*). Instead, use
white space to separate your comments from ActionScript code.
If you use the Auto Format tool to format ActionScript, you remove the white space.
Remember to add it back or use single- line comments (//) to maintain spacing; these
lines are easy to remove after you format your code.
134) move to the next line. You can add these comments after
"Adding comments to classes"
Using comments in your code
743

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash 8

Table of Contents