1

I know this is extremely basic but the following function is generating 2 syntax errors on compile, these are shown below. I can't figure them out. Any help is much appreciated.

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);
    }
}

1 Answers1

2

You have extra ')'

try:

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);
   }
 }
Gone3d
  • 1,189
  • 1
  • 8
  • 20