帮助! Actionscript 中需要分号的令人困惑的语法错误 1084?
我以前也遇到过这些错误,但我已经在这个错误上停留了几个小时了:(
完整错误:
Main.as, Line 513 1084: Syntax error: expecting semicolon before leftbrace.
这是第 513 行:
} else (homeBool == false && embedBool == false) {
Class where Flash CS5给我编译错误:
// 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);
}
我可能缺少任何想法或语法错误吗?
如果有人需要查看更多代码,请告诉我。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我认为您在该行的“else”后面缺少一个“if”。如果不运行一些类似的代码,我不能百分百确定,但通常如果您单独使用“else”,则不会像您所做的那样包含任何参数。因此,如果您想要其他检查,请使用“else if”。
希望有帮助。
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.
最后的 else 应该是 else if,或者删除检查
that final else, should either be an else if, or remove the check
您在
else
之后缺少if
语句:You are missing an
if
statement after yourelse
: