# How function works?

**URL:** <https://forum.kirupa.com/t/how-function-works/174913>\
**Category:** Uncategorized\
**Created:** [January 10, 2006, 9:49am UTC](https://forum.kirupa.com/t/how-function-works/174913 "2006-01-10T09:49:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![eric\_chua](https://avatars.discourse-cdn.com/v4/letter/e/f9ae1b/32.png) [@eric\_chua](https://forum.kirupa.com/u/eric_chua)\
**Post date:** [January 10, 2006, 9:49am UTC](https://forum.kirupa.com/t/how-function-works/174913/1 "2006-01-10T09:49:56Z")

</div>

hi, i have a simple mc and now trying to using function() to do the trick. My code as below:  
this is the function I put in the timeline:

```auto
function slotclick(aa)
{
	var bb = aa;
	_root. + [bb] + .gotoAndPlay(1);
}

```

this is the code i wrote within a mc:

```auto
on(release)
{
	slotclick(slip);
}

```

but the movie failed to run, what happening actually? if possible someone pls provides me a tutorials on how how to pass the parameters to funcion and then return back to the mc. Thanks.
