How websevers handle external jpeg loading

Flash + the server! XML, Sockets, PHP, Remoting, ASP.NET, ColdFusion, Java, Flash Media Server, Flex...
Post Reply
Posts: 2
Joined: Mon Jun 30, 2003 5:56 pm

How websevers handle external jpeg loading

Post by rocco » Wed Aug 10, 2005 2:10 am

Hey everyone,

I had a question about how the webservers serve up the jpegs in a flash presentation. The scenario is this: I have an online portfolio for a company that loads external jpegs from an xml file. This is because the content of the portfolio changes often. My problem is that my preloader does not work the way it is supposed to on the web (it works perfect on my computer). The presentation works like this:

//Load each jpg into a MovieClip
for(var i:Number=1; i<=artTotal; i++) {
this.createEmptyMovieClip("mcArt"+i, this.getNextHighestDepth());
this["mcArt"+i]._alpha = 0;
mcLoader.loadClip(xmlArt.childNodes[(i-1)].firstChild.toString(), this["mcArt"+i]);
// Attach Preloader
var oInit:Object = {_x:200, _y:140, totalMC:artTotal};
this.attachMovie("RadLoader", "preLoad", this.getNextHighestDepth(), oInit);
this.preLoad._alpha = 0;

When all the movieclips with the jpegs in them begin to download, I show the preloader and show the progress from there. The problem is that is seems that the webserver downloads about 2 jpegs at a time and so I never get the information from the last jpegs until to late. The preloader shows after the first couple jpegs have completely downloaded. Is there anyway to get the filesize information of the later jpegs earlier, or force the webserver to start the download of all the jpegs at the same time? I am using Flash MX Pro ver. 7.0.1.

Here is the preloader code that is used:

if(this._parent["mcArt"+totalMC].getBytesTotal() > 0) {
for(var i:Number = 1; i<=totalMC; i++) {
loadBytes += this._parent["mcArt"+i].getBytesLoaded();
totalBytes += this._parent["mcArt"+i].getBytesTotal();
percent = Math.floor((loadBytes/totalBytes)*100);
strTotal = Math.floor(totalBytes/1024).toString();
this.loadText.text = percent + "% of " + strTotal + "K";

Any help would be very much appriecated,

Post Reply