Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

is this preloader optimized?

Status
Not open for further replies.

PantherRun

Technical User
May 18, 2004
100
0
0
US
Hey out there;
I'm in the process of optimizing my movies. Someone pointed out that my preloader that someone made for me, might be preloading 'everything' before letting the viewer see anything. He recommneded that i put into the script 'if so many frames or bits or whatever is loaded, then start playing', thus cutting down on that dreaded wait period.

Okay, so i'm reading up on that.

What I'd like to ask you: would you look at the preloader code below and tell me if it is indeed insisting on loading everything before showing anything, before i go messing with this preloader?

If so, would you help make it better?

On the preloader's timeline are 3 frames with code.

frame 1 =
_parent.stop();

frame 2 =
kBytesLoaded = (_parent.getBytesLoaded()/1024)/3;
kBytesTotal = (_parent.getBytesTotal()/1024)/3;
kBytesRemaining = kBytesTotal - kBytesLoaded;
percentLoaded = 100 * kBytesLoaded / kBytesTotal;
percentRemaining = 100 - percentLoaded;
progress = Math.floor(kBytesLoaded) add " of "
add Math.floor(kBytesTotal) add " kBytes";
loadBar._xScale = percentLoaded;
kBytesSec = kBytesLoaded/(getTimer()/1000);
timeRemaining = kBytesRemaining / kBytesSec;
times = Math.floor(timeRemaining) add " seconds remaining";

frame 3 =
if(percentLoaded < 99){
gotoAndPlay(2);
}else{
_parent.play(5);
stop();
}


As you look at this, I'd like to ask you another question, anything else that you might change to make it better?

Thanks
Hoss
 
No offence but I don't like it!

It's over complicated, and would display IMHO, a buch of useless stuff... I you ask me, the best preloader is a bar and/or a percentage display. I don't care about the numbers of loaded bytes, total bytes, remaining bytes, remaining time and that kind of useless info... I'm interested in seeing a movie, not a preloader!

Furthermore a lot of confusion in your question...

You always have said that these movies were for fast connected user's only... Are you now worrying about slow connected ones?
And, you're not specifying if this a preloader is to load some main movie, or a generic preloader within a main movie, to load all other external movies.

Regards. Affiliate Program - Web Hosting - Web Design
 
Hey Old, thanks for getting back.

No offence taken! Simplicity all the way, and yes, this is broadband all the way.

These questions of mine are coming up because i have the demo site online now and tested the first movie (total size 2.49mb), after going past the 2 minute loading mark, i said 'gosh this is way too much of a wait'.

I had someone else, the guy who spoke to me about the preloader concerns, download the start of another chapter - this one preloads the music file (1.31mb) and about 15 frames in, triggers the preloading of the first movie(1.43mb), so 2 files, 2.7mb in total size, knocking at your door ... again the wait was a bit over 2 minutes -

I've got to cut the wait down.

(Old, does that seem a natural wait length to you on a 2.74mb download for broadband?)

As to the second part of your question: It's a generic preloader sitting at the start of EVERY movie, including the lead movie(main movie?) which is the sound track.

The flow: Triggering the chapter button on the web page basically starts the preloading of the soundtrack file.
(On the soundtrack file's root timeline sits the preloader that plays into a stop action on a MC. Inside the Mc, is the soundtrack. About 15 frames into it, we loadmovie command the first movie, say to level 2.

That movie also has the preloader sitting on its root timeline, ect. All movies have the exact same set up for simplicity.)

And, as we've talked about in another question, the preloading of each new page to an ever higher level will automatically be triggered now, rather than wait for the viewer to trigger it - hoping to cut down on wait time.

Does that clarrify my garble at all?

Back to the preloader, aside from the fact it badly needs a shave, is it stopping flash's streaming ability because it's insisting on downloading everything before it shows anything?

If so then how do I fix that? And simplfy it?

Hoss
 
A generic preloader is not one found in every file, but a one & only single "generic" preloader within the main movie that monitors the loading of all external files. It is even seperate from the main movie's preloader.

That said, since you've always refused to post or even mail any of your files, it's hard to imagine the content of these movies and see what might be causing these delays, which certainely wouldn't make sense on my cable connection.
Furthermore, it is still unclear to me, if you're talking of such a long delay in the appearance of the preloader's displays themselves, or simply about the time it takes to actually load your 2MBs+ movies?

Regards. Affiliate Program - Web Hosting - Web Design
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top