Guest User

Untitled

a guest
Aug 20th, 2018
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. stop();
  2. //-----
  3. //-------------preloader------
  4. //make the preloader bar not appear "full" right away
  5. bar_mc._xscale = 0;
  6. //load Movie into level 1
  7. loadMovieNum("/chocolates/FoiledChocolateHeartsNew.swf", 1);
  8. //not the movie to load has a blank first frame.
  9. _level1.stop();
  10. onEnterFrame = function () {
  11.     // get the bytes of Level 1 and make into a percent
  12.     percent = Math.ceil((_level1.getBytesLoaded()/_level1.getBytesTotal())*100);
  13.     //use the percent to determine the xscale of the preloader bar.
  14.     bar_mc._xscale = percent;
  15.     // if loaded play level1
  16.     if (percent>99) {
  17.         //note you MUST delete onEnterFrame otherwise it
  18.         //will continue to run.
  19.         loadText._alpha=0;
  20.         bar_mc._alpha=0;
  21.         loadBorder._alpha=0;
  22.         delete this.onEnterFrame;
  23.         _level1.gotoAndPlay(2);
  24.        
  25.     }
  26. };
Add Comment
Please, Sign In to add comment