View Full Version : Please! Please! Help with simple F5 AS!
morse
November 11th, 2002, 06:30 PM
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+")\n"+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?
eilsoe
November 11th, 2002, 07:39 PM
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...
eilsoe
November 11th, 2002, 07:45 PM
wait, try replacing your line with this one:
_root.loadText3 = "(" + bytes_remaining + ")\n" + int((bytes_loaded-bytes_total)*100 );
morse
November 11th, 2002, 07:50 PM
ok, here's the FLA, but just scene1, not scene2 (that would be the rest of the website, 588k).
morse
November 11th, 2002, 07:55 PM
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_total*125;
_root.loadLine._width = bytes_total*125;
_root.loadText1 = "("+bytes_total+")\n"+Math.round(bytes_total*100);
_root.loadText2 = "("+bytes_loaded+")\n"+Math.round(bytes_loaded*100);
_root.loadText3 = "(" + bytes_remaining + ")\n" + int((bytes_loaded-bytes_total)*100 );
if (bytes_loaded == bytes_total) {
gotoAndStop("Scene 2", 1);
delete bytes_loaded;
delete bytes_total;
}
eilsoe
November 11th, 2002, 08:01 PM
try it now...
morse
November 11th, 2002, 08:04 PM
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 + ")\n" + int(bytes_total*100 );
_root.loadText2 = "(" + bytes_loaded + ")\n" + int(bytes_loaded*100 );
_root.loadText3 = "(" + bytes_remaining + ")\n" + 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...
morse
November 11th, 2002, 08:12 PM
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 + ")\n" + int(bytes_total*100);
_root.loadText2 = "(" + bytes_loaded + ")\n" + int(bytes_loaded*100);
_root.loadText3 = "(" + bytes_remaining + ")\n" + 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.
lostinbeta
November 11th, 2002, 10:48 PM
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.
eilsoe
November 12th, 2002, 01:11 AM
oddly enough, the fla I posted back to you, worked fine on my com...:-\
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.