# Hey 2all any idea on this

**URL:** <https://forum.kirupa.com/t/hey-2all-any-idea-on-this/17685>\
**Category:** flash\
**Created:** [April 8, 2003, 7:53am UTC](https://forum.kirupa.com/t/hey-2all-any-idea-on-this/17685 "2003-04-08T07:53:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![deamothul](https://avatars.discourse-cdn.com/v4/letter/d/e9a140/32.png) [@deamothul](https://forum.kirupa.com/u/deamothul)\
**Post date:** [April 8, 2003, 7:53am UTC](https://forum.kirupa.com/t/hey-2all-any-idea-on-this/17685/1 "2003-04-08T07:53:10Z")

</div>

Hail 2 all scripters,:evil:

suppose you have

point A(x,y)  
and  
point B(x,y)

And you have a line between those points.  
How do i make point a and b move across stage while the line keeps in between the two points.  
:hangover: :crazy:

Greetz 2 all from  
Deamothul - the script keeper - 👽

---

<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:** [April 8, 2003, 8:25am UTC](https://forum.kirupa.com/t/hey-2all-any-idea-on-this/17685/2 "2003-04-08T08:25:29Z")

</div>

```auto
MovieClip.prototype.square = function(r) {
	this.beginFill(0, 100);
	this.moveTo(-r, -r);
	this.lineTo(r, -r);
	this.lineTo(r, r);
	this.lineTo(-r, r);
	this.lineTo(-r, -r);
	this.endFill();
};
MovieClip.prototype.move = function() {
	this.x = Math.round(Math.random()*Stage.width);
	this.y = Math.round(Math.random()*Stage.height);
	this.onEnterFrame = function() {
		this._x += (this.x-this._x)/10;
		this._y += (this.y-this._y)/10;
		if (Math.ceil(this._x) == this.x || Math.ceil(this._y) == this.y) {
			this.x = Math.round(Math.random()*Stage.width);
			this.y = Math.round(Math.random()*Stage.height);
		}
	};
};
this.createEmptyMovieClip("l", 0).onEnterFrame = function() {
	this.clear();
	this.lineStyle(1, 0, 50);
	this.moveTo(a._x, a._y);
	this.lineTo(b._x, b._y);
};
this.createEmptyMovieClip("a", 1).square(2);
this.createEmptyMovieClip("b", 2).square(2);
a.move();
b.move();

```

does that help? =)

---

<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:** [April 8, 2003, 9:07am UTC](https://forum.kirupa.com/t/hey-2all-any-idea-on-this/17685/3 "2003-04-08T09:07:44Z")

</div>

🙂 kax, this helps me BigTime.🙂  
Thanz a lot and greetz from :  
deamothul - the script keeper - :skull:

---

<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:** [April 8, 2003, 9:33am UTC](https://forum.kirupa.com/t/hey-2all-any-idea-on-this/17685/4 "2003-04-08T09:33:04Z")

</div>

🙂 🙂 🙂 🙂

---

<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:** [April 8, 2003, 9:33am UTC](https://forum.kirupa.com/t/hey-2all-any-idea-on-this/17685/5 "2003-04-08T09:33:25Z")

</div>

you’re welcome 😉  
… and good luck =)
