About language punctuators
133
Multiline comments
Use multiline comments, also called block comments, for comments that are several lines in
length. Developers commonly use multiline comments to describe files, data structures,
methods, and descriptions of files. They are usually placed at the beginning of a file and
before or within a method.
To create a comment block, place
/*
at the beginning of the commented lines and
*/
at the
end of the comment block. This technique lets you create lengthy comments without adding
// at the beginning of each line. Using // for numerous sequential lines can lead to some
problems when you modify the comments.
The format for a multiline comment is as follows.
/*
The following ActionScript initializes variables used in the main and
sub-menu systems. Variables are used to track what options are clicked.
*/
By placing large chunks of script in a comment block, called
commenting out
a portion of your
script, you can test specific parts of a script. For example, when the following script runs,
none of the code in the comment block executes:
// The following code runs.
var x:Number = 15;
var y:Number = 20;
// The following code is commented out and will not run.
/*
// create new Date object
var myDate:Date = new Date();
var currentMonth:Number = myDate.getMonth();
// convert month number to month name
var monthName:String = calcMonth(currentMonth);
var year:Number = myDate.getFullYear();
var currentDate:Number = myDate.getDate();
*/
// The code below runs.
var namePrefix:String = "My name is";
var age:Number = 20;
TI
P
If you place the comment characters (/* and */) on separate lines at the beginning and
end of the comment, you can easily comment them out by placing double slash
characters (//) in front of them (for example, ///* and //*/). These let you quickly and
easily comment and uncomment your code.
TI
P
It’s good practice to place a blank line before a block comment.
Содержание FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH
Страница 1: ...Learning ActionScript 2 0 in Flash...
Страница 8: ...8 Contents...
Страница 18: ...18 Introduction...
Страница 30: ...30 What s New in Flash 8 ActionScript...
Страница 66: ...66 Writing and Editing ActionScript 2 0...
Страница 328: ...328 Interfaces...
Страница 350: ...350 Handling Events...
Страница 590: ...590 Creating Interaction with ActionScript...
Страница 710: ...710 Understanding Security...
Страница 730: ...730 Debugging Applications...
Страница 780: ...780 Deprecated Flash 4 operators...
Страница 830: ...830 Index...