# Function Parameter Troubles

**URL:** https://forum.kirupa.com/t/function-parameter-troubles/104504
**Category:** Uncategorized
**Created:** [March 16, 2004, 10:54pm UTC](https://forum.kirupa.com/t/function-parameter-troubles/104504 "2004-03-16T22:54:17Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Yeldarb](https://avatars.discourse-cdn.com/v4/letter/y/51bf81/32.png) [@Yeldarb](https://forum.kirupa.com/u/Yeldarb)
#### Post date: [March 16, 2004, 10:54pm UTC](https://forum.kirupa.com/t/function-parameter-troubles/104504/1 "2004-03-16T22:54:17Z")

</div>

I am using a function to fade out a movieclip then go to a frame. For some reaon the going to a frame part isnt working. I know the line of code executes because i put a trace() in and it executed.  
I’m calling

```auto

function fadeOut(clip, destination) {
	if(this[clip]._alpha > 0) {
		this[clip]._alpha--;
	} else {
		gotoAndStop(destination);
	}
}

```

with

```auto
function preload() {
	loaded = getBytesLoaded();
	if (loaded == total) {
		fadeOut(loader, 2);
	} else {
		stop();
	}
}

```

I’m sure that the problem is in the line

```auto
gotoAndStop(destination);

```

and I think it’s probably something obvious that I’m missing. Any help would be greatly appreciated. 😃
