mercredi 25 janvier 2017

as3 - Error: Classes must not be nested

I tried to generate a preloader class linked in the main class in as3 but now my main class keeps getting an error on compile.

I don't know why this is happening because the code was working earlier. If it helps my ide is flashdevelop 5.2.0.3

Before when I try to compile I initially get "Error: null", Build halted with errors (fcsh). and then on attempting to compile again I get "Error: Classes must not be nested."

Any help would be greatly appreciated.

(skipping import statements and package)

    [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);
    }

}

Aucun commentaire:

Enregistrer un commentaire