# Startpoint drawing api

**URL:** <https://forum.kirupa.com/t/startpoint-drawing-api/186523>\
**Category:** Uncategorized\
**Created:** [April 21, 2006, 10:53pm UTC](https://forum.kirupa.com/t/startpoint-drawing-api/186523 "2006-04-21T22:53:26Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![vintage](https://avatars.discourse-cdn.com/v4/letter/v/e68b1a/32.png) [@vintage](https://forum.kirupa.com/u/vintage)\
**Post date:** [April 21, 2006, 10:53pm UTC](https://forum.kirupa.com/t/startpoint-drawing-api/186523/1 "2006-04-21T22:53:26Z")

</div>

```auto

straal = 100;
draai = Math.PI;
cirkel = _root.createEmptyMovieClip("ronde", 1);
cirkel.lineStyle(30);
onEnterFrame = function () {
 draai += 0.5/10;
 x = preloadCentrum._x+Math.cos(draai)*straal;
 y = preloadCentrum._y+Math.sin(draai)*straal;
 ronde.lineTo(x, y);
};

```

ive tried

```auto
cirkel = _root.createEmptyMovieClip("ronde", 1,{_x:preloadCentrum._x, _y:preloadCentrum._y});

```

And

```auto

cirkel = _root.createEmptyMovieClip("ronde", 1);
circle._x=preloadCentrum._x;
circle._x=preloadCentrum._y;

```

but everything starts on left top…why ? :s

thx for reading (and maybe reply) 8-]

---

<div class="post-metadata">

**Author:** ![flextnet](https://avatars.discourse-cdn.com/v4/letter/f/7ba0ec/32.png) [@flextnet](https://forum.kirupa.com/u/flextnet)\
**Post date:** [April 21, 2006, 11:08pm UTC](https://forum.kirupa.com/t/startpoint-drawing-api/186523/2 "2006-04-21T23:08:41Z")

</div>

What do you expect to see?  
What are the values of preloadCentrum.\_x and preloadCentrum.\_y?

:toad:

---

<div class="post-metadata">

**Author:** ![Stratification](https://avatars.discourse-cdn.com/v4/letter/s/bc8723/32.png) [@Stratification](https://forum.kirupa.com/u/Stratification)\
**Post date:** [April 21, 2006, 11:31pm UTC](https://forum.kirupa.com/t/startpoint-drawing-api/186523/3 "2006-04-21T23:31:05Z")

</div>

You need a moveTo command before the lineTo. moveTo sets the start point.

---

<div class="post-metadata">

**Author:** ![flextnet](https://avatars.discourse-cdn.com/v4/letter/f/7ba0ec/32.png) [@flextnet](https://forum.kirupa.com/u/flextnet)\
**Post date:** [April 21, 2006, 11:35pm UTC](https://forum.kirupa.com/t/startpoint-drawing-api/186523/4 "2006-04-21T23:35:53Z")

</div>

Yup- good catch.

---

<div class="post-metadata">

**Author:** ![vintage](https://avatars.discourse-cdn.com/v4/letter/v/e68b1a/32.png) [@vintage](https://forum.kirupa.com/u/vintage)\
**Post date:** [April 22, 2006, 12:06am UTC](https://forum.kirupa.com/t/startpoint-drawing-api/186523/5 "2006-04-22T00:06:14Z")

</div>

```auto

rad = 100;
draai = Math.PI;
cirkel = _root.createEmptyMovieClip("ronde", 1);
cirkel.lineStyle(30);
ronde.moveTo = preloadCentrum._x;
ronde.moveTo = preloadCentrum._y;
onEnterFrame = function () {
    draai += 0.5/10;
    x = preloadCentrum._x+Math.cos(draai)*rad;
    y = preloadCentrum._y+Math.sin(draai)*rad;
    ronde.lineTo(x, y);
};

```

tried this, but no luck.

what I expect ? a circle drawn though as.

thx for reading

btw, you can just copy paste the code, you dont need anything else but the code, if you do, you see what i mean…

W0ops, you need an empty mc with the instancename “preloadCentrum”

---

<div class="post-metadata">

**Author:** ![flextnet](https://avatars.discourse-cdn.com/v4/letter/f/7ba0ec/32.png) [@flextnet](https://forum.kirupa.com/u/flextnet)\
**Post date:** [April 22, 2006, 12:10am UTC](https://forum.kirupa.com/t/startpoint-drawing-api/186523/6 "2006-04-22T00:10:38Z")

</div>

should be:

ronde.moveTo(preloadCentrum.\_x, preloadCentrum.\_y);

---

<div class="post-metadata">

**Author:** ![vintage](https://avatars.discourse-cdn.com/v4/letter/v/e68b1a/32.png) [@vintage](https://forum.kirupa.com/u/vintage)\
**Post date:** [April 22, 2006, 12:17am UTC](https://forum.kirupa.com/t/startpoint-drawing-api/186523/7 "2006-04-22T00:17:15Z")

</div>

ah darn, thx, its not good yet, but it brings me a little further, now it the line starts to draw from the center from the circle while I like it to start at the edge from the “circle”

fast reply btw 😉

---

<div class="post-metadata">

**Author:** ![TheCanadian](https://avatars.discourse-cdn.com/v4/letter/t/67e7ee/32.png) [@TheCanadian](https://forum.kirupa.com/u/TheCanadian)\
**Post date:** [April 22, 2006, 1:13am UTC](https://forum.kirupa.com/t/startpoint-drawing-api/186523/8 "2006-04-22T01:13:11Z")

</div>

If the drawing position is at the centre of the circle, then all you need to do is add the radius to the current position (or in this case subtract since you start drawing at an angle of pi).

```auto
rad = 100;
draai = Math.PI;
cirkel = _root.createEmptyMovieClip("ronde", 1);
cirkel.lineStyle(30);
ronde.moveTo(preloadCentrum._x - rad, preloadCentrum._y);
onEnterFrame = function () {
 draai += 0.5 / 10;
 x = preloadCentrum._x + Math.cos(draai) * rad;
 y = preloadCentrum._y + Math.sin(draai) * rad;
 ronde.lineTo(x, y);
};

```

---

<div class="post-metadata">

**Author:** ![vintage](https://avatars.discourse-cdn.com/v4/letter/v/e68b1a/32.png) [@vintage](https://forum.kirupa.com/u/vintage)\
**Post date:** [April 22, 2006, 10:09am UTC](https://forum.kirupa.com/t/startpoint-drawing-api/186523/9 "2006-04-22T10:09:35Z")

</div>

works fine now, thank you all !
