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 Player
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.