【问题标题】:I'm having an issue w/ Action Script 2.0 for The Matrix cascading code我遇到了矩阵级联代码的/ Actionscript 2.0 问题
【发布时间】:2018-04-08 12:43:41
【问题描述】:

我在 Flash 中找到了有关“矩阵”级联代码的精彩教程,但代码有错误。完整的教程和代码在Flash Matrix - Animated Code Effect ...

这是代码中存在问题的部分(第 75 - 88 行):

**

if(this.ind < this.myCodes.length and this.delay != 0){
this.ind++;
this.delay--;
} else {
this.ind = 0;
this.delay = this.myCodes.length;
}

**

当我测试它时,我得到了错误:

场景 1,第 1 层,第 1 帧,第 75 行,第 35 列 1084:语法错误:在 and 之前需要右括号。

当我在 and 之前放置 rightparen 时,出现错误:

符号“one_pod”,层“操作”,第 1 帧,第 80 行,第 3 列 1083:语法错误:否则为意外。

...并且还没有找到解决其他问题的方法...我不是一个好的动作脚本编写者,所以在这里碰壁...有什么想法吗?

谢谢!

(我给作者发了邮件重新/这个,但他没有回复......)

【问题讨论】:

  • “我不是一个好的 actionscripter” 所以从 AS3 语言开始,而不是几乎过时的 AS2。
  • 你完全正确,但是这个 tute 的效果最好……否则,是的,我只在 AS3 中工作……

标签: flash actionscript


【解决方案1】:

尝试在代码中使用 AND 运算符 (&amp;&amp;) 代替单词 and

if( (this.ind < this.myCodes.length) && (this.delay != 0) )
{
    this.ind++;
    this.delay--;
} 
else 
{
    this.ind = 0;
    this.delay = this.myCodes.length;
}

【讨论】:

  • 谢谢,我做到了,得到了这个错误:符号 'one_pod',图层 'Actions',第 1 帧,第 75 行,第 55 列 1084:语法错误:在左括号之前需要右括号。但我很欣赏这个建议:)
  • 糟糕,我的意思是这个错误:符号 'one_pod',层 'Actions',第 1 帧,第 75 行,第 36 列 1084:语法错误:在逻辑与之前需要标识符。符号 'one_pod',层 'Actions',第 1 帧,第 75 行,第 57 列 1084:语法错误:在 leftbrace 之前需要 rightparen。
  • 看了tut代码后... (1)this.myCodes.length和那个this.delay突然从哪里来的?以前它总是codeLines.myCodes.lengthcodeLine.indcodeLine.delay 等...也许使用那些?... (2) 使用trace 检查变量值,所以在If 语句之前,只需trace( "this.ind is: " + this.ind);还有trace( "this.myCodes.length is: " + this.myCodes.length); 你得到数字(不是“空”或“未定义”)? (3) 如果有疑问只是show all code used,因为问题可能来自上一行...
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-09-13
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多