开发者

Help! Baffling Syntax error 1084 in Actionscript expecting semicolon?

I've had these errors before, but I've been stuck on this one for hours :(


Full error:

Main.as, Line 513 1084: Syntax error: expecting semicolon before leftbrace.

This is Line 513:

} else (homeBool == false && embedBool == false) {

Class where Flash CS5 gives me the compile error:

// PlayerControls.as
private function drawControls():void
{
    // Home Page Player NOT autoplaying
    // Home Page Player Autoplaying
    // Non-Home Page Howdini P开发者_StackOverflow中文版layer

    if (homeBool == true && embedBool == true) {
        drawVideo();
        drawSplash();
    } else if (homeBool == true && embedBool == false) {
        drawVideo();

        // v Error highlights this line:
        } else (homeBool == false && embedBool == false) {
            drawVideo();
        }

    pc = new PlayerControls();
    pc.drawControls(playerW, playerH, embedBool);           
    pc.y = controlsY;
    pc.addEventListener("onPlay", vd.playVideo);
    pc.addEventListener("onPause", vd.pauseVideo);
    pc.addEventListener("embedSplash", hideSplash);
    stage.addChild(pc);
}

Any ideas or syntax errors I'm probably missing?

Please let me know if anyone needs to see more code.


I think you're missing an 'if' after the 'else' on that line. I'm not 100% sure without running some similar code, but usually if you use 'else' on its own, you don't include any parameters like you have done. So if you want those other checks, use 'else if'.

Hope it helps.


that final else, should either be an else if, or remove the check


You are missing an if statement after your else :

else if (homeBool == false && embedBool == false) {
            drawVideo();
        }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜