Skip to main content
Participant
March 26, 2013
Answered

I need some help. I need it badly.

  • March 26, 2013
  • 2 replies
  • 639 views

I'm making a game and I ran into a problem. Heres the code:

package {

import org.axgl.AxState;

public class GameState extends AxState {

           private var tilemap:AxTilemap;

           override public function create():void {

                     tilemap = new AxTilemap().build(Resource.MAP_DATA, Resource.TILES, 10, 10, 3);

         add(tilemap);

                     super.create();

                     trace("Gamestate Created");

                    

           }

          

           override public function update():void {

                     super.update();

           }

           }

}

Heres the error:

5:  col: 23 Error: Type was not found or was not a compile-time c...

7:  col: 18 Error: Call to a possibly undefined method AxTilemap.

This topic has been closed for replies.
Correct answer Ned Murphy

If 5 refers to line 5, then it probably means you need to import the AxTilemap class because it is not being found

If 7 refers to line 7, then try creating the tilemap instance first, then try running the build method within it...

tilemap = new AxTilemap();

tilemap.build(Resource.MAP_DATA, Resource.TILES, 10, 10, 3);

2 replies

IdentswAuthor
Participant
March 26, 2013

How to i Import the AxTilemap class?

Ned Murphy
Legend
March 26, 2013

You're the closest one to the files to be able to tell.  Look at how you imported the other class (import org.axgl.AxState;) and see if that's also where you will find the AxTilemap class

IdentswAuthor
Participant
March 26, 2013

i have no idea what your talking about

Ned Murphy
Ned MurphyCorrect answer
Legend
March 26, 2013

If 5 refers to line 5, then it probably means you need to import the AxTilemap class because it is not being found

If 7 refers to line 7, then try creating the tilemap instance first, then try running the build method within it...

tilemap = new AxTilemap();

tilemap.build(Resource.MAP_DATA, Resource.TILES, 10, 10, 3);

IdentswAuthor
Participant
March 26, 2013

omg thanks thanks thanks