# De-activate Drawing function

**URL:** https://forum.kirupa.com/t/de-activate-drawing-function/196265
**Category:** flash
**Created:** [August 7, 2006, 8:15am UTC](https://forum.kirupa.com/t/de-activate-drawing-function/196265 "2006-08-07T08:15:27Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![gabydog](https://avatars.discourse-cdn.com/v4/letter/g/919ad9/32.png) [@gabydog](https://forum.kirupa.com/u/gabydog)
#### Post date: [August 7, 2006, 8:15am UTC](https://forum.kirupa.com/t/de-activate-drawing-function/196265/1 "2006-08-07T08:15:27Z")

</div>

I have used the following code to create a drawing facility on my site, what code would I use to de-activate this? Thanks…

var pts:Array;  
var holder:MovieClip;  
var isEditing:Boolean = false;  
var mouseListener:Object = new Object();  
mouseListener.onMouseDown = function() {  
var dep:Number = \_root.getNextHighestDepth();  
holder = \_root.createEmptyMovieClip(“holder”+dep, dep);  
pts = new Array();  
isEditing = true;  
pts.push([\_root.cursernew.\_x, \_root.cursernew.\_y]);  
holder.lineStyle(1, 0xcccccc);  
holder.moveTo(\_root.cursernew.\_x, \_root.cursernew.\_y);  
};  
mouseListener.onMouseUp = function() {  
isEditing = false;  
smooth();  
holder.onEnterFrame = function() {  
this.\_alpha -= 0.2;  
this.\_alpha\<=0 ? [delete this.onEnterFrame, this.removeMovieClip()] : null;  
};  
};  
mMove = function () {  
cursernew.\_x = \_root.\_xmouse;  
cursernew.\_y = \_root.\_ymouse;  
updateAfterEvent();  
if (!isEditing) {  
return;  
}  
pts.push([\_root.cursernew.\_x, \_root.cursernew.\_y]);  
smooth();  
};  
function smooth() {  
if (!pts) {  
return;  
}  
var i = pts.length-1;  
if (i\<1) {  
return;  
}  
var ptx = pts\*[0];  
var pty = pts\*[1];  
var ancx = pts[i-1][0];  
var ancy = pts[i-1][1];  
ptx += ancx;  
pty += ancy;  
holder.curveTo(ancx, ancy, ptx/2, pty/2);  
}
