/*..*/ 注释块分隔符运算符

/* comment */
/* comment
comment */

指示一行或多行脚本注释。出现在注释开始标签 (/*) 和注释结束标签 (*/) 之间的任何字符都被 ActionScript 解释程序解释为注释并忽略。使用 //(注释分隔符)可标识单行注释。使用 /* 注释分隔符可在多个连续行上标识注释。在使用这种格式的注释分隔符时,如果缺少结束标签 (*/),就会返回一条错误消息。尝试嵌套注释也会返回一条错误消息。使用了注释开始标签 (/*) 后,不管在开始标签和结束标签之间放置了多少个注释开始标签 (/*),第一个注释结束标签 (*/) 都会结束此注释。

可用性:Flash Player 5;ActionScript 1.0

操作数

comment - 任何字符。

示例

下面的脚本在脚本的开头使用注释分隔符:

/* records the X and Y positions of 
the ball and bat movie clips */ 
var ballX:Number = ball_mc._x; 
var ballY:Number = ball_mc._y; 
var batX:Number = bat_mc._x; 
var batY:Number = bat_mc._y; 

下面的嵌套注释尝试将导致一条错误消息:

/* this is an attempt to nest comments. 
/* But the first closing tag will be paired 
with the first opening tag */ 
and this text will not be interpreted as a comment */ 

另请参见

// 注释行分隔符运算符