Aliteration asides, I am having a problem with my preloader.
The setup:
base SWF in which external SWF’s are being loaded in a MC called ‘content’ ( loadMovie (“content1.swf”, “content”); ) and there is a Cover-over animation called Cover.
preload code in frame 1 of the external SWF:
//checks to see if the external movie (this) is fully loaded
if (this.getBytesLoaded()<this.getBytesTotal()) {
Total = this.getBytesTotal()/1000;
Received = this.getBytesLoaded()/1000;
Percentage = (Received/Total)*100;
//tell the progress bar animation (located in the cover mc)
//to go to a frame between 0 and 100
_root.cover.loadBar.gotoAndStop(int(Percentage));
} else {
//when its fully loaded
gotoAndPlay(3);
//tell the cover mc to play its opening animation
_root.cover.gotoAndPlay(“open”);
}
on frame 2 of the external SWF there is the code: gotoAndPlay(1); (obviously)
when SWF is being loaded, there is a cover-over effect ( COVER ), which stops when it is closed at the loading bar (instance name loadBar), the loadingbar moves to frame 100 (that is, till the final bytes of the external SWF) and when finished it plays the ‘open’ animation and the newly loaded SWF appears.
And that works…, the bar appears, the SWF loads, the cover animation works… hooray!.. or is it…?
The problem
Well, I just noticed the following… checking the site online (on a v90 slow modem), I found out that each time that I loadMovie an external SWF… first the loading bar moves smoothly to the end of the bartrack, then it repeats that (while the SWF should have been finished loading, or the bar should not have arrived yet till the end)…
And then even for the third time the loading bar starts from scratch, this time more shaky (i guess the way it logically should look) and after this third time it finally completes loading the external SWF and the Cover Open animation is being played…
**So the loadingbar shows it’s animation 3 times before the SWF is loaded! **
So something goes terribly wrong… 2 times to be precise… but what is it???
some more investigating showed that when something loads fast it is that the loading bar doesn’t seem to reach the end before the Open Cover sequence kicks in…
so it seems that the amount to be loaded and the progress of the loadingbar are completely unrelated… thus the preloader now functions for show, not actually displaying the amount to be preloaded…
no not the external SWF
it should be in the loader.
If you go to the preloader tutorial on this site, they have a completed version and its on the completed version but not in the tutorial.
then you put in the command to load the external SWF