开发者

Using constants in object declaration?

I want to create a function pointer object:

private var func:Object = { Class开发者_Python百科.Constant: function };

What is the clean way of doing this? I did the above and got

Error: Syntax error: expecting colon before dot.

And I'm not even sure that's right. The goal is that I can just do

func[ Constants ]();

somewhere later.


Try this:

private var func:Object = { };
func[ Class.CONSTANT ] = function() { };
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜