
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
396
|
Chapter 15: Lexical Structure
ActionScript also supports multiline comments, used to accommodate larger blocks
of code commentary, that are not terminated by line breaks. Multiline comments
start with the two-character sequence
/* and continue until the terminating two-
character sequence *
/ is encountered, as in:
/* -----BEGIN VERSION CONTROL INFO----
Name: MyApplication, Version 1.3.1
Author: Killa Programma
Last Modified: August 07, 2002
------END VERSION CONTROL INFO-----
*/
Multiline comments are available only in Expert Mode in the Actions panel or in
external .as source files included via the #include directive. Multiline comments are
converted to single-line comments when you switch from Expert Mode to Normal
Mode. In Flash MX, switching back to Expert Mode restores multiline comments.
Note that nested comments are legal:
/* This is an example of
/* a nested // comment */
/* This another
/* example of nested comment */
The comment doesn't end until the second terminator is encountered here */
The following is avoided by convention, but it is valid:
/* This comment is followed by real code */ var x = 5;
When making major (or even minor) revisions to some code, it is common practice
to include your initials and the date of the change in a comment, such as this:
// Fixed error in ...