为什么 Lib.current.stage 给我一个错误?

Why does Lib.current.stage give me an error?

为什么 Lib.current.stage 给我这个错误:

src/Main.hx:43: characters 2-35 : openfl.display.DisplayObject cannot be called

编辑:我试过下面的代码。

Lib.current.stage.addEventLitener(
    KeyboardEvent.KEY_DOWN,
    function(e:KeyboardEvent) {
        if (e.keyCode == Keyboard.W) up = true;
        if (e.keyCode == Keyboard.A) left = true;
        if (e.keyCode == Keyboard.D) right = true;
        if (e.keyCode == Keyboard.S) down = true;
    }
);

我认为 MovieClip 实现了 Dynamic<MovieClip>,因此任何不在 class 定义中的引用都被假定为 MovieClip。

您在 addEventLitener 上有一个错字,缺少一个 's',它不在 class 定义中,因此被假定为无法调用的 MovieClip。