# Interval problem

**URL:** <https://forum.kirupa.com/t/interval-problem/203227>\
**Category:** Uncategorized\
**Created:** [October 9, 2006, 9:17am UTC](https://forum.kirupa.com/t/interval-problem/203227 "2006-10-09T09:17:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![scarlac](https://avatars.discourse-cdn.com/v4/letter/s/e47c2d/32.png) [@scarlac](https://forum.kirupa.com/u/scarlac)\
**Post date:** [October 9, 2006, 9:17am UTC](https://forum.kirupa.com/t/interval-problem/203227/1 "2006-10-09T09:17:02Z")

</div>

Hi,

I have an interval problem. Here is the code.

```auto
//function for fading in objects
function fadeIn(theMc:MovieClip, fadeParam:Number) {
    if (theMc._alpha < 100) {
        theMc._alpha += fadeParam;
		trace(theMc._alpha);
    }
    else {
		theMc._alpha = 100;
		trace(theMc._alpha);
		clearInterval(theMc.fadeInID);
    }
}

introFoto.fadeInID = setInterval(fadeIn, 40, introFoto, 5);

```

I made a small function for fading in objects. Once the object its alpha is larger then 100, it should stop that interval, but it doesn’t. Can sombody tell me why and what I have to do.

thanx in advance
