Please! Please! Help with simple F5 AS!

OK, I’m making a preloader for my movie. With me so far? Good. Ok. When I preview the movie, this pops up…

Scene=Scene 1, Layer=actions, Frame=1: Line 7: ‘;’ expected

 _root.loadText3 = "("+bytes_remaining+")

"+Math.round(bytes_total-bytes_loaded)*100);

I’m having trouble understanding where they want an additional “;” – there is one at the end of the line so what is the problem?

Got your PM :slight_smile:

First off, it’s ((loaded/total)*100 ), not ((total/loaded)*100 )…

And I really can’t see where the error is… :-\

odd…

post the fla, maybe that’ll help…

wait, try replacing your line with this one:

_root.loadText3 = “(” + bytes_remaining + ")
" + int((bytes_loaded-bytes_total)*100 );

ok, here’s the FLA, but just scene1, not scene2 (that would be the rest of the website, 588k).

btw, it is supposed to be 24 fps. and i added your script to my version, and loadText1 and loadText2 work, but not loadText3, or either of the graphics…lemmy go look…For anybody who happens to stumble here, here is the AS:

bytes_loaded = Math.round(_root.getBytesLoaded()/1000);
bytes_total = Math.round(_root.getBytesTotal()/1000);
_root.loadBar._width = bytes_loaded/bytes_total125;
_root.loadLine._width = bytes_total
125;
_root.loadText1 = “(”+bytes_total+")
"+Math.round(bytes_total100);
_root.loadText2 = “(”+bytes_loaded+")
"+Math.round(bytes_loaded
100);
_root.loadText3 = “(” + bytes_remaining + ")
" + int((bytes_loaded-bytes_total)*100 );
if (bytes_loaded == bytes_total) {
gotoAndStop(“Scene 2”, 1);
delete bytes_loaded;
delete bytes_total;
}

try it now…

hymmmm… I changed my code to this:

bytes_loaded = Math.round(_root.getBytesLoaded());
bytes_total = Math.round(_root.getBytesTotal());
_root.loadBar._width = bytes_loaded/bytes_total;
_root.loadLine._width = bytes_total;
_root.loadText1 = “(” + bytes_total + ")
" + int(bytes_total100 );
_root.loadText2 = “(” + bytes_loaded + ")
" + int(bytes_loaded
100 );
_root.loadText3 = “(” + bytes_remaining + ")
" + int((bytes_loaded-bytes_total)*100 );
if (bytes_loaded == bytes_total) {
gotoAndStop(“Scene 2”, 1);
delete bytes_loaded;
delete bytes_total;
}

lemmy go try yours now…

Using the following script, I can’t seem to get the loadBar, loadLine, or loadText3 to work…

bytes_loaded = int(_root.getBytesLoaded());
bytes_total = int(_root.getBytesTotal());
_root.loadBar._width = (bytes_loaded/bytes_total);
_root.loadLine._width = bytes_total;
_root.loadText1 = “(” + bytes_total + ")
" + int(bytes_total100);
_root.loadText2 = “(” + bytes_loaded + ")
" + int(bytes_loaded
100);
_root.loadText3 = “(” + bytes_remaining + ")
" + int((bytes_loaded-bytes_total)*100);
if (bytes_loaded == bytes_total) {
nextScene();
delete bytes_loaded;
delete bytes_total;
}

Could you check to see if I have set up loadBar and loadLine correctly? Do they have to be Graphics or Movie Clips or what?

-=-=Sorry, this is my first time using action script.

Do you have the instance name set on your loadBar and loadLine set right?

Also, do you have the var name set on your third textbox set right?

If they don’t match up exactly with what is in the AS, it won’t work.

oddly enough, the fla I posted back to you, worked fine on my com…:-\