I've just about broken MY HEAD!

OK well . . . . i’ve preloaded the clip but now it starts at 21% . …
I even traced it and it doesn’t start outputing anything till 21.
? Anything wrong w/ this code ?

onClipEvent(load) {
	_root.displayText = "0";

onClipEvent (enterFrame) {
	bytesLoaded = _parent.getBytesLoaded()
	bytesTotal = _parent.getBytesTotal()
	percentloaded = Math.round(100*bytesLoaded/bytesTotal);
	_root.displayText = "Loading: "+percentloaded+"%";
	if (bytesLoaded == bytesTotal) {

yeah…it would depend on which way you’re preloading…if you are using getBytes then it should work…but with framesLoaded it would depend…i couldn’t open the file…what are u using to preload?

yeah its using getBytesLoaded() and its from some tutorial around here… you couldn’t open the file? its in flash mx thats weird.

I see you are using the preloader component (yuk).

Anywho, How do you know it isn’t working? What did you use to test it?

If the file is being read off of your computer it, is fully loaded to start with, so it skips the preload.

You will have to upload it to a server and test it out there. I usually add a medium sized .mp3 to boost the file size and test. Loops don’t add enough to the loading time, so I use short songs. In my opinion is is a great method to test how good your preloader is.

anyone ? :slight_smile:

There seem to be a lot of problems with the preloader component starting late. That is why I said Yuk earlier.

I don’t know how to fix it. I just don’t use it, avoids the problem quite easily :beam:

that code above isn’t using the preloader component :expressionless:

i’m pissed, everyone seems to have problems w/ preloaders i’ve tried about 5 different ways and none work… my main movie works just fine w/ the component preloader but these seperate galleries refuse to be preloaded. :frowning:

If this helps, I make all my preloaders with this code, and they never fail…

Frame 1…

bytes_loaded = Math.round(_root.getBytesLoaded()/1000);
bytes_total = Math.round(_root.getBytesTotal()/1000);
_root.loadBar._width = bytes_loaded/bytes_total*100;
_root.loadText = Math.round((bytes_loaded/bytes_total)*100)+"%";
if (bytes_loaded == bytes_total) {
	delete bytes_loaded;
	delete bytes_total;

Frame 2


This assumes the load bar you have has the instance name of loadBar and the textbox with the % loaded info has the var name loadText.

The 100 at the end of the _root.loadBar line defines the finishing width you want your load bar to be.

haha wow lostinbeta :slight_smile:
thanks a million, its working :nerd:

I am glad I could help.

I am going to put that in a tutorial for Kirupa to add yet another preloader tutorial to this site (he has like 3 already). So you just got an early glimpse :stuck_out_tongue: