# Playing with balls and lines :)

**URL:** https://forum.kirupa.com/t/playing-with-balls-and-lines/294041
**Category:** Uncategorized
**Created:** [August 7, 2009, 12:06pm UTC](https://forum.kirupa.com/t/playing-with-balls-and-lines/294041 "2009-08-07T12:06:23Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![fenix\_](https://avatars.discourse-cdn.com/v4/letter/f/71e660/32.png) [@fenix\_](https://forum.kirupa.com/u/fenix_)
#### Post date: [August 7, 2009, 12:06pm UTC](https://forum.kirupa.com/t/playing-with-balls-and-lines/294041/1 "2009-08-07T12:06:23Z")

</div>

hi to all

for the first time, i’m trying to use dinamically created lines with as3

this is the project i’m working on  
[http://dev.globaz.pt/subliopus/stage.html](http://dev.globaz.pt/subliopus/stage.html)

the main ideia was for the balls to be linked bu the lines, and when a ball moves, the lines should move accordingly to its movement. it’s already working almost as i want it to, but still, as you can see, usually, the lines move even with the balls stopped.  
for this action i have the following code inside an enterFrame event  
[AS]  
for (var i:Number=0; i\<mainMenu\_mc.lines\_mc.numChildren; i++) {  
MovieClip(mainMenu\_mc.lines\_mc.getChildAt(i)).graphics.clear();  
MovieClip(mainMenu\_mc.lines\_mc.getChildAt(i)).graphics.lineStyle(1,0x000000,1,true);  
MovieClip(mainMenu\_mc.lines\_mc.getChildAt(i)).graphics.moveTo(mainMenu\_mc.ballsIn\_mc.getChildAt(MovieClip(mainMenu\_mc.lines\_mc.getChildAt(i)).initRef).x,mainMenu\_mc.ballsIn\_mc.getChildAt(MovieClip(mainMenu\_mc.lines\_mc.getChildAt(i)).initRef).y);  
MovieClip(mainMenu\_mc.lines\_mc.getChildAt(i)).graphics.lineTo(mainMenu\_mc.ballsIn\_mc.getChildAt(MovieClip(mainMenu\_mc.lines\_mc.getChildAt(i)).endRef).x,mainMenu\_mc.ballsIn\_mc.getChildAt(MovieClip(mainMenu\_mc.lines\_mc.getChildAt(i)).endRef).y);

```
    }

```

[/AS]

as you can see, i use the x and y from the balls to redraw each line therefore, that “strange line movement” shouldn’t happen. Can someone give a hint on this?

another thing,  
is there a way to make my lines smoother? i’m already switching pixelHinting to true…  
i tried another thing that almost worked. i used a blur, but the lines got to much thick.

thanks for all the help
