5 Replies Latest reply on Apr 12, 2007 12:31 PM by kglad

    Function w/ onEnterFrame KILLING movie!! HELP!!

    mmaler
      I am under the gun here and I cant figure out why this function is causing the movie's performance to come to a crawl!

      Any ideas??

      MovieClip.prototype.FPM_ZoomMovement = function(ZoomState)
      {
      if (this._xscale != FPM_TargetScale)
      {
      this.onEnterFrame = function()
      {
      FPM_CurrentVScale = (Number(FPM_CurrentVScale) + Number((FPM_TargetScale - FPM_CurrentScale) * 1 / FPM_Acceleration)) / FPM_Bounce;

      FPM_CurrentScale = Number(FPM_CurrentScale) + Number(FPM_CurrentVScale);

      setProperty(this, _xscale, FPM_CurrentScale);

      setProperty(this, _yscale, FPM_CurrentScale);

      FPM_CurrentVX = (Number(FPM_CurrentVX) + Number((FPM_TargetX - FPM_CurrentX) * 1 / FPM_Acceleration)) / FPM_Bounce;

      FPM_CurrentVY = (Number(FPM_CurrentVY) + Number((FPM_TargetY - FPM_CurrentY)* 1 / FPM_Acceleration)) / FPM_Bounce;

      FPM_CurrentX = Number(FPM_CurrentX) + Number(FPM_CurrentVX);

      FPM_CurrentY = Number(FPM_CurrentY)+Number(FPM_CurrentVY);

      setProperty(this, _x, FPM_CurrentX);

      setProperty(this, _y, FPM_CurrentY);

      if (ZoomState == 0)
      {
      if (this._xscale > FPM_TargetScale)
      {
      delete this.onEnterFrame;
      }
      }
      else if (ZoomState == 1)
      {
      if (this._xscale < FPM_TargetScale)
      {
      delete this.onEnterFrame;
      }
      }

      };
      }

      }


      Thanks in advance!