# Help with functions

**URL:** https://forum.kirupa.com/t/help-with-functions/107565
**Category:** Uncategorized
**Created:** [April 16, 2004, 4:57pm UTC](https://forum.kirupa.com/t/help-with-functions/107565 "2004-04-16T16:57:32Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![wyclef](https://avatars.discourse-cdn.com/v4/letter/w/65b543/32.png) [@wyclef](https://forum.kirupa.com/u/wyclef)
#### Post date: [April 16, 2004, 4:57pm UTC](https://forum.kirupa.com/t/help-with-functions/107565/1 "2004-04-16T16:57:32Z")

</div>

Hi, can someone help me set this up so CLR\_homeMC will be visible and alpha 100 in the beginning? Right now if I just add showClip(CLR\_homeMC); it works but there is an alpha fade in. I don’t want it to fade in for the first one.

```auto

var step = 3;
var oldClip;
function fadeOut() {
	with (this) {
		_alpha -= step;
		if (_alpha<=0) {
			_alpha = 0;
			_visible = false;
			onEnterFrame = null;
		}
	}
}
function fadeIn() {
	with (this) {
		_alpha += step;
		if (_alpha>=100) {
			_alpha = 100;
			onEnterFrame = null;
		}
	}
}
function showClip(newClip) {
	if (newClip != oldClip) {
		newClip._visible = true;
		newClip.onEnterFrame = fadeIn;
		oldClip.onEnterFrame = fadeOut;
		oldClip = newClip;
	}
}

CLR_homeMC._visible = CLR_facebookMC._visible = CLR_snapshotsMC._visible = CLR_campusMC._visible = CLR_connectedMC._visible = CLR_extrasMC._visible = CLR_contactMC._visible = CLR_exitMC._visible = false;
CLR_homeMC._alpha = CLR_facebookMC._alpha = CLR_snapshotsMC._alpha = CLR_campusMC._alpha = CLR_connectedMC._alpha = CLR_extrasMC._alpha = CLR_contactMC._alpha = CLR_exitMC._alpha = 0;

```
