6 Replies Latest reply on May 12, 2010 8:32 PM by kglad

    What is wrong with this preloader code?

    Jens Peermann Level 2

      stop();

       

      this.addEventListener(Event.ENTER_FRAME, loading);

       

      function loading (e.Event):void

      {

       

      var total:Number = this.stage.loaderInfo.bytesTotal;

      var loaded:Number = this.stage.loaderInfo.bytesLoaded;

       

      if (total == loaded)

      {

      gotoAndStop(2);

       

      this.removeEventListener(Event.ENTER_FRAME, loading);

      }

       

      }

       

       

      The preloader movie is on frame 1, the main movie on frame 2. The preloader spins until the main movie is loaded, then the playhead just jumps between frame 1 and 2.