class Draw2 extends MovieClip { var isPainting:Boolean; var theBrush:Object; private var mc:MovieClip; public function Draw2 (target:MovieClip, depth:Number) { theBrush = new Object (); mc = target.createEmptyMovieClip ("painting" + depth, depth); trace(mc) theBrush.onMouseDown = function () { this.isPainting = true; trace(target.isPainting); mc.moveTo (_xmouse, _ymouse); mc.lineTo (_xmouse + 1, _ymouse + 1); mc.lineStyle (1, 100, 100); }; theBrush.onMouseMove = function () { if (this.isPainting) { mc.lineTo (_xmouse, _ymouse); } }; theBrush.onMouseUp = function () { trace(mc.isPainting); this.isPainting = false; }; Mouse.addListener (theBrush); } }