I am really trying to have my preloader work, with a site that is 100% AS. the 
entire site resides either in classes or as on the first frame. there has got 
to be some way to preload a site, with a single function that is entirely 
dynamic. this is what i have, but it will not even appear on the screen. no 
errors .. ideas would be great....

// -------------------------
// preloader
function preloadMe() {
 // stop movie from playing
 //stop();
 // reference to _root
 ref = _root;
 // create the preloader mc
 ref.createEmptyMovieClip("preloader_mc", ref.getNextHighestDepth() );
 // create the preloader mc progress text
 ref.preloader_mc.createTextField("preloader_txt", ref.getNextHighestDepth, 0, 
0, 200, 10);
 with (ref.preloader_mc.preloader_txt) {
  embedFonts = true;
  selectable = false;
  setNewTextFormat(format1_fmt);
  text = "LOADING SITE: 00"
 };
 // place preloader text in center of stage
 ref.preloader_mc._x = (Stage.width/2) - 
(ref.preloader_mc.preloader_txt._width/2);
 ref.preloader_mc._y = (Stage.height/2) - 
(ref.preloader_mc.preloader_txt._height/2);
 ref.onEnterFrame = function() {
     tBytes = ref.getBytesTotal();
  bLoaded = ref.getBytesLoaded();
  percent = Math.round((bLoaded/tBytes)*100);
  // keep two places if percent is under 10, ie: 03 
  if (percent < 10) {
   percentTxt = "LOADING SITE: 0" + percent;
  } else {
   percentTxt = "LOADING SITE: " + percent;
  }
  // if this movie is not fully loaded, then display percent loaded
  if (bLoaded < tBytes) {
   ref.preloader_mc.preloader_txt.text = percentTxt;
  // otherwise, delete the preloader_mc, and the textField, then play movie
  } else {
   ref.preloader_mc.removeMovieClip();
   ref.preloader_mc.preloader_txt.removeTextField();
   play();
   delete this.onEnterFrame;
  };
 };
};
// -------------------------
//makeContent();
//makeIt();
//alot(5);
//trace(getDepth(_root.ellipse_0));
preloadMe();
_______________________________________________
[email protected]
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