AS3 knowing how many arguments a function takes
问题 Is there a way to know how many arguments an instance of Function can take in Flash? It would also be very useful to know if these arguments are optional or not. For example : public function foo() : void //would have 0 arguments public function bar(arg1 : Boolean, arg2 : int) : void //would have 2 arguments public function jad(arg1 : Boolean, arg2 : int = 0) : void //would have 2 arguments with 1 being optional Thanks 回答1: Yes there is: use the Function.length property. I just checked the