开发者

AS3 Compiler error 1083: problem with else syntax

Can anyone help me with finding the error here. Its开发者_如何学Python for my loading bar at the begging of my flash movie.

if (_root.getBytesLoaded() == _root.getBytesTotal()); 
{
    gotoAndPlay(4)
}

else
{
    gotoAndPlay(1)
}


 if (_root.getBytesLoaded() == _root.getBytesTotal()); { gotoAndPlay(4) }

should be

if (_root.getBytesLoaded() == _root.getBytesTotal()) { gotoAndPlay(4) }

You are terminating your if statement with that ;


The semicolon on the first row is ending your statement prematurely, you need to drop it:

if (_root.getBytesLoaded() == _root.getBytesTotal())
{
    gotoAndPlay(4);
}
else
{
    gotoAndPlay(1);
}

Also, it's good practice to always end your lines with a semicolon, it shouldn't matter here, but always do it just to be safe.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜