• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Pre loader to run once

Community Expert ,
Jan 29, 2008 Jan 29, 2008

Copy link to clipboard

Copied

So I have this flash masthead with a bunch of nav features that lives on all pages of a site I've designed. I've created a working pre-loader. So far so good. Now I'd like to know if there's any way to detect whether the swf file has all ready been put in cache so that it doesn't run every time.

The reason that I ask is that if I remove the pre-loader, then clear the cache, the flash based masthead takes a second or two to load on the first page, but then is instantly available on other pages. It's appears that it's only when the pre-loader is part of the swf file that the it forces a reload every time a page is revisited. Even when you use the back button.

My html files are all in the site root directory. All html pages reference the same (and only) swf file in my root/media directory.

Thanks.
TOPICS
ActionScript

Views

649

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 30, 2008 Jan 30, 2008

Copy link to clipboard

Copied

anybody?

Is this even possible

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 30, 2008 Jan 30, 2008

Copy link to clipboard

Copied

I'm not really sure what your question is. If you want to employ a
preloader, but not have a graphic appear when the file is already downloaded
you could just do a bit of a hack, and wait for say half a sec before
showing the graphic:

var myLoader = new MovieClipLoader();
var loadListener = new Object();
var myTimer = 0;

loadListener.onLoadProgress = function(target, lb, tb){
if(getTimer() - myTimer > 500){
//half second has elapsed - file is not in the cache - show the
progress meter
}
}
loadListener.onLoadStart = function(target){
myTimer = getTimer();
}


--
Dave -
Head Developer
http://www.blurredistinction.com
Adobe Community Expert
http://www.adobe.com/communities/experts/


Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 31, 2008 Jan 31, 2008

Copy link to clipboard

Copied

LATEST
My pre-loader is actually a progress bar and a little movie that runs through the nav system for the site. What I want to check for is whether or not the swf file is all ready loaded. If it is, there's no reason to run the pre-loader again and display the progress bar and all the nav buttons lighting up. There's also no reason for the swf file to load again when you use the back button or when you navigate to another page that uses the same swf file.

Before I had the pre-loader it seemed that the swf loaded on the first visit to the site but then always played from cache. With the pre-loader as part of the swf file every time the page changes the pre-loader re-loads the entire swf file.

If you need to see the code I'll attach it.

At any rate, I'll give your code a try and see if I can get this to work.

Thanks,
Rick

I'll give your code a try.


Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines