1 Reply Latest reply: Mar 11, 2013 2:59 PM by sinious RSS

    CS6 Preloader not working

    SakreD Community Member

      Got this code from an old tutorial, it's not working for me in CS6 does it need updating?

      stop();

      rectMask_mc._height = 1;

      this.onEnterFrame = function():Void  {

                var loadedData:Number = this.getBytesLoaded();

                var allData:Number = this.getBytesTotal();

                var percent:Number = Math.round(loadedData/allData*100);

                rectMask_mc._yscale = percent;

                if (loadedData>=allData) {

                          gotoAndStop(10);

                          delete this.onEnterFrame;

                }

      };

       

      I did some testing and noticed that the "rectMask_mc.height = 1;" command doesn't work with the code as a whole.

        • 1. Re: CS6 Preloader not working
          sinious CommunityMVP

          This looks like old AS2 loadclip code. Things like _yscale only exist in ActionScript 2.0 not 3.0. Is this a 3.0 project? If so it would be rectMask_mc.scaleY.

           

          It was very common in AS2 to have a SWF contain its own preloader. In AS3, a smaller outer clip (usually called a stub) is loaded with enough code to get the larger SWF preloading while displaying progress.

           

          Are you trying to preload a whole single CS6 project you did or have your project preload another clip into itself?