# Making ball follow a line

**URL:** <https://forum.kirupa.com/t/making-ball-follow-a-line/11274>\
**Category:** flash\
**Created:** [January 14, 2003, 10:09pm UTC](https://forum.kirupa.com/t/making-ball-follow-a-line/11274 "2003-01-14T22:09:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![buddylee](https://avatars.discourse-cdn.com/v4/letter/b/e5b9ba/32.png) [@buddylee](https://forum.kirupa.com/u/buddylee)\
**Post date:** [January 14, 2003, 10:09pm UTC](https://forum.kirupa.com/t/making-ball-follow-a-line/11274/1 "2003-01-14T22:09:57Z")

</div>

Ok, I have a line that is 800 pixels long. The line is a gradual curve, that gets kinda steep at the end. I want this ball to go along the line. How do I make the ball move to the right, and stay on top of the line. All I have now is…

```php
onClipEvent(enterFrame){
this._x +=35;
}

```

Now I need to add something to make it follow the line. The instance name of the line is… “line” without the quotes of course. Ok, go to work guys.  
Thanks

---

<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:** [January 14, 2003, 11:12pm UTC](https://forum.kirupa.com/t/making-ball-follow-a-line/11274/2 "2003-01-14T23:12:39Z")

</div>

do you have to script this?  
just use a tween and the line on a guide layer…

---

<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:** [January 15, 2003, 12:21am UTC](https://forum.kirupa.com/t/making-ball-follow-a-line/11274/3 "2003-01-15T00:21:01Z")

</div>

I already have one tween going on here, and I didnt wanna have 2. I read earlier that multiple tweens can slow down the animation. I will try to tween it though and see how it works. Can you explain what a guide layer is though?  
Thanks
