Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question...args is for string. so开发者_开发百科mething possible for Objects ?
... args
actually creates an array of all the parameters to pass in, so this should work:
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);
Which traces:
[object Object], object
[object Object], object
Hello, string
50, number
精彩评论