There used to be an old problem that might be the cause of your troubles.
When a movie starts, sometimes the getBytesLoaded returns a value before
getBytesTotal has finished. So your condition of bLoaded < tBytes is
rendered inadequate. You could add "&& tBytes > 8" to make sure that
totalBytes has actually loaded something...

Cheers,

Kevin

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Edward
Hotchkiss
Sent: March 16, 2006 10:42 AM
To: Flashcoders mailing list
Subject: [Flashcoders] percent loaded?

i guess that my code is being deleted on each enter frame. once it loads
completely, the text finally shows up, and then the next frame shows up
also. why doesnt this one frame preloader, second frame website preloader
work??? this is really bugging me, that i have to put code on a movieclip,
and i cant do it 100% AS. 


function preloadMe() {
 _root.onEnterFrame = function() {
     tBytes = _root.getBytesTotal();
  bLoaded = _root.getBytesLoaded();
  percent = Math.round((bLoaded/tBytes)*100);
  if (bLoaded < tBytes) {
   _root.preloader_mc.preloader_txt.text = "loading site: " + percent;
   gotoAndPlay(1);
  } else {
   _root.preloader_mc.removeMovieClip();
   _root.preloader_mc.preloader_txt.removeTextField();
   gotoAndStop(2)
  };
 };
};
// -------------------------
drawPreloader();
preloadMe();
_______________________________________________
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


_______________________________________________
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