• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 290
  • Last Modified:

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
0
jb1013
Asked:
jb1013
2 Solutions
 
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
 
BillystyxCommented:
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
 
sam85281Commented:
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
 
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

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now