truromeo4juliet
asked on
Skip preloading if movie is already downloaded
I've got a preloader that was programmed by someone else... the problem is that the movie that it's loading appears on 5 different pages of the same site, and it's forcing the movie to redownload itself every time. I just need a way for it to skip the download if the file is already in cache. I thought this could be done using a simple if-statement to check if the bytes loaded equaled bites total, but it didn't work. Some assistance would be nice :) Thanks
onClipEvent (load) {
total = _root.getBytesTotal();
}
onClipEvent (enterFrame) {
loaded = _root.getBytesLoaded();
percent = int(loaded/total*100);
text = percent+"%";
gotoAndStop(percent);
if (loaded == total) {
_root.gotoAndPlay(2);
}
}
ASKER
it's all one swf file... it's an HTML site (6 html pages in all), each page has the same SWF embedded into it... for some reason, each page, the first time I go to it, has to load the SWF... afterwards, it loads from cache when i revisit that particular page... Is there any reason for this?
hmmm .. that's a strange one, the cache should have picked up the same file as long as the URL is the same .. do you have this posted anywhere on the interwebs so I can sneak a peek?
ASKER
http://permanentmakeupbyadriana.com/
the only difference per page is that each page is referenced by the swf file to tell it what button should be highlighted in the SWF. You can see in the website.
the only difference per page is that each page is referenced by the swf file to tell it what button should be highlighted in the SWF. You can see in the website.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
should the if !IE section still have button three in the object data:
<object data="flash/header_v8.swf? button=3" etc...
?
<object data="flash/header_v8.swf?
?
ASKER
nevermind, got it! Thanks so much for the help :)
ASKER
Thanks so much.
please post the code that loads the external swf..
If you are just trying to skip an animation you can do a simple check in the loader to see if the percentage is ever anything less than 100 and if it is, gotoAnPlay() passed the animtion..
if you need some examples let me know .. or if I'm wrong please better specify the problem .. thanks