3 Replies Latest reply: Jan 29, 2010 3:36 PM by k.loy RSS

    preloader code

    k.loy Community Member

      I'm using the code from this tutorial for a preloader.  Though I am not using a dynamic text field like the tutorial says.

      I took the line referring to the dynamic text field out of the code, but it's still not working?

       

      The animation has 2 frames with movie clips in each. One for the preloader and one for the main content.

      Do I need to put somekind of stop or non-looping code in here so it doesn't go back to frame 1(preloader)??

       

      http://schoolofflash.com/blog/2008/04/flash-cs3-tutorial-actionscript-3-preloader/

      ------------------------------------------------------------------------------------------ --------------

      this.loaderInfo.addEventListener(ProgressEvent.PROGRESS, onProgress);
      this.loaderInfo.addEventListener(Event.COMPLETE, onComplete);

       

      function onProgress(e:ProgressEvent):void
      {
          var loaded:Number = e.target.bytesLoaded;
          var total:Number = e.target.bytesTotal;
          var pct:Number = loaded/total;
          loader_mc.scaleX = pct;
      }

       

      function onComplete(e:Event):void
      {
          nextFrame();
      }