【发布时间】:2011-08-01 19:42:09
【问题描述】:
我编写了一个单例类来跟踪我的应用程序中的一些变量。
我遇到了一个我无法弄清楚的语法错误,我确信我遗漏了一些简单的东西,但那是那些日子之一。有人发现我的代码有问题吗?
错误为 1084:语法错误:在 resultNumber 之前需要右括号。
public static function setResult(int resultNumber, int value): void
{
switch(resultNumber)
{
case 2: { this.result2 = value; break; }
case 3: { this.result3 = value; break; }
case 4: { this.result4 = value; break; }
case 5: { this.result5 = value; break; }
case 6: { this.result6 = value; break; }
case 7: { this.result7 = value; break; }
case 8: { this.result8 = value; break; }
case 9: { this.result9 = value; break; }
case 10: { this.result10 = value; break; }
case 11: { this.result11 = value; break; }
case 12: { this.result12 = value; break; }
case 13: { this.result13 = value; break; }
case 14: { this.result14 = value; break; }
}
}
【问题讨论】:
标签: flash apache-flex actionscript-3