# Fading between frames

**URL:** <https://forum.kirupa.com/t/fading-between-frames/186220>\
**Category:** flash\
**Created:** [April 19, 2006, 9:15pm UTC](https://forum.kirupa.com/t/fading-between-frames/186220 "2006-04-19T21:15:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Neolumi](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/neolumi/32/1306_2.png) [@Neolumi](https://forum.kirupa.com/u/Neolumi)\
**Post date:** [April 19, 2006, 9:15pm UTC](https://forum.kirupa.com/t/fading-between-frames/186220/1 "2006-04-19T21:15:00Z")

</div>

Hi again, my next problem is I want to have a function which I can call as  
fadebgto(framelabel);

I found a function in the help, and have started to adapt it, below is as far as I’ve got, thing is it just runs as opposed to running when called as a function. (Function assumes the graphic in the frames, in the bg movieclip have an alpha of 0.

```php

var alpha_interval:Number = setInterval(fadeImage, 50, bg);
function fadebgtoage(current_mc:MovieClip,target_frame:MovieClip):Void {
    current_mc._alpha -= 5;
    
    if (current_mc._alpha <= 0) {

        current_mc.gotoAndStop(target_frame);
        current_mc._alpha += 5;
        
        if(current_mc._alpha = 100){
        clearInterval(alpha_interval);
        }
    }
}

```

help appreciated!

---

<div class="post-metadata">

**Author:** ![Neolumi](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/neolumi/32/1306_2.png) [@Neolumi](https://forum.kirupa.com/u/Neolumi)\
**Post date:** [April 21, 2006, 8:51am UTC](https://forum.kirupa.com/t/fading-between-frames/186220/2 "2006-04-21T08:51:15Z")

</div>

anyone have any ideas?
