# Drawing/deleting on multiple dynamic clips

**URL:** <https://forum.kirupa.com/t/drawing-deleting-on-multiple-dynamic-clips/196583>\
**Category:** Uncategorized\
**Created:** [August 9, 2006, 4:12pm UTC](https://forum.kirupa.com/t/drawing-deleting-on-multiple-dynamic-clips/196583 "2006-08-09T16:12:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sparky\_J](https://avatars.discourse-cdn.com/v4/letter/s/aeb1de/32.png) [@Sparky\_J](https://forum.kirupa.com/u/Sparky_J)\
**Post date:** [August 9, 2006, 4:12pm UTC](https://forum.kirupa.com/t/drawing-deleting-on-multiple-dynamic-clips/196583/1 "2006-08-09T16:12:12Z")

</div>

Hello,  
I slightly modified the drawing tutorial and would like the user to be able to erase just the last line they drew. The code is posted below. I’m tracing the clip name at the time I want to clear() and it all appears to be correct but it isn’t clearing. Hopefully somebody can see the problem. It has to be something simple.

```auto

i = -1;
lineColor = 0xFF0000;

_root.onMouseDown = function(){
	if (_ymouse >= 385) {
		trace("blah i = "+i);
	} else {
		i += 1;
		_global.canvas_var = this.createEmptyMovieClip("line"+i,i);
		canvas_var.moveTo(_xmouse,_ymouse);
	canvas_var.lineStyle(1,lineColor,100);
	trace("current"+canvas_var);
	this.onEnterFrame = function(){
		canvas_var.lineTo(_xmouse,_ymouse);
	}
}
}
_root.onMouseUp = function(){
	this.onEnterFrame = null;
}

buttonErase.onRelease = function(){
	trace(_global.canvas_var)
	_global.canvasVar.clear();
}

```
