Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Traced from the movement of a clip

Explorer ,
Oct 04, 2020 Oct 04, 2020

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.

227
Translate
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

And what Adobe program are you asking about?

Translate
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

It's Animate.

Translate
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

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.

Translate
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
LATEST

I moved your post to a better forum,

Translate
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