# Connecting 2 MCs with a line?

**URL:** <https://forum.kirupa.com/t/connecting-2-mcs-with-a-line/56953>\
**Category:** flash\
**Created:** [July 9, 2004, 3:08am UTC](https://forum.kirupa.com/t/connecting-2-mcs-with-a-line/56953 "2004-07-09T03:08:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![RadioactveChimp](https://avatars.discourse-cdn.com/v4/letter/r/7feea3/32.png) [@RadioactveChimp](https://forum.kirupa.com/u/RadioactveChimp)\
**Post date:** [July 9, 2004, 3:08am UTC](https://forum.kirupa.com/t/connecting-2-mcs-with-a-line/56953/1 "2004-07-09T03:08:09Z")

</div>

I am working on a navigation for my site. I have two movie clips and want a black line to connect the two EX( (MC#1)------------------(MC#2) ). I want the line to stay connected when the MCs move around. Kinda get what i mean? If so, could you hook me up with a tut or some info? Gracias!!!

-Dean :hugegrin:

---

<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:** [July 9, 2004, 3:31am UTC](https://forum.kirupa.com/t/connecting-2-mcs-with-a-line/56953/2 "2004-07-09T03:31:31Z")

</div>

for a better example of what i mean: [http://www.kirupa.com/lab/index.htm](http://www.kirupa.com/lab/index.htm) and go to Flash experiments and look at Random Points…how did Lostinbeta make those lines?

---

<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:** [July 9, 2004, 3:37am UTC](https://forum.kirupa.com/t/connecting-2-mcs-with-a-line/56953/3 "2004-07-09T03:37:25Z")

</div>

here too: [http://www.defide-ix.com/top.html](http://www.defide-ix.com/top.html) those stupid lines that connect all the buttons…i need them lol

---

<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:** [July 9, 2004, 4:04am UTC](https://forum.kirupa.com/t/connecting-2-mcs-with-a-line/56953/4 "2004-07-09T04:04:40Z")

</div>

well i stole some code from Lostinbeta’s experiment:  
if (toggle.high) {  
\_quality = “low”;  
}  
MovieClip.prototype.ranMove = function() {  
this.\_x += (this.newX-this.\_x)/this.speed;  
this.\_y += (this.newY-this.\_y)/this.speed;  
if (Math.round(this.\_y) == Math.round(this.newY) && Math.round(this.\_x) == Math.round(this.newX)) {  
this.newX = Math.round(Math.random()_(415-40)+40);  
this.newY = Math.round(Math.random()_(280-40)+40);  
this.speed = Math.ceil(Math.random()\*(4-2)+2);  
}  
};  
function createClip(name, number) {  
\_root.createEmptyMovieClip(name, number);  
clip = \_root[name];  
clip.attachMovie(“mc”, “mc”+numer, number+1000);  
clip.tab = number;  
clip.onEnterFrame = ranMove;  
}  
maxClips = parseInt(numClips.text)+1;  
for (i=1; i\<maxClips; i++) {  
\_root.createClip(“container”+i, i);  
}  
function lines() {  
for (j=2; j\<maxClips; j++) {  
lineTo(this[“container”+j].\_x, this[“container”+j].\_y);  
}  
}  
function clearClips() {  
for (k=0; k\<maxClips; k++) {  
\_root[“container”+k].removeMovieClip();  
}  
\_root.play();  
}  
function draw() {  
clear();  
lineStyle(1, 0x000000, 100);  
beginFill(0xE6E6E6, 100);  
moveTo(container1.\_x, container1.\_y);  
lines();  
endFill();  
}  
\_root.onEnterFrame = draw;  
stop();

erm, which part do need?

---

<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:** [July 9, 2004, 4:12am UTC](https://forum.kirupa.com/t/connecting-2-mcs-with-a-line/56953/5 "2004-07-09T04:12:11Z")

</div>

look at flash’s help and search for the drawing api, the linestyle function and lineto seem to be what you’re looking for
