# Creating Animated Rollover buttons

**URL:** <https://forum.kirupa.com/t/creating-animated-rollover-buttons/114820>\
**Category:** Uncategorized\
**Created:** [July 2, 2004, 1:44am UTC](https://forum.kirupa.com/t/creating-animated-rollover-buttons/114820 "2004-07-02T01:44:33Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![toog](https://avatars.discourse-cdn.com/v4/letter/t/f475e1/32.png) [@toog](https://forum.kirupa.com/u/toog)\
**Post date:** [July 2, 2004, 1:44am UTC](https://forum.kirupa.com/t/creating-animated-rollover-buttons/114820/1 "2004-07-02T01:44:33Z")

</div>

[http://www.kirupa.com/developer/flash5/animatedrollover.htm](http://www.kirupa.com/developer/flash5/animatedrollover.htm)

Hi!

I just finished the above tutorial, albeit in Flash MX 2004.

I could make the effect, (I could see it when I pushed “play movie”) but could not get it to happen on rollover. I assume this is an actionscript thing, could anyone walk me through it?

Thank you!

---

<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:** [July 7, 2004, 12:11am UTC](https://forum.kirupa.com/t/creating-animated-rollover-buttons/114820/2 "2004-07-07T00:11:16Z")

</div>

Ok, I’m back!

Here’s the .fla. Hope you can help me figure the problem out. On a related not I’ve noticed that my cursor kind of acts figgity when mousing over my button in general. It’s as if flash can’t tell when I’m over a button or which button I’m over. I’ve done something wrong. :hurt:

Thanks for your help!

---

<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:** [July 7, 2004, 1:07am UTC](https://forum.kirupa.com/t/creating-animated-rollover-buttons/114820/3 "2004-07-07T01:07:47Z")

</div>

Save the file for Flash MX.

---

<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:** [July 7, 2004, 1:14am UTC](https://forum.kirupa.com/t/creating-animated-rollover-buttons/114820/4 "2004-07-07T01:14:32Z")

</div>

Absolutely! Sorry about that…

Tell me if there’s a problem with the new one…winzip was acting angry.

---

<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:** [July 7, 2004, 1:28am UTC](https://forum.kirupa.com/t/creating-animated-rollover-buttons/114820/5 "2004-07-07T01:28:53Z")

</div>

:huh:

Okay, so I don’t know what I’m supposed to be looking at… I did, however, look at the “Slideshow” MC/Button, was that the right one?

I added the rollOvers and for some reason it wouldn’t work when I previewed the movie, don’t know what that was about.

---

<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:** [July 7, 2004, 1:40am UTC](https://forum.kirupa.com/t/creating-animated-rollover-buttons/114820/6 "2004-07-07T01:40:08Z")

</div>

Yes, the “slideshow” button is the one I applied the tutorial to. Hmmm, I wonder why it isn’t working? Did you see that if you “play movie” you can see it pulsate?

---

<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:** [July 7, 2004, 5:10pm UTC](https://forum.kirupa.com/t/creating-animated-rollover-buttons/114820/7 "2004-07-07T17:10:25Z")

</div>

Anyone else want to try?

---

<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:** [July 7, 2004, 7:11pm UTC](https://forum.kirupa.com/t/creating-animated-rollover-buttons/114820/8 "2004-07-07T19:11:13Z")

</div>

Here’s an example of one I got to work roll-over wise, but see how it’s hard to get it to go? The space in say, the capital letter “D” is just empty space as far as my pointer is concerned. I don’t get it.

---

<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:** [July 7, 2004, 10:36pm UTC](https://forum.kirupa.com/t/creating-animated-rollover-buttons/114820/9 "2004-07-07T22:36:34Z")

</div>

Got your problem. First of all, your actionscript is all wrong. We’ll get back to that. However, your other problem is that you have an unneccessary keyframe. When it passes over that keyframe, the mc reverts to its normal position (stopped at frame 1). So, delete that by right-clicking the frame and selecting “clear keyframe”. Then, you need to change your actionscript. Put this code in the actual movieclip:

```auto
 on (rollOver) {
_root.slideshow.gotoAndPlay(2);
}

```

. Put this code in the first frame of the movieclip:

```auto
stop()

```

. Right-click the second frame in Layer 2 and select “Convert to keyframe”. Now, in the last frame (frame 15), put in this actionscript:

```auto
gotoAndStop(1)

```

.

I hope this helped your problem.

If you happen to be lazy, the fixed file is here. I suggest, however, that you follow the steps to help you learn.

---

<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:** [July 7, 2004, 11:53pm UTC](https://forum.kirupa.com/t/creating-animated-rollover-buttons/114820/10 "2004-07-07T23:53:15Z")

</div>

Thank you so much! I will try and do it on my own!

I’ll let you know if anything weird happens.

---

<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:** [July 8, 2004, 12:12am UTC](https://forum.kirupa.com/t/creating-animated-rollover-buttons/114820/11 "2004-07-08T00:12:46Z")

</div>

I don’t 3dengine is what you wanted to attach.

Well, I’m getting closer, maybe? Now it does the animation at the start, once, then no rollover. I want it to loop while your mouse is over it. Oh yeah, and for me at least my mouse still acts silly over it.

Here’s what I’ve done so far.

---

<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:** [July 8, 2004, 1:45am UTC](https://forum.kirupa.com/t/creating-animated-rollover-buttons/114820/12 "2004-07-08T01:45:20Z")

</div>

Sorry. On your example, you renamed the actionscript to slideshowbutton, so you would need to change that in the main frame. (go from slideshow to slideshowbutton). Since you want it to loop, delete the code in the first frame and put this code in the last frame:

```auto
if (this.hitTest( _root._xmouse, _root._ymouse, false)){
gotoAndPlay(1)}else{
gotoAndStop(1)}

```

Don’t really want to explain. Sorry

EDIT: Also, I’d suggest putting a rectangular background with an alpha of 0 below it so it is easier to rollover and click on it.
