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

    CS6 Preloader not working

    SakreD Level 1

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


      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) {


                          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 Most Valuable Participant

          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?