# Help with "simple" button effect

**URL:** https://forum.kirupa.com/t/help-with-simple-button-effect/9145
**Category:** Uncategorized
**Created:** [December 5, 2002, 7:43pm UTC](https://forum.kirupa.com/t/help-with-simple-button-effect/9145 "2002-12-05T19:43:40Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![evader](https://avatars.discourse-cdn.com/v4/letter/e/e9a140/32.png) [@evader](https://forum.kirupa.com/u/evader)
#### Post date: [December 5, 2002, 7:43pm UTC](https://forum.kirupa.com/t/help-with-simple-button-effect/9145/1 "2002-12-05T19:43:40Z")

</div>

I’m pretty sure this a pretty easy thing to do but for some reason I am drawing a blank…

I want to have it so when a button is clicked the actual button moves up on the page (and remains in it’s new location). I know how to do a rollover but how do I make it so it does that when the user clicks the button?

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: [December 5, 2002, 8:02pm UTC](https://forum.kirupa.com/t/help-with-simple-button-effect/9145/2 "2002-12-05T20:02:12Z")

</div>

Give your button an instance name called ‘button1’ and place it on the root timeline:

```php
_root.createEmptyMovieClip("script_clip", 100);

button1.onPress = function() {
	_root.active = true;
};

script_clip.onEnterFrame = function () {
	trace(_root.button1._y);
	if(_root.active) {
		if(_root.button1._y >= 10) {
			_root.button1._y -= 10;
		}
	}
};

```

Change **\_root.button1.\_y -= [color=red]10[/color];** to a larger number for it to go fast.

Change **if(\_root.button1.\_y \>= [color=red]10[/color])** to the \_y value you want you box to stop going up at.

Does that cover your problem?
