as3 - Error: Classes must not be nested

as3 - Error: Classes must not be nested

我试图在 as3 中的主 class 中生成链接的预加载器 class,但现在我的主 class 一直在编译时出错。

我不知道为什么会发生这种情况,因为代码之前可以正常工作。 如果有帮助,我的 ide 是 flashdevelop 5.2.0.3(我尝试从 5.1.1.1 更新)

在我尝试编译之前,我最初得到 "Error: null",构建因错误而暂停 (fcsh)。然后在尝试再次编译时我得到 "Error: Classes must not be nested."

我尝试按照类似问题的建议清理项目,但没有成功解决这个问题。

如有任何帮助,我们将不胜感激。

(跳过导入语句和包)

    [Frame(factoryClass="Preloader")]

    public class Main extends Sprite {

      private var adventure_model:AdventureModel;

      private var title_view:TitleView;
      private var title_controller:TitleController;

      protected var panelCollection:PanelCollection = null;


      public function Main():void 
      {
        if (stage) init();
        else addEventListener(Event.ADDED_TO_STAGE, init);
      }

      private function init(e:Event = null):void 
      {
        removeEventListener(Event.ADDED_TO_STAGE, init);
        // entry point

        panelCollection = new PanelCollection();
        adventure_model = new AdventureModel();
        title_controller = new TitleController(adventure_model, panelCollection);
        title_view = new TitleView(adventure_model, title_controller, "title_view", 0, 0, panelCollection);
        addChild(title_view);
    }

}

这个问题是在不相关的 class 中发现的代码错误,并且还突出显示了我所拥有的 Vectors 的错误。非常感谢。