1 Reply Latest reply on Dec 30, 2007 10:23 AM by abeall

    ActionScript 2.0 class scripts may only define class or interface constructs.

    abeall Level 3
      This is driving me nuts. I have an old AS1 project which I upgraded to AS2. It uses an include file, settings.as, which has stuff like this:
      settings = new Object();
      settings.property = 'some value';

      Then I include it on the main timeline like this:
      #include "settings.as"

      Every time I render, I get a million and one Compile Errors stating:
      "ActionScript 2.0 class scripts may only define class or interface constructs."

      But it isn't an ActionScript 2.0 class! It's just a regular include. How do I avoid the bogus Compile Errors?
        • 1. ActionScript 2.0 class scripts may only define class or interface constructs.
          abeall Level 3
          Okay, I found why the compiler is getting confused.

          In my settings.as file I create an object named 'settings' as mentioned. Later in my code elsewhere on the timeline, I refer to settings.property. When Flash sees that, I guess it sees that I refer to an object 'settings' and that there's a .as file called 'settings' and it erroneously assumes it should be a class or something. I concluded this because if I change the object or .as name so that they do not match, the compile errors go away. As far as I know there's no way to tell the compiler that settings.as is not a class, despite the fact I'm not telling Flash that it is a class.