@Colin Holgate
thank you for your reply
But I try to draw the line with the movement of the hand, it is like drawing
var s = new createjs.Shape();
this.addChild(s);
var g = s.graphics;
styleF();
var startF = start.bind(this);
var drawF = draw.bind(this);
var stopF= stop.bind(this);
var initDrawF = initDraw.bind(this);
// b is the instance name of the white drawing utensil
this.b.addEventListener("click", initWhiteDrawF);
// c is the instance name of the clear button.
this.c.addEventListener("click", clear.bind(this));
function initWhiteDraw() {
whiteStyleF();
this.b.removeEventListener("click", initDrawF);
stage.addEventListener("stagemousedown",startF);
}
function start() {
stage.removeEventListener("stagemousedown",startF);
stage.addEventListener("stagemousemove",drawF);
stage.addEventListener("stagemouseup",stopF);
g.moveTo(stage.mouseX,stage.mouseY);
}
function draw(){
g.lineTo(stage.mouseX,stage.mouseY)
}
function stop() {
stage.removeEventListener("stagemousemove",drawF);
stage.removeEventListener("stagemouseup",stopF);
this.b.addEventListener("click", initDrawF);
}
function clear() {
g.clear();
}
function whiteStyleF(){
g.setStrokeStyle(1);
g.beginStroke("#ffffff");
}