user1051467
user1051467

Reputation: 89

AS3 syntax compile errors - expecting semicolon before rightparen

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

Upvotes: 1

Views: 2056

Answers (1)

Gone3d
Gone3d

Reputation: 1189

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

Upvotes: 2

Related Questions