# Fade out MC with button // my code

**URL:** https://forum.kirupa.com/t/fade-out-mc-with-button-my-code/56285
**Category:** Uncategorized
**Created:** [July 2, 2004, 8:25am UTC](https://forum.kirupa.com/t/fade-out-mc-with-button-my-code/56285 "2004-07-02T08:25:22Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![georgyboy](https://avatars.discourse-cdn.com/v4/letter/g/9de0a6/32.png) [@georgyboy](https://forum.kirupa.com/u/georgyboy)
#### Post date: [July 2, 2004, 8:25am UTC](https://forum.kirupa.com/t/fade-out-mc-with-button-my-code/56285/1 "2004-07-02T08:25:22Z")

</div>

on (release){  
\_root.drew.\_visible =false;  
gotoAndPlay(31);  
}

above is my code which i m using to try and fade out a MC when a button is pressed. The button (and the picture it shows when pressed) are within the same MC. I have placed this MC onthe root timeline and givene the MC i want to fade out the instance name drew // but still not having any luck making invisible. Ideas?? Thanks

---

<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: [July 28, 2004, 5:39pm UTC](https://forum.kirupa.com/t/fade-out-mc-with-button-my-code/56285/2 "2004-07-28T17:39:28Z")

</div>

how would i write this code

```
if (_root.drew._alpha=100) {
	_root.drew.onEnterFrame = function() {
		_root.drew._alpha -= 15;
	};
} else {
	delete _root.drew.onEnterFrame;
}

```

to use it on a frame with a fade in on entry of a frame that is loadign a external swf and then have it fade out when leaving the frame?

THANKS! 🙂
