Skip navigation
Currently Being Moderated

CS6 Preloader not working

Mar 10, 2013 5:43 PM

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.

  • Currently Being Moderated
    Mar 11, 2013 2:59 PM   in reply to SakreD

    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?

    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points