Reset graphics
Hi, I would like to know how to reset a graphic by maintaining the current position of my animated movie clip which is attached to the line. I only want the lines to be removed. But I don't know why it doesn't work. When i clicked on the reset button, the animated MC just followed and moved to the reset button. Oh and after i reset it, I want it to be able to draw lines again. And i tried the removing and re-adding the eventListener but i don't really know how to make it more dynamic. I'm confused.I really need help. Thanks
Here's my code:
import fl.transitions.Tween;
import fl.transitions.easing.*;
import fl.transitions.TweenEvent;
var reset = true;
btnReset.addEventListener(MouseEvent.CLICK,doReset);
function doReset (e) {
if (reset==true) {
myMc.graphics.clear();
myMc.graphics.lineStyle(2, 0xff6644, .75);
myMc.graphics.moveTo(myPencil.x, myPencil.y);
}
}
myMc.graphics.lineStyle(2, 0xff6644, .75);
myMc.graphics.moveTo(myPencil.x, myPencil.y);
function doDraw (e) {
myMc.graphics.lineTo(myPencil.x, myPencil.y);
}
function startDraw (e) {
var myTween:Tween = new Tween(myPencil, "x", Regular.easeOut, myPencil.x, mouseX, 1, true);
var myTween2:Tween = new Tween(myPencil, "y", Regular.easeOut, myPencil.y, mouseY, 1, true);
myTween2.addEventListener(TweenEvent.MOTION_CHANGE, doDraw);
}
stage.addEventListener(MouseEvent.CLICK, startDraw);
