Scott
Scott

Reputation: 1

AS3 Compiler error 1083: problem with else syntax

Can anyone help me with finding the error here. Its for my loading bar at the begging of my flash movie.

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

else
{
    gotoAndPlay(1)
}

Upvotes: 0

Views: 306

Answers (2)

grapefrukt
grapefrukt

Reputation: 27045

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.

Upvotes: 0

Joe
Joe

Reputation: 82594

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

should be

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

You are terminating your if statement with that ;

Upvotes: 3

Related Questions