1 Reply Latest reply on Apr 21, 2011 6:15 AM by kglad

    Swf looping - stop(); not working

    lolNoJoke

      I made a little animation with a preloader, and i want it to stop on frame 9.

      I tried putting a stop(); command on the frame but the swf just keeps looping.

      here is the preloader code (maybe it matters):

       

      this.onEnterFrame = function() {
          var total = _root.getBytesTotal();
          var loaded = _root.getBytesLoaded();
          var percent = Math.round(loaded/total * 100);
          this.mc_preloader._xscale = percent;
          if (percent == 100) {
              play();
          }
      }
      stop();

       

      edit:

      nvm got it - it was a problem with the preloader.

        • 1. Re: Swf looping - stop(); not working
          kglad Adobe Community Professional & MVP

          :

           


           

          this.onEnterFrame = function() {
              var total = _root.getBytesTotal();
              var loaded = _root.getBytesLoaded();
              var percent = Math.round(loaded/total * 100);
              this.mc_preloader._xscale = percent;
              if (percent == 100) {
                  play();

          delete this.onEnterFrame; // otherwise, play() continues to execute
              }
          }
          stop();