# Fade function

**URL:** https://forum.kirupa.com/t/fade-function/178183
**Category:** flash
**Created:** [February 8, 2006, 10:13am UTC](https://forum.kirupa.com/t/fade-function/178183 "2006-02-08T10:13:53Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![coop](https://avatars.discourse-cdn.com/v4/letter/c/87869e/32.png) [@coop](https://forum.kirupa.com/u/coop)
#### Post date: [February 8, 2006, 10:13am UTC](https://forum.kirupa.com/t/fade-function/178183/1 "2006-02-08T10:13:53Z")

</div>

Hi all,

I have wrote a function to fade in a movieClip, but it doesn’t seem to work and I carn’t see why?  
I have a MC on the stage with 0 alpha and a btn to call the function.  
I’m sure it’s something simple.

```auto

function fadeIn(num) {
 this.onEnterFrame = function() {
  this._alpha += num;
  if (this._alpha>=100) {
   this._alpha == 100;
   delete this.onEnterFrame;
  }
 };
}
one_btn.onRelease = function() {
 one_mc.fadeIn(10);
};

```
