# Simple button problem

**URL:** https://forum.kirupa.com/t/simple-button-problem/113371
**Category:** Uncategorized
**Created:** [June 17, 2004, 9:03am UTC](https://forum.kirupa.com/t/simple-button-problem/113371 "2004-06-17T09:03:57Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![mx\_guest2004](https://avatars.discourse-cdn.com/v4/letter/m/e47c2d/32.png) [@mx\_guest2004](https://forum.kirupa.com/u/mx_guest2004)
#### Post date: [June 17, 2004, 9:03am UTC](https://forum.kirupa.com/t/simple-button-problem/113371/1 "2004-06-17T09:03:57Z")

</div>

Hi!  
Which of the 4 button events make that an effect appears when the mouse goes AWAY FROM the button?  
For example when the mouse goes OVER the button =\> fade in. This is the OVER event of the button. What about fade out when the mouse “leaves” the button?  
mx-guest2004 🙂

---

<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: [June 17, 2004, 9:59am UTC](https://forum.kirupa.com/t/simple-button-problem/113371/2 "2004-06-17T09:59:47Z")

</div>

rollOut

---

<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: [June 17, 2004, 7:49pm UTC](https://forum.kirupa.com/t/simple-button-problem/113371/3 "2004-06-17T19:49:37Z")

</div>

erm i think he means which button state…  
if so make the up a movie clip with stop AS in places then use the rollOut event handler to work out which part of the movieclip to go to…  
depending on what you want you may need to include simple variables… but i dunno coz ur not very specific…

hope thet helps/understandable 😉

Prophet.

---

<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: [June 17, 2004, 8:04pm UTC](https://forum.kirupa.com/t/simple-button-problem/113371/4 "2004-06-17T20:04:56Z")

</div>

You know, we have 4 states for a button, as you mentioned: Up, Over, Down and Hit.  
I have made an effect for Over (fade in). This works. Now I want to make an effect such that when the mouse goes from the button (without hitting) the button fades out. I hope you understand me better now 🙂  
mx-guest2004

---

<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: [June 17, 2004, 8:19pm UTC](https://forum.kirupa.com/t/simple-button-problem/113371/5 "2004-06-17T20:19:20Z")

</div>

My question is about the button itself, not what it does when been released.  
mx-guest2004

---

<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: [June 18, 2004, 12:57am UTC](https://forum.kirupa.com/t/simple-button-problem/113371/6 "2004-06-18T00:57:40Z")

</div>

yes, ther is just 4 states - there is no roll out state… so u hav to make 1  
do wat i said and it will wok.  
wen u use the rollOut handler it is when you move your cursor off it regardless of whether or not youve clicked…

anyway… it turns out i lied slightly…  
u wanna set a var wenu roll over the button and have as on the first frame of your buttons up states mc saying gotoAndPlay(2) [if its just play() you will get a flicker of first frame] if the variable is true and u hav to remember to reset the var in the last frame of your rolling out anim…

see attached… and dont laugh - i did it in 2 mins and its 2 am!!

Prophet.

---

<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: [June 18, 2004, 4:33am UTC](https://forum.kirupa.com/t/simple-button-problem/113371/7 "2004-06-18T04:33:25Z")

</div>

Thanks Prophet,  
You gave me the main idea and this is a good help to get. 🙂  
mx-guest2004

---

<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: [June 18, 2004, 6:08am UTC](https://forum.kirupa.com/t/simple-button-problem/113371/8 "2004-06-18T06:08:29Z")

</div>

hey phophet,

here’s the code you entered for the button

```auto

on (rollOver) {
 _root.rollinOut = true
}

```

right?

shouldn’t it be rollOut instead? (althought ur attachment works):puzzle:
