Comments

I l @ ve RuBoard

Some of the most important lines of code in your programs don't do anything at all. They are comments, which Flash just ignores.

Comments, however, help you organize your code and remind you what a particular piece of code does. Here is a simple example:

 // add 2 to the number num += 2; 

The previous example shows a line that is completely a comment. It begins with two forward slashes . The rest of the line is whatever you want it to be.

You can also place a comment at the end of a line. Here is an example:

 num += 2; // add 2 to the number 

Whenever you use the double slashes, the rest of the line is ignored by Flash.

graphics/book.gif

If you have ever studied computer programming in college, you probably already know how important comments are. Most teachers will severely penalize a programming assignment if it is turned it with inadequate comments.


There are many different ways to use comments in your code. Programmers usually place one or more lines of comments before each function that explain what the function does. You can also place comments before individual lines if you feel they need more explanation.

I l @ ve RuBoard


Sams Teach Yourself Flash MX ActionScript in 24 Hours
Sams Teach Yourself Flash MX ActionScript in 24 Hours
ISBN: 0672323850
EAN: 2147483647
Year: 2002
Pages: 272

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net