Actionscript代码中的逻辑错误

时间:2011-05-29 19:56:53

标签: flash actionscript

我的代码中有以下逻辑

if((leftCombo.getSelectedIndex() !> rightCombo.getSelectedIndex())&&(rightCombo.getSelectedIndex() !< leftCombo.getSelectedIndex())

显然做错了。

以下是错误

Scene 1, Layer 'Layer 1', Frame 1, Line 112 1084: Syntax error: expecting rightparen before not.

Scene 1, Layer 'Layer 1', Frame 1, Line 112 1084: Syntax error: expecting identifier before logicaland.

Scene 1, Layer 'Layer 1', Frame 1, Line 112 1084: Syntax error: expecting semicolon before not.

由于

2 个答案:

答案 0 :(得分:0)

没有!>!<运营商。你对它们的期望是什么? !>应该不大于吗?如果是这种情况,请使用<=>=然后(即不大于等于低于或等于)。

另请注意,如果是这种情况,那么您可以摆脱其中一种情况,即您将检查a <= b && b >= a其中一个是完全冗余的。{/ p>

答案 1 :(得分:0)

&GT!;和!&lt;不是有效的运营商......

您的错误跟踪很容易看出:

Syntax error: expecting rightparen before not.

找到not运算符(!),在无效标记(&lt;)旁边,并且出现错误。

你想说什么?

假设!&gt;意思是“不大于”,那么你应该使用&lt; = 假设!&lt;表示“不小于”,则应使用&gt; =

相关问题