I'm using the code at the bottom of this post.

Using the Simulate Download and the Bandwidth profiler, I have two
different files where it's basically downloading about 15% of the file
and then continuing playing.

The preloader starts to work correctly, but basically quits out
incorrectly around 15%.

Looking at the bandwidth profiler, it continues downloading in the
background while trying to (poorly) play.

Any obvious hangups?

No components are in use, all assets are inside the flash file. The
bandwidth profiler shows a linear download, 0 to 100%, just around 15%
or so it just goes on and tries the play the file after showing me the
preloader for the first 15%.

I've used this code successfully before, it's just that now I have a
deadline, so, I guess it totally makes sense that it does not work
now. Grr.

=== CODE ===

// preloader
function checkLoad(mcTarget:MovieClip):Void{
 var nLBytes:Number = mcTarget.getBytesLoaded();
 var nTBytes:Number = mcTarget.getBytesTotal();
 var nPercent:Number = (nLBytes/nTBytes)*100;
 mcLoader.mcBar._xscale = nPercent;
 var sPercent:String = Math.floor(nPercent).toString();
 var sKBytes:String = Math.floor(nTBytes/1024).toString();
 var sMessage:String = sPercent + "% of " + sKBytes + "K loaded.";
 mcLoader.tPercent.text = sMessage;
 if (nLBytes >= nTBytes && nTBytes > 0) {
   if (nCount >= 12) {
     clearInterval(nProgress);
     mcTarget.gotoAndPlay("main");
   } else {
     nCount++;
   }
 }
 updateAfterEvent();
}

var nCount:Number = 0;
var nProgress:Number = setInterval(checkLoad, 100, this);

stop;

--
count_schemula
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to