# Draw Line between different shapes

**URL:** <https://forum.kirupa.com/t/draw-line-between-different-shapes/235987>\
**Category:** flash\
**Created:** [August 16, 2007, 8:59am UTC](https://forum.kirupa.com/t/draw-line-between-different-shapes/235987 "2007-08-16T08:59:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Niks](https://avatars.discourse-cdn.com/v4/letter/n/e19b73/32.png) [@Niks](https://forum.kirupa.com/u/Niks)\
**Post date:** [August 16, 2007, 8:59am UTC](https://forum.kirupa.com/t/draw-line-between-different-shapes/235987/1 "2007-08-16T08:59:47Z")

</div>

Hi ther,

i have created array of rectangles using

var myUIComponent:UIComponent = new UIComponent();  
//var roundRect:Sprite = new Sprite();  
myUIComponent.graphics.beginFill(0xFF8800);  
myUIComponent.graphics.drawRoundRect(X,  
Y,  
150,  
75,  
50,  
50);  
myUIComponent.graphics.endFill();

in mxml my code is like

for (i = 1; i \<= 2; i++)  
{  
X = 10;  
for(j=1;j\<=5;j++)  
{  
var rectsprit:UIComponent = rect.drawRect(X,Y);  
[//this.rawChildren.addChild](https://this.rawChildren.addChild)(rectsprit);  
panel.addChild(rectsprit);  
[//this.addChild](https://this.addChild)(rectsprit);  
X = (160_j) + 10;  
}  
Y = (85_i) + 10;  
}

Now i need to draw line between these shapes. i mean when i click to point and then drag and draw a line to other rectangle.

Pls help me out

Thanks in advance
