# Help with fadein function

**URL:** <https://forum.kirupa.com/t/help-with-fadein-function/65287>\
**Category:** flash\
**Created:** [September 24, 2004, 5:38pm UTC](https://forum.kirupa.com/t/help-with-fadein-function/65287 "2004-09-24T17:38:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dante2010](https://avatars.discourse-cdn.com/v4/letter/d/cdc98d/32.png) [@dante2010](https://forum.kirupa.com/u/dante2010)\
**Post date:** [September 24, 2004, 5:38pm UTC](https://forum.kirupa.com/t/help-with-fadein-function/65287/1 "2004-09-24T17:38:44Z")

</div>

Could someone help me with why the fadein function isn’t working in this movie?

It just comes up to a point and then stops. Does it have soemthing to do with the fact taht I’m loading the jpg from outside of the movie?

---

<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:** [September 24, 2004, 6:30pm UTC](https://forum.kirupa.com/t/help-with-fadein-function/65287/2 "2004-09-24T18:30:36Z")

</div>

Its because it won’t keep the speed value. You will need to set the speed as a property of the movie clip. ie:

```auto

MovieClip.prototype.fadeIn = function(speed) {
 this._alpha = 0;
 this._fadeInSpeed = speed;
 this.onEnterFrame = function() {
  this._alpha += this._fadeInSpeed;
  if (this._alpha>=100) {
   delete this.onEnterFrame;
  }
 };
};

```

Hope that 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:** [September 24, 2004, 7:57pm UTC](https://forum.kirupa.com/t/help-with-fadein-function/65287/3 "2004-09-24T19:57:30Z")

</div>

Thanks mate… that cleared things up!
