# Fading mc in

**URL:** <https://forum.kirupa.com/t/fading-mc-in/242881>\
**Category:** Uncategorized\
**Created:** [October 31, 2007, 11:06am UTC](https://forum.kirupa.com/t/fading-mc-in/242881 "2007-10-31T11:06:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rai\_kane3](https://avatars.discourse-cdn.com/v4/letter/r/e47774/32.png) [@rai\_kane3](https://forum.kirupa.com/u/rai_kane3)\
**Post date:** [October 31, 2007, 11:06am UTC](https://forum.kirupa.com/t/fading-mc-in/242881/1 "2007-10-31T11:06:25Z")

</div>

I have become stuck with my knowledge of as.

I have a series of MC’s in my library which need to fade (on a timer) ontop of each other. so movieclip1 fades in. pause for so many seconds then movieclip2 fades ontop and once it completes to \_alpha = 100 movieclip1 unloads I have about 7 mcs in total.

I have a buch of code which I have now become lost in.

```auto

var currentInt:Number = 0;
function timer_fun(delayy:Number) {
this.stop();
var timer:Number = getTimer();
currentInt = setInterval(function (){

if (getTimer()-timer>delayy) {
trace("here"+currentInt);
clearInterval(currentInt);
_root.gotoAndStop("nextFrame");
}
}, 10);
}

```

Timer function

```auto

import mx.transitions.Tween;
import mx.transitions.easing.Regular;
//
var container1:MovieClip = this.createEmptyMovieClip("c", this.getNextHighestDepth());
//
target_mc.onEnterFrame = function() {
    // fade out container
    var tween_handler:Tween = new Tween(container1, "_alpha", Regular.easeOut, container1._alpha, 0, 1, true);
    tween_handler.onMotionFinished = function() {
        // attach appropriate movie clip
        myContent = container1.attachMovie("image1", "image1", this.getNextHighestDepth());
        // fade in container
        var fadeIn:Tween = new Tween(container1, "_alpha", Regular.easeOut, container1._alpha, 100, 1, true);
    };
};

```

attach and fade. I need to somehow combine the two also using an array so I dont have to call each mc in the library individually.

Second code came from [Kovax and post](http://www.kirupa.com/forum/showthread.php?t=243410&highlight=fade+movie+clip)
