# Creating Connected Lines tutorial questions

**URL:** https://forum.kirupa.com/t/creating-connected-lines-tutorial-questions/213106
**Category:** open source
**Created:** [January 16, 2007, 11:56pm UTC](https://forum.kirupa.com/t/creating-connected-lines-tutorial-questions/213106 "2007-01-16T23:56:26Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![little\_MASTER1](https://avatars.discourse-cdn.com/v4/letter/l/3ab097/32.png) [@little\_MASTER1](https://forum.kirupa.com/u/little_MASTER1)
#### Post date: [January 16, 2007, 11:56pm UTC](https://forum.kirupa.com/t/creating-connected-lines-tutorial-questions/213106/1 "2007-01-16T23:56:26Z")

</div>

Hi all 😃  
I was looking threw your tutorials and I found [\>\>this one\<\<](http://www.kirupa.com/developer/actionscript/connectedLines.htm)

I’ve modified a little it and now I have this:

```auto
function init() {
	for (var i:Number = 0; i<4; i++) {
		this.attachMovie("blueCircle", "blue"+i, this.getNextHighestDepth());
		var mc:MovieClip = this["blue"+i];
		mc._x = Math.round(Math.random(100)*300+100);
		mc._y = Math.round(Math.random(100)*300+100);
		mc.onPress = function() {
			this.startDrag();
		};
		mc.onRelease = function() {
			this.stopDrag();
		};
	}
	this.createEmptyMovieClip("line", -1);
	drawLine();
	this.onMouseMove = function() {
		drawLine();
	};
}
init();
//
function drawLine() {
	line.clear();
	line.lineStyle(5, 0xBFD7EE);
	//1->2
	line.moveTo(blue0._x, blue0._y);
	line.lineTo(blue1._x, blue1._y);
	//1->3
	line.moveTo(blue0._x, blue0._y);
	line.lineTo(blue2._x, blue2._y);
	//1->4
	line.moveTo(blue0._x, blue0._y);
	line.lineTo(blue3._x, blue3._y);
	//2->3
	line.moveTo(blue1._x, blue1._y);
	line.lineTo(blue2._x, blue2._y);
	//2->4
	line.moveTo(blue1._x, blue1._y);
	line.lineTo(blue3._x, blue3._y);
	//3->4
	line.moveTo(blue2._x, blue2._y);
	line.lineTo(blue3._x, blue3._y);
	//
	updateAfterEvent();
}

```

It works ok, but I want to do a game from it-polimorphic graphs (I’m not sure if I wrote it correctly)

Game it in the end of that movie: [http://video.google.pl/videoplay?docid=6379146923853181774&q=multitouch+screen](http://video.google.pl/videoplay?docid=6379146923853181774&q=multitouch+screen)

I want to do something like that in flash.

I don’t have any ideas how to check for lines collisions (if one line is on other)  
Any help??

Please…
