# Well, now I know how to draw dynamically, BUT

**URL:** <https://forum.kirupa.com/t/well-now-i-know-how-to-draw-dynamically-but/27853>\
**Category:** Uncategorized\
**Created:** [August 7, 2003, 7:47am UTC](https://forum.kirupa.com/t/well-now-i-know-how-to-draw-dynamically-but/27853 "2003-08-07T07:47:40Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![supergokito](https://avatars.discourse-cdn.com/v4/letter/s/fbc32d/32.png) [@supergokito](https://forum.kirupa.com/u/supergokito)\
**Post date:** [August 7, 2003, 7:47am UTC](https://forum.kirupa.com/t/well-now-i-know-how-to-draw-dynamically-but/27853/1 "2003-08-07T07:47:40Z")

</div>

How to recognise a shape???

I mean:

Ok most of the drawing apps made with Flash track the mouse and use the lineTo method. We can even track these points/vertex within an array and re-produce the polygon made by the user.

But what if I’d like to draw curves??? 'cause they’re smoother than a couple of lines, right?

The challenge could also be recognising a shape imported from Freehand, Illustrator, or any other drawing application in order to be reproduced by a script.

Any ideas?

Thanks!!!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 7, 2003, 9:33am UTC](https://forum.kirupa.com/t/well-now-i-know-how-to-draw-dynamically-but/27853/2 "2003-08-07T09:33:21Z")

</div>

welcome to the forum

um… use

```auto
curveTo(x,y,anchorX,anchorY);

```

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 7, 2003, 10:44am UTC](https://forum.kirupa.com/t/well-now-i-know-how-to-draw-dynamically-but/27853/3 "2003-08-07T10:44:11Z")

</div>

curveTo is a bit harder to use than lineTo. Robert penner and Lifaros wrote nice functions to draw accurately, see if you can find them on their sites. Otherwise, I’ll try to dig them up 🙂

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 7, 2003, 11:24am UTC](https://forum.kirupa.com/t/well-now-i-know-how-to-draw-dynamically-but/27853/4 "2003-08-07T11:24:29Z")

</div>

This is a different way of using curveTo (made by Robert Penner);

```auto

MovieClip.prototype.curveThrough3Pts = 
function (startX,startY,throughX,throughY,endX,endY){
var controlX = (2*throughX) - .5 * (startX+endX);
var controlY = (2*throughY) - .5 *(startY+endY);
this.moveTo(startX,startY);
this.curveTo(controlX, controlY, endX, endY);
}

```

There, if I didn’t make a typo, that should work.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 7, 2003, 11:30am UTC](https://forum.kirupa.com/t/well-now-i-know-how-to-draw-dynamically-but/27853/5 "2003-08-07T11:30:04Z")

</div>

Thanks guys! But my question is not about drawing curves but about recognising curves.

Two examples:

1. the user holds the button and tries to draw a curve. Is it possible not to append straight lines to simulate that curve?
2. importing a shape into Flash, could I just find out which points and anchors form it??

See you!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 7, 2003, 11:57am UTC](https://forum.kirupa.com/t/well-now-i-know-how-to-draw-dynamically-but/27853/6 "2003-08-07T11:57:16Z")

</div>

1. yes
2. you can import a shape from whereever, export to swf then use this

[http://www.quasimondo.com/shapedecoder/qm\_shape\_decoder.php](http://www.quasimondo.com/shapedecoder/qm_shape_decoder.php)
