Jump to content
Search Community

loader progress bar always appears [mostly SOLVED]

Guest aezzell
Moderator Tag

Recommended Posts

Guest aezzell

I have a master SWF that loads 10 other SWFs, and there's a progress bar on the master SWF. Here's the page:

http://europe-dev.genphysics.com/

 

This is the main part of the loader code in the master file (The info about the subSWFs is stored in an array imaginatively called "swfs"):

var queue:LoaderMax = new LoaderMax({name:"mainQueue",onProgress:progressHandler,onComplete:completeHandler,onError:errorHandler});

//load the background into its holder
queue.append( new SWFLoader(swfs[0][0], {name:"clip" + swfs[0][1],container:backgroundHolder,estimatedBytes:swfs[0][2],noCache:false}) );

//load the rest of the movies into their holders (movies in the array start at 1)
for (var i:Number = 1; i < swfs.length; i++)
{
queue.append( new SWFLoader(swfs[i][0], {name:"clip" + swfs[i][1],container:movieHolder,estimatedBytes:swfs[i][2],noCache:false}) );
//trace(i + " " + swfs[i][0]);
}

//start loading
queue.load();

function progressHandler(event:LoaderEvent):void
{
progressBar_mc.bar_mc.scaleX = event.target.progress;
}

 

Note that I have noCache:false on the SWFLoaders.

 

Every time the page loads, I see the progress bar run quickly. The first time I load the page after flushing my cache, the progress bar runs more slowly, and then it speeds up on subsequent visits to the page. If I set noCache:true on the SWFLoaders, it's slow every time, so I do see

a difference. But in other Flash movies I've made, with traditional preloaders, I don't see the progress bar at all after the first time.

 

Is there something else I need to do to fix this?

 

If anyone wants to look at the files, I've zipped everything and posted it here: http://europe-dev.genphysics.com/europe.zip (6.7MB, so too big to attach to a post).

 

Thanks for any light you can shed on this.

Link to comment
Share on other sites

I can't open you files with flash cs5.

 

perhaps you can set a Timer or delayedCall() to check the the progress of the loading after .05 seconds. if the progress is less than 1, then show the progress bar (for initial load) or else move it or hide it.

Link to comment
Share on other sites

Guest aezzell

Sorry about the 5.5 format - I've attached the main file in version 4.

 

I will fiddle around with a timer and see if I can get that to do anything.

 

Should it be behaving like this, though? Shouldn't the loader progress animation not show at all if the movie is already loaded?

 

Thanks for the suggestion.

Link to comment
Share on other sites

thanks for providing the cs4 version. it worked fine.

 

your progress bar is visible by default

 

my assumption is that:

 

even though the assets are cached, your swf still has to look for them and even though it finds them quickly in the browser numerous progress events are still firing and your progress bar is just doing it's expected job of visually representing the load process.

Link to comment
Share on other sites

Guest aezzell

I put in a timer as you suggested and was able to get the desired behavior (i.e., being able to control whether or not the progress bar appears by tweaking the timer) when running the Flash movie containing the master loader from within Flash (ctrl-enter).

 

So I know the logic is working.

 

When I put the SWF files on the server, though, I seem to have 2 choices:

 

1. Never seeing the progress bar at all

2. Seeing the progress bar display as expected after flushing the browser cache, but still seeing it briefly upon subsequent reloads

 

As I tweak the timer and use different browsers to view the page, I'm not getting consistent results across all browsers.

 

(Show of hands, please - Who finds this surprising? No one? Really?)

 

At this point, the page is live (http://europe.gpworldwide.com/) and I'm in "not gonna worry about it any more unless someone complains" mode.

 

So thanks (once again) for your help. This is an amazing product, and it makes Flash animation SO much easier!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...