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

Preloader code running every time page loads

Contributor ,
Mar 25, 2010 Mar 25, 2010

Copy link to clipboard

Copied

Hi everyone,

I purchased a preloader from Adobe Exchange  for my flash animation. I've noticed though that even though it works, whenever I refresh the page that the swf file is on, or even navigate away and then come back to the same swf page, the preloader starts operating again as if the file was being downloaded for the first time.

I thought that once a swf was downloaded it didn't need to be done again. The code from the preloader is as follows:
onClipEvent(load){      
       
//show text Loading
       
this.text = true;      
       
//show reflection
       
this.reflection = true;
       
//show percents
       
this.percents = true;
       
//set color
       
this.color = "0x003976";
       
//set gradient color for reflection
       
this.bgColor = "0xffffff";
       
//set speed (1-9)
       
this.speed = 6;
       
//loop infinite, not loading
       
this.infinite = false; 
       
//loaderTarget (if null self swf preload)
       
this.contentTarget = null;             
       
//auto stop timeline
        _parent
.stop();
}
Could it have something to do with the fact that it's an onClipEvent?

Appreciate any advice.

TOPICS
ActionScript

Views

873

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 ,
Mar 25, 2010 Mar 25, 2010

Copy link to clipboard

Copied

there's no preloader code there.  that's probably just the initialization code and there's an enterframe clipevent also attached.

anyway, the preloader code will execute no matter whether the swf is being downloaded via a slow internet connection or from your harddrive.  it should just load a lot faster from your harddrive.

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 Beginner ,
Mar 25, 2010 Mar 25, 2010

Copy link to clipboard

Copied

ofcourse it will reloadevery time you refresh the page, it's just how it works...

for example youtube videos also load from begining when page is refreshed...

i don't think there is any way to make it different...

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
Contributor ,
Mar 25, 2010 Mar 25, 2010

Copy link to clipboard

Copied

Thanks for the replies,

When images are downloaded on web pages they're usually cached which is what I thought happened to flash files also. Isn't that the case?

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 ,
Mar 25, 2010 Mar 25, 2010

Copy link to clipboard

Copied

Yes the files can be cached locally, but if the Flash file has a preloader built into it the preloader does what it does in life--it cannot look to see if the file is already cached and bypass the preloading process.  Depending on one's connection speed the preloader may just Flash by if a file is being drawn from the cache, but it still plays thru the loading process.

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
Contributor ,
Mar 25, 2010 Mar 25, 2010

Copy link to clipboard

Copied

The preloader has a brief animation at the end where it fades out to transparency and this is mostly what I'm seeing which isn't a good look when it happens more than once, ie. when you return to the page, so maybe I need a different type of preloader that doesn't have this ending animation. Can you suggest any on Adobe Exchange?

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 ,
Mar 25, 2010 Mar 25, 2010

Copy link to clipboard

Copied

I don't know what you have, but if it is an fla file with the preloader you should be able to edit the preloader any way you like, including removing the ending animation.

I have no familiarity with Adobe Exchange.

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
Contributor ,
Mar 25, 2010 Mar 25, 2010

Copy link to clipboard

Copied

LATEST

Ok thanks - I'll look into the code.

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