What you're after is usually called a splat. It's not supported quite so
explicitly in AS3, but to do what you're after just use Function.apply(). So
in your case, it'd be:

continueFunction.apply(this, args);

-Josh

On Tue, Dec 30, 2008 at 8:58 AM, toofah_gm <ga...@byu.edu> 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
>
>
> ------------------------------------
>
> --
> Flexcoders Mailing List
> FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> Alternative FAQ location:
> https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847
> Search Archives:
> http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups
> Links
>
>
>
>


-- 
"Therefore, send not to know For whom the bell tolls. It tolls for thee."

Like the cut of my jib? Check out my Flex blog!

:: Josh 'G-Funk' McDonald
:: 0437 221 380 :: j...@gfunk007.com
:: http://flex.joshmcdonald.info/
:: http://twitter.com/sophistifunk

Reply via email to