Sammo #3 - Trace Me

“Something I made earlier!”

Only recoded for the contest rules.

Simply draw a line and then press enter.

Stage.scaleMode = "noScale";//1
defaultVars = [_root.createEmptyMovieClip("line", 1).lineStyle(2, 0x000000, 100), _root.createEmptyMovieClip("pcLine", 2).lineStyle(2, 0x007037, 100), mX = [], mY = [], i = k = completed = 0]; //2
_root.onEnterFrame = function() {
	_root.onMouseDown = function() {
		if (!completed) { //3
			line.moveTo(_xmouse, _ymouse); //4
			_root.onMouseMove = function() {
				mY* = _ymouse;//5
				mX* = _xmouse;//6
				i++;//7
				line.lineTo(_xmouse, _ymouse);//8
			}
		}
	}
	if (Key.isDown(Key.ENTER) && completed) {//9
		pcLine.moveTo(mX[0], mY[0]);//10
		line.clear();//11
		_root.onEnterFrame = function() {
			if (_root.k < mY.length) {//12
				pcLine.lineTo(mX[_root.k], mY[_root.k]);//13
				dot._x = mX[_root.k], dot._y = mY[_root.k];//14 15
				_root.k++;//16
			}
		}
	}
}
_root.onMouseUp = function() {
	this.onMouseMove = null;//17
	completed = true;//18
}
MovieClip.prototype.drawCircle = function(x, y) {
	this.beginFill(0x007037, 50);//19
	this._x = x, this._y = y;//20 21
	for (j = 0; j <= (Math.PI*2); j += (Math.PI*2) / 360) {//22
		this.lineTo(10 * Math.cos(j), 10 * Math.sin(j));//23
		this.lineTo(10 * Math.cos(j + Math.PI / 360), 10 * Math.sin(j + Math.PI / 360));//24
	}
}
_root.createEmptyMovieClip("dot",1000).drawCircle(-20000,-20000)//25