1 Reply Latest reply on Jul 24, 2009 7:47 AM by riceroman3

    Curved Line Part II

    riceroman3

      I thought I understood how to draw a curve at run time by drawing to the average but still having trouble;  here's what I have WHERE DID I GO WRONG? Thanks

       

      this.createEmptyMovieClip("canvas_mc", this.getNextHighestDepth());
      var mouseListener:Object = new Object();
      mouseListener.onMouseDown = function() {
          this.isDrawing = true;
          this.new_x = this._xmouse + last._xmouse / 2;
      this.new_y = this._ymouse + last._ymouse / 2;
      this.orig_x = _xmouse;
      this.orig_y = _ymouse;
          this.target_mc = canvas_mc.createEmptyMovieClip("", canvas_mc.getNextHighestDepth());
      };
      mouseListener.onMouseMove = function() {
          if (this.isDrawing) {
              this.target_mc.clear();
              this.target_mc.lineStyle(1, 0xFF0000, 100);
              this.target_mc.moveTo(this.orig_x, this.orig_y);
              this.target_mc.lineTo(this.new_x, this.new_y);
          }
          updateAfterEvent();
      };
      mouseListener.onMouseUp = function() {
          this.isDrawing = false;
      };
      Mouse.addListener(mouseListener);