# Gravity ball

**URL:** https://forum.kirupa.com/t/gravity-ball/2694
**Category:** Uncategorized
**Created:** [May 8, 2002, 6:01pm UTC](https://forum.kirupa.com/t/gravity-ball/2694 "2002-05-08T18:01:21Z")
**Posts on this page:** 2
**Page:** 1

<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: [May 8, 2002, 6:01pm UTC](https://forum.kirupa.com/t/gravity-ball/2694/1 "2002-05-08T18:01:21Z")

</div>

Hello,\rHow can I move (on click) the ball up?\rI’d like to click in ball and move it up, the gravity move it down as well…\rPawel

---

<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: [May 9, 2002, 3:04am UTC](https://forum.kirupa.com/t/gravity-ball/2694/2 "2002-05-09T03:04:13Z")

</div>

Make a button shaped like a ball.\r\rThen place that button into a empty movie clip, and in the buttons action script type this\r\ron (press) {\r grab = true;\r startDrag ("");\r}\ron (release) {\r grab = false;\r stopDrag ();\r}\r\rPlace the movie (with the button in it) onto the stage, and type this into it’s script\r\ronClipEvent (enterFrame) {\r if (grab == false && \_y \< 250) {\r \_y += 10;\r }\r}\r\rThen you can move the ball up, and when you drop it, it’ll fall back down. Just change \_y \< 250 to the distance that suits you.
