开发者

AS3 Compiler error 1083: problem with else syntax

开发者 https://www.devze.com 2023-03-26 11:34 出处:网络
Can anyone help me with finding the error here. Its开发者_如何学Python for my loading bar at the begging of my flash movie.

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

精彩评论

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