1

我知道这是非常基本的,但是以下函数在编译时会产生 2 个语法错误,如下所示。我想不通他们。任何帮助深表感谢。

Game, Layer 'Actions', Frame 2, Line 5  1086: Syntax error: expecting semicolon before rightparen.

Game, Layer 'Actions', Frame 2, Line 5  1084: Syntax error: expecting rightbrace before semicolon.



function fl_TouchEndHandler_2(event:TouchEvent):void {
    // Drag & drop stuff...
    contained[i] = Gem1_MC.hitTestObject(Gem4_MC));
    contained[i] = Gem2_MC.hitTestObject(Gem4_MC));
    contained[i] = Gem3_MC.hitTestObject(Gem4_MC));
    if (contained.indexOf(false) == -1) { // This returns -1 if it can't find false
        gotoAndStop(1);
    }
}
4

1 回答 1

2

你有额外的')'

尝试:

function fl_TouchEndHandler_2(event:TouchEvent):void {
   // Drag & drop stuff...
   contained[i] = Gem1_MC.hitTestObject(Gem4_MC);
   contained[i] = Gem2_MC.hitTestObject(Gem4_MC);
   contained[i] = Gem3_MC.hitTestObject(Gem4_MC);
   if (contained.indexOf(false) == -1) { // This returns -1 if it can't find false
      gotoAndStop(1);
   }
 }
于 2012-12-20T15:23:47.737 回答