# Rollover - the rollOUT part

**URL:** <https://forum.kirupa.com/t/rollover-the-rollout-part/111344>\
**Category:** Uncategorized\
**Created:** [May 26, 2004, 2:13am UTC](https://forum.kirupa.com/t/rollover-the-rollout-part/111344 "2004-05-26T02:13:42Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ultramagnus](https://avatars.discourse-cdn.com/v4/letter/u/ea5d25/32.png) [@ultramagnus](https://forum.kirupa.com/u/ultramagnus)\
**Post date:** [May 26, 2004, 2:13am UTC](https://forum.kirupa.com/t/rollover-the-rollout-part/111344/1 "2004-05-26T02:13:42Z")

</div>

Hey All:

Ive been using the typical way for rollovers and the rollout like in the tutorial found on this site ([http://www.kirupa.com/developer/flash5/advroll.htm](http://www.kirupa.com/developer/flash5/advroll.htm)).

However, its always bothered me a bit in terms of the RollOut part of the animation. When you move the cursor/mouse quickly across multiple items, the ‘Play’ rollout part stops suddenly and does not finish.

How can you make sure the rollout play all the way through no matter what.  
I guess also, if u move the cursor/mouse away before the entire RollOver finishes, it’ll just start the RollOut…

Sorta like on the main nav of: [http://www.wa007.com/](http://www.wa007.com/)

I hope this makes sense…  
Any help or ideas is greatly appreciated!

Thanks,  
Shelby.

---

<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 26, 2004, 2:50am UTC](https://forum.kirupa.com/t/rollover-the-rollout-part/111344/2 "2004-05-26T02:50:36Z")

</div>

Fisrt u need to know they dont use basic onRollOver…

use a movieclip for button

```auto

onClipEvent(load){
stat = 0
alphaspeed = 2
maxalpha = 100
minalpha = 60
}
onClipEvent(enterFrame){
         if(stat == 0){
                   if(this._alpha < maxalpha){
                            this._alpha += alphaspeed
                    }  
         } else if(stat == 1){
                    if(this._alpha < minalpha){
                             this._alpha -= alphaspeed
                    }
         }
}
on(rollOver){
      stat = 1
}
on(rollOut){
      stat = 0
}on(dragOver){
      stat = 1
}on(dragOut){
      stat = 0
}

```

then ull have a constant recover of your status

---

<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 26, 2004, 3:51am UTC](https://forum.kirupa.com/t/rollover-the-rollout-part/111344/3 "2004-05-26T03:51:10Z")

</div>

or just use a variable.

put this on the button

```auto

if(!playing) {
on(rollover) {
this.playing = 1;
}
}

```

then on the last frame of the rollout mc

```auto
playing = 0;

```

---

<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 26, 2004, 9:06am UTC](https://forum.kirupa.com/t/rollover-the-rollout-part/111344/4 "2004-05-26T09:06:41Z")

</div>

Hey Peeps.

thanks for the help; really appreciate it. This all gives me some insight on what I need to do, However, my AS isn’t very good and with many of the lines… well I’m just not sure what each does or how to adjust it to what I need.

Could u give me a bit more insight on the lines of code? Will I be able use 2 different animations for the over and out still??

Thanks again.  
Still quite a rookie when it comes to AS.

Shelby.

---

<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 27, 2004, 3:41am UTC](https://forum.kirupa.com/t/rollover-the-rollout-part/111344/5 "2004-05-27T03:41:43Z")

</div>

Copy - paste this code on a movieClip that would be your button

```auto

onClipEvent(load){
stat = 0
alphaspeed = 2
maxalpha = 100
minalpha = 60
}
onClipEvent(enterFrame){
         if(stat == 0){
                   if(this._alpha < maxalpha){
                            this._alpha += alphaspeed
                    }  
         } else if(stat == 1){
                    if(this._alpha < minalpha){
                             this._alpha -= alphaspeed
                    }
         }
}
on(rollOver){
      stat = 1
}
on(rollOut){
      stat = 0
}on(dragOver){
      stat = 1
}on(dragOut){
      stat = 0
}on(release){
/*Actions you wanna do when button's clicked*/
}

```
