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() { };
精彩评论