Same preloader for multiple .swf's

Ok, heres the code I’m trying to use
[AS]function checkLoad(target){
var lBytes = target.getBytesLoaded();
var tBytes = target.getBytesTotal();
var percentLoaded = Math.floor((lBytes/tBytes)*100);
loadbar._xscale = percentLoaded;

percentText = Math.floor(percentLoaded) + "% of " + Math.floor(tBytes/1024) + "KB loaded";

if(lBytes >= tBytes && tBytes > 0){
	if(count>=12){
		clearInterval(checkProgress);
		loadbar._xscale = 0;
		percentText = "finished, yo"
	}
	else{
		count++;
	}
}
updateAfterEvent();

}[/AS]

and for the on(press) I just call checkLoad() and pass the name of the .swf I’m loading. It seems to work for the first movie that I load, but not for any I load after that.

Here are my files:
http://web.ics.purdue.edu/~rstremke//multi_load2.zip

Theres a static preloader for all the movies; is that a pain, or should I just make a preloader in the beginning of each clip I load into the main movie?

Any help would be appreciated.

put one on each swf is simpler

The other thing I thought of though, won’t the movieClip load before it plays? So the preloader wouldn’t even be seen. Anyways, I still can’t get this one to work, so any help is still welcome.

Anyone have anything to add to either post?

I didn’t open your files, but are you loading all the other swf’s into a movieClip with a unique name and changing ‘target’ to the name of the movieClip that it’s loading into? I put my code in two or three frames for preloaders like here:

But the easiest way:

or should I just make a preloader in the beginning of each clip I load into the main movie?

…Yes…RelandR agrees…:stuck_out_tongue:

my first post was sorta off the cuff (when in doubt - go the easy route)

I just d’lded your files and played it thru (swf) - but didn’t look yet at the fla.
… it acted kinda buggy at first but a second time around was smooth (?)
(if your using onPress that sometimes doesn’t behave as well as onRelease)

I think It probably just doesn’t have enough bytes in each one to need a preloader, therefore, unless you put in a fake one of those… your not going to see anything of the loading process until there is more content to load …

maybe lose the " finished yo" thingy or make it go away after a couple seconds (?)
so it doesn’t seem to be some stalled statement - just hangin there

Yeah, the “finished” thing is just so it changes to something at the end, so I can tell if it works at all. The movies are all pretty small, but on a 56K, it still takes 2-3 seconds with nothing happening, I want to avoid that.