Copy link to clipboard
Copied
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.
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);
Copy link to clipboard
Copied
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);
Copy link to clipboard
Copied
omg thanks thanks thanks
Copy link to clipboard
Copied
How to i Import the AxTilemap class?
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
i have no idea what your talking about
Copy link to clipboard
Copied
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.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now