# Drawing API problem

**URL:** https://forum.kirupa.com/t/drawing-api-problem/163372
**Category:** flash
**Created:** [September 21, 2005, 11:07pm UTC](https://forum.kirupa.com/t/drawing-api-problem/163372 "2005-09-21T23:07:34Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![CayoHueso](https://avatars.discourse-cdn.com/v4/letter/c/8e8cbc/32.png) [@CayoHueso](https://forum.kirupa.com/u/CayoHueso)
#### Post date: [September 21, 2005, 11:07pm UTC](https://forum.kirupa.com/t/drawing-api-problem/163372/1 "2005-09-21T23:07:34Z")

</div>

Hi everybody,

I need to draw a line that would be in one of the extremes fixed to permanent coordinates, while the other extreme will vary according to another Movieclip’s position. I think I could do that with Drawing API, but I haven’t been able to find out how. Below is the code that I have created. In it, when I drag the second movieclip, the API keeps drawing lines; but I want to have one line changing the lenght and coordinates or the extreme tide to the second mc.

Can anyone help me?  
Thanks a lot.

```auto

this.createEmptyMovieClip("dada_mc", this.getNextHighestDepth());
dada_mc.lineStyle(0, 0xFF0000, 100);
this.onEnterFrame = function() {
	dada_mc.lineTo(caca_mc._x, caca_mc._y);
};
caca_mc.onPress = function() {
	startDrag(this);
};
caca_mc.onRelease = function() {
	stopDrag();
};

```
