# Rollovers

**URL:** <https://forum.kirupa.com/t/rollovers/9646>\
**Category:** flash\
**Created:** [December 16, 2002, 12:16am UTC](https://forum.kirupa.com/t/rollovers/9646 "2002-12-16T00:16:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mr\_JedI69](https://avatars.discourse-cdn.com/v4/letter/m/9e8a1a/32.png) [@Mr\_JedI69](https://forum.kirupa.com/u/Mr_JedI69)\
**Post date:** [December 16, 2002, 12:16am UTC](https://forum.kirupa.com/t/rollovers/9646/1 "2002-12-16T00:16:30Z")

</div>

hey i was wondering if any one could help me with a rollover im trying to creat, i’ve looked at he tuts on this site but it doesn’t help much. i want to make a button and when the mouse rolls over it, i want a line to appear under the button on one side then go to the other side and fade out, then reverse on the roll out, either i don’t know what im doing with instances or the code but it’s just not working.

---

<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 16, 2002, 12:46am UTC](https://forum.kirupa.com/t/rollovers/9646/2 "2002-12-16T00:46:06Z")

</div>

ok I’m not sure if this is exactly what you wanted, but I put together a lil example to give you an idea. Hope it helps. =)

---

<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 16, 2002, 12:55am UTC](https://forum.kirupa.com/t/rollovers/9646/3 "2002-12-16T00:55:28Z")

</div>

yes thats exactly, i just need some one to explain how they did it , and i would be so happy, mabey explain a little of the code cuz im pretty much a flash newb

---

<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 16, 2002, 1:10am UTC](https://forum.kirupa.com/t/rollovers/9646/4 "2002-12-16T01:10:25Z")

</div>

Ok what I did was first create a movieclip that contains the lil tween animation of the bar sliding across and fading. Then I applied these actions to the movieclip:

```php
 onClipEvent (enterFrame) {
 if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
 this.nextFrame();
 } else {
 this.prevFrame();
 }

```

It’s basically telling the movieclip “this” to play this.nextFrame(); if the mouse is on it, if not “if else” then play this.prevFrame(); or reverse the animation. I hope that explains it a bit more.
