Rotating a movieclip with javascript - pressmove method
Hi, I'm working on a project in Adobe Animate CC, it's an HTML Canvas project which I'm coding in javascript. I'm not a coder - so I'm moving in small steps - but I'd like to rotate a movieclip by clicking and dragging the mouse over said movieclip. I've found some code which helped me to rotate the clip, however it rotates it once then stops (and I'd like it to gradually rotate, not just jump to a new rotation).
The code I'm currently using looks like this (my movieclip is named 'leftyoke'):
var angleInRadians = Math.atan2(stage.mouseY - this.leftyoke.y, stage.mouseX - this.leftyoke.x);
var angleInDegrees = angleInRadians * (180 / Math.PI);
this.leftyoke.addEventListener("pressmove", spin.bind(this));
function spin(evt){
this.leftyoke.rotation = angleInDegrees;
}
This works to rotate the movieclip, however as I said it only rotates to one static position and it jumps to that position. Any help on how to edit this so that the movieclip gradually rotates around would be much appreciated. I'd like it to work like this: Edit fiddle - JSFiddle This link has code in it, however I haven't been successful at arranging that code to work inside of Animate.
Thanks!
