Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I determine a function's argument count at runtime in Flex 3?

I want to pass an optional data parameter to some callbacks, but only to callbacks that support a single parameter; right now, I have a moderately-sized code base of callbacks that cannot accept a parameter at all. How can I check what parameters a Function object supports?

like image 221
Chris R Avatar asked Mar 03 '10 18:03

Chris R


1 Answers

Function is an Object. Every function has a read-only property named length that stores the number of parameters defined for the function. Use it.

like image 106
Lex Avatar answered Sep 28 '22 00:09

Lex