# Pencil going underneath...please help

**URL:** <https://forum.kirupa.com/t/pencil-going-underneath-please-help/220500>\
**Category:** flash\
**Created:** [March 26, 2007, 10:56pm UTC](https://forum.kirupa.com/t/pencil-going-underneath-please-help/220500 "2007-03-26T22:56:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![wispas](https://avatars.discourse-cdn.com/v4/letter/w/9de0a6/32.png) [@wispas](https://forum.kirupa.com/u/wispas)\
**Post date:** [March 26, 2007, 10:56pm UTC](https://forum.kirupa.com/t/pencil-going-underneath-please-help/220500/1 "2007-03-26T22:56:11Z")

</div>

can someone help me out. my pencil is going underneath and I cannot figure out what is wrong. please help - see attached file. thanks is advance.

i have a pencil mc with the instance name pencil

here is my code:

var mouseListener:Object = new Object();  
mouseListener.onMouseDown = function() {  
your\_lines.lineStyle(lineThickness, selectedColor);  
your\_lines.moveTo(\_xmouse, \_ymouse);  
Drawing\_in\_progress = true;  
};  
mouseListener.onMouseUp = function() {  
Drawing\_in\_progress = false;  
};  
Mouse.addListener(mouseListener);  
mouseListener.onMouseMove = function() {  
Mouse.hide();  
pencil.\_x = \_xmouse;  
pencil.\_y = \_ymouse;  
if (Drawing\_in\_progress == true) {  
your\_lines.lineTo(\_xmouse, \_ymouse);  
updateAfterEvent();  
}  
};  
this.createEmptyMovieClip(“your\_lines”, 100);  
var Drawing\_in\_progress:Boolean = false;  
lineThickness = 5;  
selectedColor = “0x000000”;

line0.onPress = function() {  
lineThickness = 0;  
};  
line3.onPress = function() {  
lineThickness = 3;  
};  
line6.onPress = function() {  
lineThickness = 6;  
};  
line9.onPress = function() {  
lineThickness = 9;  
};  
line12.onPress = function() {  
lineThickness = 12;  
};  
colorRed.onPress = function() {  
selectedColor = “0xFF0000”;  
};  
colorGreen.onPress = function() {  
selectedColor = “0x00FF00”;  
};  
colorOrange.onPress = function() {  
selectedColor = “0xff9900”;  
};  
colorBlue.onPress = function() {  
selectedColor = “0x00FFFF”;  
};  
colorYellow.onPress = function() {  
selectedColor = “0xFFFF00”;  
};  
colorDblue.onPress = function() {  
selectedColor = “0x0000FF”;  
};  
colorPink.onPress = function() {  
selectedColor = “0xFF00FF”;  
};  
colorPurple.onPress = function() {  
selectedColor = “0x6633CC”;  
};  
colorBlack.onPress = function() {  
selectedColor = “0x000000”;  
};
