Skip to main content
Participant
September 20, 2013
Question

Package Cannot Be Nested 1037 & Syntax Error 1084

  • September 20, 2013
  • 2 replies
  • 1061 views

Trying to learn how to crerate a Box2D game in WIndows 8 Flash Pro CC.   Opened new document in ActionScript 3.0 Class or ".as" as a Flash Pro application.  Very very new to all developer languages and processes.  Please help.

package {
    import flash.display.Sprite
    import Box2D.Dynamics.*;
    import Box2D.Collision.*;
    import Box2D.Collision.Shapes.*;
    import Box2D.Common.Math.*;
    public class Main extends Sprite{
        public function Main(){
            trace(*my awsome game starts here *);
        }
    }
}

This topic has been closed for replies.

2 replies

kglad
Community Expert
Community Expert
September 21, 2013

the default directory is usually in the same directory where the main fla is saved but that can be changed in advanced actionscript settings panel (file>publish settings>actionscript settings - wrench icon).

p.s. you should copy and paste your actualy code.  if that is your actual code, that trace is incorrect and should contain a string.  ie, change the asterisks to quotes.

Participant
September 21, 2013

Sir,

How do I save that code as main.as in the flas default directory if it is already saved as "main.as". WHat do I do after I click on the wrench?

V/R,

Gregor Ivenz

kglad
Community Expert
Community Expert
September 21, 2013

start by copying and pasting the code in Main.as and make sure that's Main.as, not main.as

kglad
Community Expert
Community Expert
September 20, 2013

if that's saved as Main.as in the fla's default directory., there's no problem with the code you showed.