Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

I need some help. I need it badly.

New Here ,
Mar 26, 2013 Mar 26, 2013

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.

TOPICS
ActionScript
603
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Mar 26, 2013 Mar 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);

Translate
LEGEND ,
Mar 26, 2013 Mar 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);

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 26, 2013 Mar 26, 2013

omg thanks thanks thanks

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 26, 2013 Mar 26, 2013

How to i Import the AxTilemap class?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 26, 2013 Mar 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 26, 2013 Mar 26, 2013

i have no idea what your talking about

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Mar 26, 2013 Mar 26, 2013
LATEST

What Ned meant is:

look at the import statement at the beginning of your class:

import org.axgl.AxState

this tells the compiler where to look for all your files,

there are two different methods to store class files:

globally (the better method)

or locally (in the same directory like your fla/xfl file, the beginners way)

1.download the source files of the gameframework you need from http://axgl.org/ if you didn`t do that already

2.extract the complete folder structure into your main games folder with keeping the hierarchy intact (org/axgl...)

3.If you have never heard of basic OOP concepts and just want to make a little game, prepare for a rude awakening or a serious learning process.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines