Hello, apologies if this seems like a redundant question… i’ve been reading through all the turorials and forum threads i can find, and am just confused at to what exactly i need to do next… my first time trying to use preloaders but am finding i need them in order to make my project run smoothly…
my situation: want to preload 5 swf files into my main movie, and have them at the ready to play when i want them to (either by an onEnterFrame or onPress).
i started working with some preload array script from Scotty i found on one of the threads, but elsewhere i’ve seen info about putting extra frames into the uploading swfs and am unsure what i need to do with this or how it would fit in with the below code. right now, when i try to play one of the uploaded swf files nothing is happening, and i’m guess my code is wrong there too, but don’t know what to put…
…pretty new at all this and feeling rather clueless… help???
here’s what i’ve got thus far, on first frame of main movie, just don’t know where to go from here…
stop();
movieArray = new Array("ams1voice.swf", "apmmvie.swf", "ccmvie.swf", "clientsatprinciple.swf", "cycle.swf". "govmvie.swf");
var j = 0;
var loadTot = 0;
function preload() {
var mvieH = this.createEmptyMovieClip("container"+j, 999+j);
mvieH.loadMovie(movieArray[j]);
var temp = this.createEmptyMovieClip("tmp"+j, j);
temp.onEnterFrame = function() {
var t = mvieH.getBytesTotal();
var l = mvieH.getBytesLoaded();
var loaded = Math.round((l/t)*100)/movieArray.length;
bar._xscale = loadTot+loaded;
info.text = "loading movie...";
//or
//info.text = loadTot+loaded+" percent loaded"
if (t == l && t>5) {
//mvieH._visible=0;
loadTot += loaded;
j++;
nextMovie();
delete this.onEnterFrame;
}
};
}
function nextMovie() {
j<movieArray.length ? preload() : (info.text="", bar._visible=0);
}
preload();
apmholder.preloadSwf("apmmvie.swf");
amsholder.preloadSwf("ams2.swf");
//etc etc
thanks for any help!!