I have a preloader that preloads a separate/external SWF...
Original FLA's can downloaded here:
The Preloader = introloader.fla
The Movie = intro.fla
The problem is, the preloader (introloader.swf) seems to be preloading all the elements of the movie (intro.swf) except for the emedded video clip that was imported from a Quicktime Movie (mov) file, and then playing the movie before the embedded clip has finished loading. Click here to see an example.
Does anyone know how I can make the preloader preload the entire intro.swf movie (including the embedded .mov file), before it starts playing?
Most preloaders I've used are created using the first 5 or 10 frames of the main movie, not as a seperate loader, so that may be a problem.
You are correct, it is starting to download the main movie immediately. Seems like the offending line is
Code:
container.loadMovie("intro.swf");
from your preloader, it's loading the movie before the preloader works through all the percentages. To test that theory, comment out all the rest of the code. Main movie loads and plays.
So it's loading and playing the main movie while the preloader is working away telling you how much has been downloaded.
If you put your "container" in frame 10, preloader in the first 10 frames, then "this" will be the entire clip (preloader and movie). Then just measure the percent downloaded of "this". At 100%, go to frame 10 and play the movie. something like this:
Code:
this.onEnterFrame = function():Void {
var loadedData:Number = this.getBytesLoaded();
var allData:Number = this.getBytesTotal();
var percent:Number = Math.round(loadedData/allData*100);
if (loadedData>=allData) {
gotoAndPlay(10);
delete this.onEnterFrame;
}
};
adapt for your loader bar, but maybe you get the idea.
Oh yeah, don't forget to put a "stop();" in the last frame before the "container".
Best wishes,
Eye for Video www.cidigitalmedia.com
Last edited by Eye for Video; 01-22-2009 at 10:35 AM.
Bookmarks