开发者

Unlimited params in flash for Object? [closed]

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜