Drawing a dynamic curve between two points in javascript
I have an animation of a dog walker and I want to have a dynamic curved line as the leash. So no matter how far the dog moves from the walker, the curved leash is being drawn and updated between them.
In AS3, I did it like this:
leash.graphics.clear();
//define curve
leashcurve = 214 + Math.abs(200 - Math.abs(dog.x - walker.x));
leash.graphics.lineStyle(3, 0xAF2525);
//set start point
leash.graphics.moveTo(leashhandx,leashhandy);
//draw curve
leash.graphics.curveTo(leashhandx,leashcurve,leashdogx,leashdogy)
Can I do something similar in javascript? I'm having trouble figuring out the syntax.

