# Dynamic lines

**URL:** https://forum.kirupa.com/t/dynamic-lines/5755
**Category:** Uncategorized
**Created:** [September 20, 2002, 9:54pm UTC](https://forum.kirupa.com/t/dynamic-lines/5755 "2002-09-20T21:54:42Z")
**Posts on this page:** 19
**Page:** 1

<div class="post-metadata">

### Author: ![eilsoe](https://avatars.discourse-cdn.com/v4/letter/e/9fc348/32.png) [@eilsoe](https://forum.kirupa.com/u/eilsoe)
#### Post date: [September 20, 2002, 9:54pm UTC](https://forum.kirupa.com/t/dynamic-lines/5755/1 "2002-09-20T21:54:42Z")

</div>

is it possible to dynammically create a line between two moving objects? so the start and end points of the line is attached to two objects?

---

<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: [September 20, 2002, 10:00pm UTC](https://forum.kirupa.com/t/dynamic-lines/5755/2 "2002-09-20T22:00:55Z")

</div>

Yep. You can check the drawing API tute in the AS tricks, and the drawing board tute.

pom :asian:

---

<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: [September 20, 2002, 10:02pm UTC](https://forum.kirupa.com/t/dynamic-lines/5755/3 "2002-09-20T22:02:53Z")

</div>

ah gerat, i’ll look into it…

I’m making sort of a random draw thingy… points a er moving as they were intended, I just thought It’d be fun to makes some lines too! 🙂

I’ll post it when it’s done… just a fun evening project… 🙂

---

<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: [September 20, 2002, 10:26pm UTC](https://forum.kirupa.com/t/dynamic-lines/5755/4 "2002-09-20T22:26:03Z")

</div>

Oki, I can draw the lines now…

but I want it to only draw ONE line per frame… it keeps copying it… I can’t get the clear thing to work properly! It erases the whole thing and nothing shows 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: [September 20, 2002, 10:28pm UTC](https://forum.kirupa.com/t/dynamic-lines/5755/5 "2002-09-20T22:28:00Z")

</div>

Oki now I got it to erase… but NOW the line blinks 'cuz of fps…

What do I do?

I want it to present ONE single line, no blinking…

And that line has to be able to move between objects…

---

<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: [September 20, 2002, 10:45pm UTC](https://forum.kirupa.com/t/dynamic-lines/5755/6 "2002-09-20T22:45:33Z")

</div>

It’s impossible (at least for me) to answer your questions if you don’t post the code, Eilsoe. Or the fla. 🙂

---

<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: [September 20, 2002, 10:50pm UTC](https://forum.kirupa.com/t/dynamic-lines/5755/7 "2002-09-20T22:50:31Z")

</div>

here’s my fla:

```
    [testlines.fla](http://www.avalon-rev.dk/test/testlines.fla) 

```

U can see it keeps making lines… that’s not what i’m after… but since I learned about these lines 20 minutes ago, I think it’s only fair I ask questions about it! 😛

---

<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: [September 20, 2002, 11:32pm UTC](https://forum.kirupa.com/t/dynamic-lines/5755/8 "2002-09-20T23:32:04Z")

</div>

Well you can have it as 2 frames.

First frame containing the actions…  
i++;  
\_root.createEmptyMovieClip(“test”, 1);  
test.lineStyle(1, 0x000000, 100);  
test.moveTo(i, i);  
test.lineTo(\_root.\_xmouse, \_root.\_ymouse);

and the second frame containing the actions…  
gotoAndPlay(1);

This worked for me, but I don’t know if it is exactly what you wanted it to do.

---

<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: [September 20, 2002, 11:36pm UTC](https://forum.kirupa.com/t/dynamic-lines/5755/9 "2002-09-20T23:36:07Z")

</div>

well… with this method, the line also blinks… I set the fps to 30 just to speed things up.

This CAN be used, i mean, i can just set the lineto and moveto, to the xy of my moving objects, but the line still blinks every time the movie changes frame#!

can you follow me…?

---

<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: [September 20, 2002, 11:37pm UTC](https://forum.kirupa.com/t/dynamic-lines/5755/10 "2002-09-20T23:37:38Z")

</div>

well whaddya know…

all of a sudden it stopped blinking… I didn’t even change anything…

scary… :-\

---

<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: [September 20, 2002, 11:59pm UTC](https://forum.kirupa.com/t/dynamic-lines/5755/11 "2002-09-20T23:59:07Z")

</div>

here it is guys!

It worked…! My first experiment with lines! 😛

I’m so proud of myself… 🙂

here: [lines exp](http://www.avalon-rev.dk/lines/lines.html)

---

<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: [September 21, 2002, 4:48pm UTC](https://forum.kirupa.com/t/dynamic-lines/5755/12 "2002-09-21T16:48:04Z")

</div>

Nice 🙂 But change that background color, please… 😛

---

<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: [September 21, 2002, 9:34pm UTC](https://forum.kirupa.com/t/dynamic-lines/5755/13 "2002-09-21T21:34:56Z")

</div>

okeeey, try it again now! 😛

Better??

---

<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: [September 21, 2002, 9:44pm UTC](https://forum.kirupa.com/t/dynamic-lines/5755/14 "2002-09-21T21:44:30Z")

</div>

Hey, that’s actually very good! Give it a little bit of colour, make it less than 25 lines and I think you can post this at Bit-101 without having to blush, Eilsoe 🙂

pom :asian:

---

<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: [September 21, 2002, 10:55pm UTC](https://forum.kirupa.com/t/dynamic-lines/5755/15 "2002-09-21T22:55:57Z")

</div>

coool! 😛

Whaddya mean “less than 25 lines” …? Code? or “lines” directly…?

what colors…? The fills??

---

<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: [September 21, 2002, 10:57pm UTC](https://forum.kirupa.com/t/dynamic-lines/5755/16 "2002-09-21T22:57:13Z")

</div>

Lines of code, yes. And yeah, you could put a fill there, don’t you think?

---

<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: [September 21, 2002, 11:00pm UTC](https://forum.kirupa.com/t/dynamic-lines/5755/17 "2002-09-21T23:00:25Z")

</div>

well there IS a fill! 🙂

tha 50% alpha blue… but yeah, this could get cramped down to less than 25 lines… easily…

then I suspect having to loose the pic in back too… since he states “nothing in the library”…

everything else is pure AS… so… no biggie… 😛

---

<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: [September 21, 2002, 11:03pm UTC](https://forum.kirupa.com/t/dynamic-lines/5755/18 "2002-09-21T23:03:27Z")

</div>

??? The one I saw before had no fill, no background… I have to get some sleep.

---

<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: [September 21, 2002, 11:06pm UTC](https://forum.kirupa.com/t/dynamic-lines/5755/19 "2002-09-21T23:06:14Z")

</div>

well ok, but the one above DOES have a fill, and a pic of some greenish little troll thingy… try deleting your temp internet files and check again… otherwise, I’ll post the fla for u, then u can see it! :evil:

I’ll redo the code tomorrow.

I gotta get to bed now… girlfriends calling me! 😛

C’ya!
