Traced from the movement of a clip

Explorer ,
Oct 04, 2020 Oct 04, 2020

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.

Views

131

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 04, 2020 Oct 04, 2020

Copy link to clipboard

Copied

And what Adobe program are you asking about?

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 04, 2020 Oct 04, 2020

Copy link to clipboard

Copied

It's Animate.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 04, 2020 Oct 04, 2020

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.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 04, 2020 Oct 04, 2020

Copy link to clipboard

Copied

LATEST

I moved your post to a better forum,

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines