标签: function variables actionscript constructor
我想让一个变量保持一个类构造函数,但是它给出了这个错误:
var myFunction:Function function someFunction() {} myFunction = someFunction //works myFunction = MovieClip //doesn't work - 1067: Implicit coercion of a value of type Class to an unrelated type Function.
有办法吗?
答案 0 :(得分:3)
举办课程的正确类型是Class,而不是Function。
Class
Function
var myClass:Class = MovieClip;