2012-12-20 98 views
1

我知道這是非常基本的,但以下函數在編譯時會生成2個語法錯誤,如下所示。我無法弄清楚它們。任何幫助深表感謝。AS3語法編譯錯誤 - 在rightparen之前期待分號

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

回答

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

@ user1051467如果這個答案解決您的問題,請選擇它通過點擊對勾接受 – Niels

相關問題