Try continueFunction.apply(args);

Aaron

toofah_gm wrote:

I have a method that accepts variable arguments like this:

public function doSomethingThenContinue(continueFunction:Function,
...args)
{
// execute some code that does important stuff

// call the continue function now that we are done passing the
original args to that function
continueFunction(args);
}

Is it possible to pass the variable arguments on to the generic
continueFunction in this manner? I don't really want the args to be
passed in a single Array, but want to call the continueFunction with
the arguments split out like this dynamically
continueFunction(args[0], args[1], etc.) depending on how many were
passed in and depending on how many parameters the continueFunction
accepts.

Is this possible to do somehow?

Thanks,

Gary


Reply via email to