开发者

Actionscript - Call subclass constructor from base class

I want to create an instance of a subclass from inside a static superclass method. H开发者_如何学编程ere is an example:

class Base
{
    public static function createSubclassInstance()
    {
        //What do I do here?
        return new this.getSubclassType();
    }
}

class Sub extends Base
{
}

I want to create a new Sub instance by calling:

var s:Sub = Sub.createSubclassInstance();


static properties aren't inherited

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜