Dzwebs.Net

撰写电脑技术杂文十余年

Flash两种注释方法/*..*/ 和// 注释行分隔符运算符

Admin | 2011-12-27 8:10:42 | 被阅次数 | 5872

温馨提示!

如果未能解决您的问题,请点击搜索;登陆可复制文章,点击登陆

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

  /* 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 */

  二、// 注释行分隔符运算符

  // comment

  指示脚本注释的开始。出现在注释分隔符 (//) 和行结束字符之间的任何字符都被 ActionScript 解释程序解释为注释并忽略。

  可用性:Flash Player 1.0;ActionScript 1.0

  操作数 comment - 任何字符。

  示例

  下面的脚本使用注释分隔符将第一、第三、第五和第七行标识为注释:

  // record the X position of the ball movie clip
  var ballX:Number = ball_mc._x;
  // record the Y position of the ball movie clip
  var ballY:Number = ball_mc._y;
  // record the X position of the bat movie clip
  var batX:Number = bat_mc._x;
  // record the Y position of the ball movie clip
  var batY:Number = bat_mc._y;


该杂文来自: 动画制作杂文

上一篇:Flash的-Infinity 常数、.点运算符、/ 除法运算符

下一篇:Flash的/=除法赋值运算符、=赋值运算符、== 等于

网站备案号:

网站备案号:滇ICP备11001339号-7

版权属性:

Copyright 2007-2021-forever Inc. all Rights Reserved.

联系方式:

Email:dzwebs@126.com QQ:83539231 访问统计