morse
November 11, 2002, 11:30pm
1
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?
system
November 12, 2002, 12:39am
2
Got your PM
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…
system
November 12, 2002, 12:45am
3
wait, try replacing your line with this one:
_root.loadText3 = “(” + bytes_remaining + ")
" + int((bytes_loaded-bytes_total)*100 );
system
November 12, 2002, 12:50am
4
ok, here’s the FLA, but just scene1, not scene2 (that would be the rest of the website, 588k).
system
November 12, 2002, 12:55am
5
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;
}
system
November 12, 2002, 1:04am
7
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…
system
November 12, 2002, 1:12am
8
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.
system
November 12, 2002, 3:48am
9
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.
system
November 12, 2002, 6:11am
10
oddly enough, the fla I posted back to you, worked fine on my com…:-\