# Alpha fading

**URL:** <https://forum.kirupa.com/t/alpha-fading/20790>\
**Category:** Uncategorized\
**Created:** [May 13, 2003, 1:46pm UTC](https://forum.kirupa.com/t/alpha-fading/20790 "2003-05-13T13:46:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheOrangeOne](https://avatars.discourse-cdn.com/v4/letter/t/67e7ee/32.png) [@TheOrangeOne](https://forum.kirupa.com/u/TheOrangeOne)\
**Post date:** [May 13, 2003, 1:46pm UTC](https://forum.kirupa.com/t/alpha-fading/20790/1 "2003-05-13T13:46:28Z")

</div>

Hi, i know next to nothing about actionscript and need help.

I have button the dissappears when i click it, but instead of disapearing straight away, i want it to fade out first. Whats the script for this? can anyone help please?

---

<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 13, 2003, 1:49pm UTC](https://forum.kirupa.com/t/alpha-fading/20790/2 "2003-05-13T13:49:30Z")

</div>

you’ll need to make your button a movie clip before you can fade it. Once you’ve done that place the clip on the stage and put this code into it:

on frame1:

```auto

this.onEnterFrame = function() {
      if(Fade) {
            _alpha -= 5;
            if(_alpha <= 0) {
                  Fade = false;
            }
      }
}

```

and this in the button:

```auto

on(release) {
      Fade = true;
}

```

hope this 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:** [May 13, 2003, 2:07pm UTC](https://forum.kirupa.com/t/alpha-fading/20790/3 "2003-05-13T14:07:45Z")

</div>

great! cheers mate, thats a big help. You’ve made me one very happy flasher =)
