# Setting Boundries

**URL:** <https://forum.kirupa.com/t/setting-boundries/63274>\
**Category:** flash\
**Created:** [September 4, 2004, 6:53pm UTC](https://forum.kirupa.com/t/setting-boundries/63274 "2004-09-04T18:53:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![BlackFire](https://avatars.discourse-cdn.com/v4/letter/b/a5b964/32.png) [@BlackFire](https://forum.kirupa.com/u/BlackFire)\
**Post date:** [September 4, 2004, 6:53pm UTC](https://forum.kirupa.com/t/setting-boundries/63274/1 "2004-09-04T18:53:39Z")

</div>

Does anyone know how to set boundries on a slow chase mouse follower. Attached is the fla im trying to set boundries to. The ball should not go past the red lines.

I have used the following code:

```auto
 
onClipEvent (load) {
_y = 0;
speed = 5;
}
onClipEvent (enterFrame) {
endY = _root._ymouse-200;
_y += (endY-_y)/speed;
}

```

-BlackFireMD :beard:

---

<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:** [September 5, 2004, 4:17pm UTC](https://forum.kirupa.com/t/setting-boundries/63274/2 "2004-09-05T16:17:17Z")

</div>

```auto
onClipEvent (load) {
	_y = 0;
	speed = 5;
}
onClipEvent (enterFrame) {
	endY = _root._ymouse-200;
	if ((_y + (endY-_y)/speed)<150 && (_y + (endY-_y)/speed)>-140) {
		_y += (endY-_y)/speed;
	}
}

```

This should work.

---

<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:** [September 7, 2004, 8:43pm UTC](https://forum.kirupa.com/t/setting-boundries/63274/3 "2004-09-07T20:43:50Z")

</div>

It worked! Thanks!! 🍺
