Anyway to skip preloader if .swf is already cached by the users browser.

Something just popped into my head that I'm wondering about.

Is there anyway to cause .swfs to say start on frame 2 instead of 1 if the .swf is already loaded in the end users browser cache?

Never seen mention of this anywhere.

Just wondering if anyone has heard of anything like this.

Thanks,

JB
LVL 1
jb1013Asked:
Who is Participating?
 
sam85281Connect With a Mentor Commented:
You can always do this:

Before your preloader:

I would have 5-10 blank frames or so and then:

if (_framesLoaded >= _totalFrames) {
     gotoAndPlay(16); // 16 being one frame past the preloader where the content starts
} else {
     gotoAndPlay(15); // 15 being where the preloader is
}

Because of the browser taking time to get ready, load other stuff, etc.  I wouldn't have this on frame one.  Put it at 5 or 10 or so.
Also you might want to try setting the if frames loaded statement to less than total frames, for instance:  If your movie has 500 frames, set it for 400 frames.

if (_framesLoaded >= 400) { // 400 frames instead of total
     gotoAndPlay(16); // 16 being one frame past the preloader where the content starts
} else {
     gotoAndPlay(15); // 15 being where the preloader is
}

This way if it's in the cache it will be loaded that far by the time it reaches frame ten or wherever you put the code, and will skip over the preloader.  I'd put a small logo or graphic or something in the first 10 frames so it's not just blank.

-Sam
0
 
trigger-happyCommented:
i've never heard of anything like this, and normally it's impossible to find out if it's inside the browser's cache. Besides, if it were then the preloader would just whizz by and the movie will start.

--trigger-happy
0
 
jb1013Author Commented:
Yes, the preloader does whiz by, but if it didn't show at all that would be nice, especially if your using LoadMovie to load external .swfs, and you may be reloading the same .swf more than once if your bouncing around in the site.  

I've never heard of this either, but doesn't hurt to ask right.

Thanks for reading.

JB
0
 
BillystyxConnect With a Mentor Commented:
You may be able to use cookies...
If you don't want to reload swfs, just load them to different levels and make the level invisible once its loaded and you want to mov on, then if you need that level again, you can just go
_level1._visible=true;
etc

loadMovieNum("myswf.swf",1);
or loadClip with the movieclip loader class

Bil;lystyx
0
 
jb1013Author Commented:
Thanks guys for giving me something to think about.  I can see ways that both methods might work on different types of projects.  

However, I don't think either is the solution I was really looking for this particular project, but I don't think the solution I was hoping for exists.

So thanks for the input.

JB
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.