Copy link to clipboard
Copied
Hello,
As a beginner in HTML5, I want to draw a line from the movement of a circle. I tried the following code that doesn't work. Can you please tell me where my error is?
this.circle.addEventListener("mousedown", fctFrt.bind(this));
function fctFrt(evt){
var pm = this.globalToLocal(evt.stageX, evt.stageY);
differenceX = (this.circle.x - pm.x);
differenceY = (this.circle.y - pm.y);
};
this.circle.on("pressmove", fctFrt39.bind(this));
function fctFrt39(evt){
var pm = this.globalToLocal(evt.stageX, evt.stageY);
this.circle.x = (pm.x + differenceX);
this.circle.y = (pm.y + differenceY);
var g = new createjs.Graphics() ;
stage.addChild(g) ;
g.setStrokeStyle(1);
g.beginStroke("#000000");
g.beginFill("red");
g.moveTo(this.circle.x , this.circle.y);
g.lineTo (this.circle.x,this.circle.y);
stage.update() ;
};
Thank you in advance for any answer.
Copy link to clipboard
Copied
And what Adobe program are you asking about?
Copy link to clipboard
Copied
It's Animate.
Copy link to clipboard
Copied
I moved your post over from the poorly named "Using the Community" forum, which is for getting help using this forum system, to a better forum.
I hope this helps. Best of luck to you.
Copy link to clipboard
Copied
I moved your post to a better forum,