Skip to main content
Inspiring
October 4, 2020
Question

Traced from the movement of a clip

  • October 4, 2020
  • 3 replies
  • 255 views

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.

    This topic has been closed for replies.

    3 replies

    Just Shoot Me
    Legend
    October 4, 2020

    I moved your post to a better forum,

    Just Shoot Me
    Legend
    October 4, 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.

    Just Shoot Me
    Legend
    October 4, 2020

    And what Adobe program are you asking about?

    Inspiring
    October 4, 2020

    It's Animate.