# Extends MovieClip and function with parameters

**URL:** <https://forum.kirupa.com/t/extends-movieclip-and-function-with-parameters/180762>\
**Category:** Uncategorized\
**Created:** [March 3, 2006, 6:53am UTC](https://forum.kirupa.com/t/extends-movieclip-and-function-with-parameters/180762 "2006-03-03T06:53:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ck3lam](https://avatars.discourse-cdn.com/v4/letter/c/82dd89/32.png) [@ck3lam](https://forum.kirupa.com/u/ck3lam)\
**Post date:** [March 3, 2006, 6:53am UTC](https://forum.kirupa.com/t/extends-movieclip-and-function-with-parameters/180762/1 "2006-03-03T06:53:45Z")

</div>

```auto
class AddClass extends MovieClip {
	private var Func_without_param:Function;
	private var Func_with_param:Function;
	private function onRollOver():Void {
		//trace("Rolled");
	}
	private function onPress():Void {
		//call a function without parameter
		//Example: Func_without_param();
	}
	private function onRelease():Void {
		//call another function with parameter, it can be Func_with_param(paramA) or Func_with_param(paramA, paramB)
	}
	private function onReleaseOutside():Void {
		//same as onRelease
	}
	public function InputFunction(param_func:Function) {
		this.Func_without_param = param_func;
	}
}

```

In fla, I use drag and drop a movieclip to the stage (linkage -\> AS 2.0 class :AddClass). I don’t want to use attachMovie due to some reasons.  
Then, I use

```auto
myBtn.InputFunction(A_FUNCTION);

```

There are bunch of functions with or with parameters in the fla.

I don’t think the structure above is good. What’s the good way to add another function with parameters when I call? Because my function can be FUNCTION(paramA) or FUNCTION(paramA, paramB,…)

Any suggestion or advice?  
Thanks in advance!
