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

Posted on 2005-05-01
Last Modified: 2008-06-08
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.


Question by:jb1013
    LVL 14

    Expert Comment

    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.

    LVL 1

    Author Comment

    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.

    LVL 18

    Assisted Solution

    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

    or loadClip with the movieclip loader class

    LVL 16

    Accepted Solution

    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.

    LVL 1

    Author Comment

    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.


    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Join & Write a Comment

    I come across a lot of question about how to access things in the document class from a movieclip, or accessing something from a movieclip in the document class. It took me a while to figure this out but once I did it makes life so much easier. …
    Recently, I was asked to recommend a tracking system to be implemented on a clients website. As the entire site was built on flash, my first thought was to suggest custom built tracking system. However, our company at that point of time didn't h…
    In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
    The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now