# Dynamic Line Drawing from object locations

**URL:** https://forum.kirupa.com/t/dynamic-line-drawing-from-object-locations/311252
**Category:** flash
**Created:** [July 1, 2010, 8:56am UTC](https://forum.kirupa.com/t/dynamic-line-drawing-from-object-locations/311252 "2010-07-01T08:56:03Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![xhippy](https://avatars.discourse-cdn.com/v4/letter/x/ecae2f/32.png) [@xhippy](https://forum.kirupa.com/u/xhippy)
#### Post date: [July 1, 2010, 8:56am UTC](https://forum.kirupa.com/t/dynamic-line-drawing-from-object-locations/311252/1 "2010-07-01T08:56:03Z")

</div>

First post here, sorry if its been covered before;)

I’m creating a flash based dynamic electrical circuit board and have come across a problem. I have a function that is a fired from ENTER\_FRAME event that loops though an array where each element contains the following:

‘#parentObject1#ChildObject1#parentObject2#ChildObject2#Colour’

To Clarify - A line should be drawn from ChildObject1 to ChildObject2 in the saved colour. The above is a string. I slice at each ‘#’, which is working. Each object gets added through my created toolbox so added dynamically.

I can get the DisplayOBject of the parents by using - var obj1:displayObject = getChildByName(sliced[1]);

But cannot do the same for the Child object by - var subobj1:displayObject = obj1.getChildByName(sliced[2]);

The reason for this is that each parent can be dragged so I would like the drawn line to move with the children.

Any ideas on how to find the child objects or thoughts on a better implementation would be great
