2011-04-19 46 views

回答

3

... args實際上創建所有的參數數組來傳遞,所以這應該工作:

function showArguments(... args):void 
{ 
    for(var i:int = 0; i < args.length; i++) { 
     trace(args[i]+", "+typeof(args[i])); 
    } 
} 

showArguments({foo1:"bar1"},{foo2:"bar2"},"Hello",50); 

可追溯:

[object Object], object 
[object Object], object 
Hello, string 
50, number 
+0

十分感謝閃光燈是驚人的:) – user310291 2011-04-19 18:43:10