Preloader Headaches!

Ok…does anyone have any clue why my preloader would get stuck on 11%? Here is the actionscript:

var nowLoaded = _root._framesloaded;
var totalLoaded = _root._totalframes;
if (nowLoaded == totalLoaded) {
gotoAndPlay(“Scene 1”, 1);
}
bytesIn = _root.getBytesLoaded();
bytesAll = _root.getBytesTotal();
percent = Math.floor((bytesIn/bytesAll)*100);
_root.chart._xscale = percent;
_root.load.autoSize = true;
_root.load.text = percent+"%";

Then in the second frame:

gotoAndPlay(1);

It works fine until it gets to 11% everytime it freezes…but if I right click on the movie and hit “play” the movie is loaded and ready to go. So I know it keeps loading when its reading 11%.

I hate preloaders!!

Try this…


bytesIn = _root.getBytesLoaded();
bytesAll = _root.getBytesTotal();
percent = Math.floor((bytesIn/bytesAll)*100);
_root.chart._xscale = percent;
_root.load.autoSize = true;
_root.load.text = percent+"%";
if (bytesIn == bytesAll) {
	gotoAndPlay("Scene 1", 1);
}

Same exact problem…it works when I test it in Flash but it won’t work when it is uploaded…

I’m not sure why…here is the movie…

University of Hartford Corporate and Foundation Relations

It even happens when I use your suggested code…

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) {
	gotoAndPlay(3);
	delete bytes_loaded;
	delete bytes_total;
}

Frame 2

gotoAndPlay(1);

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.

it failed. i have no clue…i’ve tried every kind of preloader i can think of…

your preloader doesn’t display the text at all…i even tried to play around with the code…it has to be something in the movie that is holding it up…

I can’t think of what it would be…

It must be something with the movie that is holding it up.

The preloader I posted up is one I use all the time and have sent to other people on this forum and it fixed their problems.

Do you have any large music files loading through AS?

Or anything of that sort?

yeah…i have a background loop which kicks the filesize to around 200k…but since the site is going to be used primarily on the Intranet of the school…size doesn’t matter…you think that’s what it is??

I’m new to all this actionscripting…the preloader I built works on all my smaller movies…but this one it won’t…

thanks for all the help…

and by the way…i noticed you’re from philly…i am too…north of the city though…bucks…

Ah… another Philly person :beam: Well welcome to the forum.

Hmm, it isn’t the loop.

Can you post your file? Or upload it to your server and post a link to download it?

It would be easier to troubleshoot if I could see how your movie was set up.

sure…

its a little unorganized…but you’ll get the point…

hartford_cfr.fla

Thanks!

Wanna hear something funny?

All I did was change two tiny things in the preloader, and it seems to work fine for me. You had loadText as the instance name when it should have been the var name (my fault). And the other is that I stretched your text box out so the text could be displayed properly.

I tested in streaming mode… worked great. I uploaded, worked better.

Here is the link to see it…

View HERE

Here is the link to download the .fla file.

DOWNLOAD FILE

Let me know when you download them so I can remove them for space reasons.

thank you very much!

you’ve been a really good help!

anything you need with Photoshop just ask…that’s where I’m a pro…

:slight_smile:

Thanks :slight_smile:

I have been known to be pretty good with Photoshop myself, but if I ever need help with it, I will be sure to ask :beam:

■■■■…I didn’t check out your site…crazy stuff!

Thanks :slight_smile:

I have finally got lostinbeta’s preloader working but I have two questions:

  1. I have a percentage displayed but how can i show the number of kilobytes being loaded?

  2. How do I make a loading bar? lostinbeta told me to make a movieclip called loadBar with a rectangle and I did this but it doesn’t work! Can someone tell me how to make this movie clip!

Thanks

I figured out how to show bytes or whatever and I managed to create a loading bar however, when I use the preloader on a “preloader scene” and make it go to the “main scene” i have an external movie that should load and also dynamic text which should load but they don’t! why??

That isn’t a problem with the preloader.

You should have your loaded movie and text code in keyframes AFTER the preloader.

I have one scene called preloader and it has

gotoAndPlay(“Main”, 1);

in scene Main on frame 1 I have actionscript on the first layer and on other layers i have layout etc all in frame 1!

so what is wrong?

Can you post a .fla file?

I know it isn’t the preloader… because I preloader can’t effect something like when it is in a difference scene or on different frames.

Do you have a stop() action at the end of your Scene “Main”???

hi all,
this is a familiar fault all users do it, give the dynamic text instance name and wondering why it doesn’t work (me too) but we can solve it buy put .text after the instance name it’ll be a var name… :slight_smile:

i hope it helps others …

FashSwimmer C:-)