# My fade out / fade in script. Fade Out works, why not fade in? Any ideas?

**URL:** <https://forum.kirupa.com/t/my-fade-out-fade-in-script-fade-out-works-why-not-fade-in-any-ideas/176890>\
**Category:** Uncategorized\
**Created:** [January 27, 2006, 7:16pm UTC](https://forum.kirupa.com/t/my-fade-out-fade-in-script-fade-out-works-why-not-fade-in-any-ideas/176890 "2006-01-27T19:16:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![BadBadNeil](https://avatars.discourse-cdn.com/v4/letter/b/f4b2a3/32.png) [@BadBadNeil](https://forum.kirupa.com/u/BadBadNeil)\
**Post date:** [January 27, 2006, 7:16pm UTC](https://forum.kirupa.com/t/my-fade-out-fade-in-script-fade-out-works-why-not-fade-in-any-ideas/176890/1 "2006-01-27T19:16:50Z")

</div>

Hello all,  
Hopefully this is just a simple problem with my code.

I have a container on the stage. When the loaded clip gets to the last frame it triggers the decreaseAlpha() function on the root level. This fades the current container out and works fine.

However I also want it to load the next clip(which it does) and fade that clip in. This doesn’t work. It doesnt’ fade in, can anyone point me in the right direction?

Thanks!!

```auto

function decreaseAlpha(boxName, clipName){
	boxName.onEnterFrame = function(){
	if(boxName._alpha > 0){
		boxName._alpha -= 15;
	}if(boxName._alpha < 5){
		delete boxName.onEnterFrame;
		increaseAlpha(boxName, clipName);
	}
}
}
function increaseAlpha(boxName, clipName){
	loadMovie(clipName, boxName);
	boxName._alpha = 0;
	boxName.onEnterFrame = function(){
	if(boxName._alpha < 100){
		boxName._alpha += 15;
	}if(boxName._alpha == 100){
		delete subboxName.onEnterFrame;
	}
	}
}

```
