# How to fade a button with AS?

**URL:** <https://forum.kirupa.com/t/how-to-fade-a-button-with-as/101619>\
**Category:** Uncategorized\
**Created:** [February 12, 2004, 12:16am UTC](https://forum.kirupa.com/t/how-to-fade-a-button-with-as/101619 "2004-02-12T00:16:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![cmoran](https://avatars.discourse-cdn.com/v4/letter/c/ce7236/32.png) [@cmoran](https://forum.kirupa.com/u/cmoran)\
**Post date:** [February 12, 2004, 12:16am UTC](https://forum.kirupa.com/t/how-to-fade-a-button-with-as/101619/1 "2004-02-12T00:16:53Z")

</div>

I’ve put this code onto a button

on (rollOver) {  
testbutton.\_alpha = 20  
}  
on (rollOut) {  
testbutton.\_alpha = 100  
}

How can I make the fade smooth from 100% to 20% on the rollover and then smooth back out on the rollout?

Any help is appreciated
