# Problem with button animations

**URL:** https://forum.kirupa.com/t/problem-with-button-animations/10117
**Category:** flash
**Created:** [December 24, 2002, 5:02pm UTC](https://forum.kirupa.com/t/problem-with-button-animations/10117 "2002-12-24T17:02:51Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![globe](https://avatars.discourse-cdn.com/v4/letter/g/848f3c/32.png) [@globe](https://forum.kirupa.com/u/globe)
#### Post date: [December 24, 2002, 5:02pm UTC](https://forum.kirupa.com/t/problem-with-button-animations/10117/1 "2002-12-24T17:02:51Z")

</div>

This has been bugging me for a long time.

The thing is, the animation doesn’t not reverse itself when the mouse is rollout at a considerable speed.

Below is the code I used…

```auto

on (rollOver) {
	tellTarget ("/news") {
		gotoAndPlay("/start_r")
		gotoAndPlay("/start_l");
	}
}
on (rollOut) {
	tellTarget ("/news") {
		gotoAndPlay("/end_r")
		gotoAndPlay("/end_l");
	}
}

```

Attached is the fla file. Pls advise.:\*(

---

<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 24, 2002, 10:25pm UTC](https://forum.kirupa.com/t/problem-with-button-animations/10117/2 "2002-12-24T22:25:25Z")

</div>

use a hitTest

something like:

```php

onClipEvent (enterFrame) {
	if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
		tellTarget ("/news") {
			gotoAndPlay("/start_r")
			gotoAndPlay("/start_l")
		}
	} else {
		tellTarget ("/news") {
			gotoAndPlay("/end_r")
			gotoAndPlay("/end_l")
		}
	}
}

```

---

<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 24, 2002, 10:43pm UTC](https://forum.kirupa.com/t/problem-with-button-animations/10117/3 "2002-12-24T22:43:46Z")

</div>

forget about it … in your case it doesn’t 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: [December 24, 2002, 11:01pm UTC](https://forum.kirupa.com/t/problem-with-button-animations/10117/4 "2002-12-24T23:01:32Z")

</div>

I haven’t downloaded your fla in my first post but it’s always better to use a hitTest [at least for me :beam:] so I told you that

here’s another way and it works …

---

<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 25, 2002, 8:07am UTC](https://forum.kirupa.com/t/problem-with-button-animations/10117/5 "2002-12-25T08:07:57Z")

</div>

Thanks!😛
