# Custom function w/ variables not working - help?

**URL:** https://forum.kirupa.com/t/custom-function-w-variables-not-working-help/129915
**Category:** Uncategorized
**Created:** [November 29, 2004, 11:08pm UTC](https://forum.kirupa.com/t/custom-function-w-variables-not-working-help/129915 "2004-11-29T23:08:39Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Tinuviel](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/tinuviel/32/497_2.png) [@Tinuviel](https://forum.kirupa.com/u/Tinuviel)
#### Post date: [November 29, 2004, 11:08pm UTC](https://forum.kirupa.com/t/custom-function-w-variables-not-working-help/129915/1 "2004-11-29T23:08:39Z")

</div>

I’m using Flash MX 2004.

```php

// function to automate the hit tests
function hitClip (aCPlaceNum, loopNum, loopName, aCButtonNum) {
	aCPlaceNum.gotoAndStop(5);
	loopNum.attachSound(loopName);
	loopName.gotoAndStop(5);
	aCButtonNum = loopName;
}

ambPho.onRelease = function () {
	if ( ambPho.hitTest(aCPlace01) == true ) {
		hitClip ("aCPlace01", "loop01", "ambientPhotek", "aCButton01");
	}
}

```

Can you please tell me why this isn’t working? It takes me 10 minutes to test the movie every time and it’s taking me forever to fix things.

Do I have to do something else with the variable names I’m using or something?

Thanks for your help.
