I’m always conscious of the dial up user and because of this I use preloaders quite frequently. The only way that I have been able to manage preloading pictures is to make a swf with each image and a preloader within that swf. The main movie then calls in the swf. Because the amount of jpegs keeps getting larger and larger I would like to be able to just throw a bunch of jpegs in a folder and have a preloader within the main movie detect the amount of data being loaded. Is this even possible? Thanks in advance…
yes, flash has the wonderful functions, getBytesTotal() and getBytesLoaded(). use these functions on your movieclips and you should see how a preloader is made
I currently use these functions on the preloaders of each swf that loads in. I fail to realize the code that I code use with my load movie command in my main movie. Do you have example code I could see?
You can use these functions on a movieclip containing the jpeg as well. Just think of them as separate swfs
stop();
myInterval = setInterval(preloader,10);
function preloader() {
if (getBytesLoaded() >= getBytesTotal()) {
play();
clearInterval(myInterval);
}
loadBar._xscale = getBytesLoaded() / getBytesTotal() * 100;
}
but1.onRelease = function() {
loadMovie(“picts/1.jpg”, emptyClip);
};
but2.onRelease = function() {
loadMovie(“picts/2.jpg”, emptyClip);
};
but3.onRelease = function() {
loadMovie(“picts/3.jpg”, emptyClip);
};
but4.onRelease = function() {
loadMovie(“picts/4.jpg”, emptyClip);
};
but5.onRelease = function() {
loadMovie(“picts/5.jpg”, emptyClip);
};
but6.onRelease = function() {
loadMovie(“picts/6.jpg”, emptyClip);
};
but7.onRelease = function() {
loadMovie(“picts/7.jpg”, emptyClip);
};
but8.onRelease = function() {
loadMovie(“picts/8.jpg”, emptyClip);
};
Here is the code that I’m trying to use on the first frame of the main movie. How do I target the jpegs that are loading and then have the load bar move accordingly?