Hi ya all, my first night here, I’m trying to place three individual pre-loaders on my home page (url: http://ispice.us). I want the page divvied into three sections; three different movie clips; three different pre-loaders. The page is 760x480 pixels, I want the bottom MC (760x74 pxl area) to load first, so visitors can check out the info in it while the Main MC loads. i want the top Navigation (760x48) to load second; and, the Main MC; which has the most frames; to load last. If you visit the site you will not see any preloader at all, simply because I’ve only been able to get one placed correctly, and working, I have not bothered re-publishing the page because I want THREE pre-loaders on the page.
The code I’ve used to place my one pre-loader is this:
onClipEvent (enterFrame) {
loading = _parent.getBytesLoaded();
total = _parent.getBytesTotal();
percent -= (percent-((loading/total)100)).25;
per = int(percent);
percentage = per+"%";
loadBar._width = per;
if (percent>99) {
_parent.gotoAndStop(2);
}
}
It works fine but, as I said, I want three on the page, one for each of the three sections. I’ve tried and tried, but, have not been successful at figuring out how to get three individual pre-loaders to work; when the page is loaded.
I started this early this afternoon; thought it would be a quick add on to my project but; as often is; it’s taking much longer than I anticipated. My eyes have begun to hurt, again, from the strain. Please, oh please, assist me if you can! I hope you wise ones can solve this and show how good you really are!
PS. Kirupa is the best. I’ve learned so much from the site.
K this question is semi related… i just didnt want to create another thread and crown the forums…
anywayz ny question is:
How do i create muliple preloaders that occur at different parts of my movie…
reasoning:
I’m creating a game and some of my friends still run dialup so i know that even a game over 3mb will take them over 10 minutes to load…
My game will have levels and i thought it would be easier for my friends and people on slower connections to have the level load before it’s played.
I’m not exatly sure how to do this though… i know how to create a preload but this is somewhat different my friends.
You really need to have a look at the bandwidth profile thing.But at the start I would do something like this
stop();
assessLoad = function (clip) {
var kbLoaded = Math.floor(clip.getBytesLoaded()/1024);
var kbTotal = Math.floor(clip.getBytesTotal()/1024);
percent = kbLoaded/kbTotal;
percent_txt.text = Math.floor(percent*100)+“%”;
if ((kbLoaded>=kbTotal/20) && kbTotal>1) {
clip.gotoAndStop(“startframe”);
}
if ((kbLoaded>=kbTotal/10) && kbTotal>1) {
clip.gotoAndStop(“credits”);
}
if ((kbLoaded>=kbTotal/5) && kbTotal>1) {
clip.gotoAndStop(“startGame”);
}
if ((kbLoaded>=kbTotal) && kbTotal>1) {
clearInterval(myInterval);
}
};
myInterval = setInterval(assessload, 50, this);
it really depends upon how you have made it and you`ll have to experiment with how much you have to preload in order to “stream”.
I think the best thing for you to do would be for the user to pick their level straight away(seperate .swf) so that this can be instantly loading, then you can show the credits etc while this is happening.we have all become obsessed with preloading but if you can get away with only loading say 30% of the movie before the user starts to play and it still runs smoothly(continues loading while playing) then it is much better.
ya but the fun of the game is not knowing exactly wats gonna happen in the level or the storyline to it… example if they choose a desert level and lets say there was some sorta mummy …( insert interesting storline )
the people wouldnt know whats going on and that can really make the user feel like the game is a no smoe game…
anywayz if there is a way to use multiple preloading and still only have 1 fla file i would like to know…
ex - each preloader preloads a scene?
if not ill use ur way but preferably id like 2 know this way so its easier on the user
meck, I’am also looking into doing exactly what you want to do. If I find out how I will post in kirupa. But if you foind out how first please message me back. thanks.
You should not use scenes for this sort of thing, you will only run into problems.The way outlined above is what i`d try.
When you use a preloader, all you are doing is stopping the timeline and playing some animation while more frames (external movies etc) load so if you are clever about it, you will not have to load 100% before starting to play.
Having said that Have a look at this http://www.gifsrus.com/testfile/hierachyprel8.swf (ignore the random text- this whole thing was just quickly made to test a preloader idea.)
This is 6 movies which just load in order but if you click a button in the meantime( maybe your user makes a different choice) then the order changes and that movie becomes priority.
This is just using the same code as above.
no, its just a function which you would have on the timeline and call each time you use loadMovie.
Its pointless me uploading the .fla.
If you want to upload a basic draft of your game, i`ll see if i can break it up for you.