Mr. X
December 30th, 2002, 07:17 PM
ok, I have a mc called: "preloader.swf" that is the first thing people see.
I use this .swf to preload a rather large "main.swf" file into it (the reason I don't just put the preloader inside "main.swf" on the first few frames is because I got a bunch of linked library items with the "export to first frame" option selected and that makes the library load before the actual file so putting a pre-loader there is pointless).
the "main.swf" consists of 2 frames:
Frame 1:
nothing, just a stop(); on the action layer.
Frame 2:
that's where everything is. It's mostly all AS designed website.
The "preloader.swf" is 4 frame long and that's what I got (I tried sticking as close as possible from the lib tutorial on this site).
Frame 1:
loadMovieNum("main.swf", 1);
Frame 2:
bytes_loaded = Math.round(_level1.getBytesLoaded());
bytes_total = Math.round(_level1.getBytesTotal());
getPercent = bytes_loaded/bytes_total;
_root.loadBar_mc._width = getPercent*100;
_root.loadText = Math.round(getPercent*100)+"%";
if (bytes_loaded == bytes_total) {
_root.gotoAndStop(4);
_level1.gotoAndStop(2);
}
frame 3:
_root.gotoAndPlay(2);
frame 4:
stop();
If I just put the 1st frame load action, the movie loads fine. And the preloader works fine with a mc from within like in the tutorial. If I do a trace() on getBytesTotal I get 0 (zero). And the gotoAndStop(2) doesn't work either (even without the "if" statement). So I'm thinking the problem is probably the way I reference the "main.swf" with _level1.etc...
What's the correct syntax then?
It looks right from everything I read everywhere, but I guess I missed something...
I'm puzzled and getting very frustrated over this one... HELP!!!!
I use this .swf to preload a rather large "main.swf" file into it (the reason I don't just put the preloader inside "main.swf" on the first few frames is because I got a bunch of linked library items with the "export to first frame" option selected and that makes the library load before the actual file so putting a pre-loader there is pointless).
the "main.swf" consists of 2 frames:
Frame 1:
nothing, just a stop(); on the action layer.
Frame 2:
that's where everything is. It's mostly all AS designed website.
The "preloader.swf" is 4 frame long and that's what I got (I tried sticking as close as possible from the lib tutorial on this site).
Frame 1:
loadMovieNum("main.swf", 1);
Frame 2:
bytes_loaded = Math.round(_level1.getBytesLoaded());
bytes_total = Math.round(_level1.getBytesTotal());
getPercent = bytes_loaded/bytes_total;
_root.loadBar_mc._width = getPercent*100;
_root.loadText = Math.round(getPercent*100)+"%";
if (bytes_loaded == bytes_total) {
_root.gotoAndStop(4);
_level1.gotoAndStop(2);
}
frame 3:
_root.gotoAndPlay(2);
frame 4:
stop();
If I just put the 1st frame load action, the movie loads fine. And the preloader works fine with a mc from within like in the tutorial. If I do a trace() on getBytesTotal I get 0 (zero). And the gotoAndStop(2) doesn't work either (even without the "if" statement). So I'm thinking the problem is probably the way I reference the "main.swf" with _level1.etc...
What's the correct syntax then?
It looks right from everything I read everywhere, but I guess I missed something...
I'm puzzled and getting very frustrated over this one... HELP!!!!