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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Preloaders

Status
Not open for further replies.

yokelrobin

Programmer
Mar 7, 2002
2
GB
If I set up a preloader in a scene that has lots of movie symbols, does it check that all the movie symbols are loaded? Or is it just the actual frames running in that scene?

Many thanks
 
a preloaded is normally set up to check that all bytes used in the entire movie across all scenes are loaded... there is a frames loaded check but it is not recommended since it checks if total frames are loaded and that could be quite imbalanced.

preloaders are not concerned with what is in the library which is a common misconception.

If your movie is quite large in file size and you have optimized all you can it may be a good idea to break your movie up into separate movies and have them load on demand.

Hope this helps...

Regards,
TulsaJeff

cd_tektips.gif
 
That does help, thanks a lot... I think I'll probably call on demand as you suggest. That would save the initial loading time as well.

Thanks!
 
With the exception of external .swfs (loaded with the loadMovie action), and unless scripted to load such movies, a normal preloader should load all content of the number of frames or percentage specified. You can use _framesloaded & _totalframes, or more accurately getBytesLoaded() & getBytesTotal.

Regards,
new.gif
 
Tulsa...
Unless you're really talking about the deprecated ifFrameLoaded action, there's no reason why, the _framesloaded & _totalframes method would be less accurate and not recommmended when preloading all of the frames. The accuracy can only seem to be questionable, when loading a certain number of frames (or a percentage), in the hope of streaming the movie while the rest of the movie downloads in the background. All frames' content may not be equal, and the last frames of your movie might well be the heaviest, thus giving the impression that your preloader is not accurate, when in fact it is!

Regards,
new.gif
 
Somehow I don't get it. I have a flash movie, but it seems when I take items off the stage and even delete them from my library, my movie size gets larger; however, when I debug my movie it does indeed load quicker.

For instance: I have movie1 that loads in 16.5 secs on 14.4 and is 303kb. I delete a large symbol from the stage, delete it from the library. Delete another symbol and also remove it from the library and then save it as movie2. My movie now loads in 11.2 secs on 14.4, but the file size is now 469kb!

I do not understand. I know the library doesn't affect loading times, but it does affect file size right? If this is right why is my movie getting larger? *sigh*
 
I do not recommend it since most designers I have seen and spoke with want to have a progress bar show how much is loaded. If 75% of your content is on the last 3 frames in a 16 frame movie then it show a very imbalanced loading.

So, yes... I guess if you could care less about actually seeing how much has loaded and just have a now loading text on the screen...then frames loaded would work great.

It may be just the thing for you yokelrobin if you specifically want to load only the certain scene then you would specify for it to move on when that total number of frames had been reached.

here is a good preloader I created with _getBytesLoaded and shows a percentage loaded in a dynamic text box if anyone is interested:

This action would go on frame 1

Total = getBytesTotal();
Loaded = getBytesLoaded();
Percent = int((Loaded/Total)*100)+"%";
if (Total==Loaded) {
gotoAndStop ("Main", 1);
} else {
play ();
}

this action would go on frame 3

gotoAndPlay (1);


You then create a dynamic text box in a separate layer spread from frame 1 to frame 3 and name it Percent. Regards,
TulsaJeff

cd_tektips.gif
 
I agree with you when specificly talking about an accurate "bytes progress bar", and nothings keeps you from using getBytesLoaded (if only to display an accurate figure!) in conjunction with the _framesloaded action, the point is the _framesloaded action would still be accurate, in the case all frames were preloaded.

As for your script, I'd modify it, to avoid seeing a flash frame of your dynamic textfield upon subsequent visits to the site.

Frame 1:

if (_root.getBytesLoaded()>=_root.getBytesTotal()) {
gotoAndPlay ("Main", 1);
}
// if in the user's cache, goes directly to movie
// no textfield displays on this frame!

Frame 2:

if (_root.getBytesLoaded()>=_root.getBytesTotal()) {
gotoAndPlay ("Main", 1);
}
// Display dynamic text fields...
loadedBytes = _root.getBytesLoaded();
totalBytes = _root.getBytesTotal();
percent = int((loadedBytes/totalBytes)*100)+"%";

Frame 3:

gotoAndPlay(2);

No need for elses, and textfield displays should only be on frames 2 & 3.

As for you Yokel, when deleting stuff from the Library, try then "saving as" your project under another name. The new project should then show a smaller bytes size. Flash seems to have a problem updating file size without closing down the project and re-opening it! Anyways, it's the .swf's size that's you should care about!

Regards,
new.gif
 
As you can see yokelrobin... options R' Us

There are many ways of handling certain things such as preloaders and alot of it depends on your specific application. Some options are better than others such as the point Old brought up concerning the textbox and how to make it not flash periodically for those who have the swf in their cache...

in the end... it is up to you and must be implemented in such a way as to give your viewers the best experience possible while they are navigating to and through your site.

good suggestion on the preloader Old... the little things like that ARE very important;-) Regards,
TulsaJeff

cd_tektips.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top