views:

65

answers:

1

I have a component that I hand over a function

public var func : Function;

Now the function is a function that has parameters in its signature

public function myFunction(s : String) : void {
   doSomething(s);
}

from my component I can call the function with

func.call();

Can someone tell me how to invoke the function with its parameters?

+6  A: 

You should either be able to do this:

func("foo");

or

func.call(this, "foo");

or

func.apply(this, ["foo"]);

Have a look at the documentation for the Function object in AS3 documentation.

James Ward