1

我想让一个变量保存一个类构造函数,但它给出了这个错误:

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.

有没有办法做到这一点?

4

1 回答 1

3

举行班级的正确类型是Class,不是Function

var myClass:Class = MovieClip;
于 2013-03-10T21:47:24.477 回答