开发者

Unlimited params in flash for Object? [closed]

开发者 https://www.devze.com 2023-02-27 06:21 出处:网络
Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post.
Closed. This question needs details or clarity. It is not currently accepting answers.

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
0

精彩评论

暂无评论...
验证码 换一张
取 消