# Fading with actionscript

**URL:** https://forum.kirupa.com/t/fading-with-actionscript/223142
**Category:** flash
**Created:** [April 19, 2007, 9:05pm UTC](https://forum.kirupa.com/t/fading-with-actionscript/223142 "2007-04-19T21:05:21Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![thehaircut](https://avatars.discourse-cdn.com/v4/letter/t/7feea3/32.png) [@thehaircut](https://forum.kirupa.com/u/thehaircut)
#### Post date: [April 19, 2007, 9:05pm UTC](https://forum.kirupa.com/t/fading-with-actionscript/223142/1 "2007-04-19T21:05:21Z")

</div>

Hello.

This, i suspect, is hilariously simple so I’d be very grateful if someone wants to make me look, well, amateurish. :pa:. Anyhow, I’m using the following actionscript to fade in an image:

```auto
brown_mc._alpha = 0
function fadeImagein(target_mc:MovieClip):Void {
    target_mc._alpha += 4;
    trace("fading");
    if (target_mc._alpha >= 80) {
        target_mc._alpha = 80;
        clearInterval(alpha_interval);
    }
};

this.tree_mc.ill_mc.ill_btn.onRelease = function() {
    var alpha_interval:Number = setInterval(fadeImagein, 50, brown_mc);
    };

```

and while it fades in appropriately, the trace tells me that the function is continously called even when the condition of the if statement is met. This is a fantastic forum and I’m very very grateful for all the help I’ve already recieved.
