3 Replies Latest reply on Mar 30, 2007 5:20 PM by kglad

    Preloader Actionscript problem

    HamptonCaught Level 1
      As a relative newcomer to Actionscript, I came across a preloader tutorial (from a trusted source) which reveals a cut out photograph as the movie loads. I decided to use it, but although I have checked and double-checked the Actionscript, Flash 2004 keeps reporting an error and the preloader is not working.

      The problem is obviously in line 6 and I just thought that someone might be able to look at the Actionscript and see the problem (which I can't!).

      Here's the Actionscript;
      mask_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);
      mask_mc._yscale = percent;
      if (loadedData>=allData) {
      delete this.onEnterFrame;

      Here's the error report from Flash;
      **Error** Scene=Scene 1, layer=Actions, frame=1:
      Line 6: Left side of assignment operator must be variable or property.
      var percent:Number = Math.round(loadedData/allData=100);

      Total ActionScript Errors: 1 Reported Errors: 1

      Many thanks for any help.