# Button not all that easy

**URL:** <https://forum.kirupa.com/t/button-not-all-that-easy/185777>\
**Category:** Uncategorized\
**Created:** [April 16, 2006, 12:52pm UTC](https://forum.kirupa.com/t/button-not-all-that-easy/185777 "2006-04-16T12:52:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![CIPRIANO](https://avatars.discourse-cdn.com/v4/letter/c/6de8d8/32.png) [@CIPRIANO](https://forum.kirupa.com/u/CIPRIANO)\
**Post date:** [April 16, 2006, 12:52pm UTC](https://forum.kirupa.com/t/button-not-all-that-easy/185777/1 "2006-04-16T12:52:55Z")

</div>

Hey guys!  
i need help with this one…

I wanna make a button that shows up onRollOver and that fades back onRollOut… when i hit it I want it do do something else though, like turning blue or whatever… someone who know how I should do?

---

<div class="post-metadata">

**Author:** ![rmo518](https://avatars.discourse-cdn.com/v4/letter/r/f19dbf/32.png) [@rmo518](https://forum.kirupa.com/u/rmo518)\
**Post date:** [April 17, 2006, 1:05am UTC](https://forum.kirupa.com/t/button-not-all-that-easy/185777/2 "2006-04-17T01:05:35Z")

</div>

To get that kind of functionality you’ll need to use a movie clip. Here’s one method to do something like what you are describing, but this may not be suitable for what you are specifically doing. Hopefully it give you an idea.

This is just a movie clip with two frames - the first one is black, the second one blue. It has the following script attached to it:  
[AS]onClipEvent (load) {  
this.gotoAndStop(1);  
this.\_alpha = 10;  
this.selected = false;  
this.onRollOver = function() {  
delete (this.onEnterFrame);  
this.onEnterFrame = function() {  
this.\_alpha += 10;  
if (this.\_alpha == 100) {  
delete (this.onEnterFrame);  
}  
};  
};  
this.onRollOut = function() {  
delete (this.onEnterFrame);  
if (this.selected != true) {  
this.onEnterFrame = function() {  
this.\_alpha -= 10;  
if (this.\_alpha \<= 10) {  
delete (this.onEnterFrame);  
}  
};  
}  
};  
this.onPress = function() {  
delete (this.onEnterFrame);  
if (selected) {  
this.selected = false;  
this.gotoAndStop(1);  
} else {  
this.selected = true;  
this.\_alpha = 100;  
this.gotoAndStop(2);  
}  
};  
}[/AS]  
Hopefully this will at least serve as some inspiration for you.
