I don’t know what else to call them, so I named them mapscripts.
You know, when you make a 2D RPG game you have these scripts for every map which contain functions that can be triggered by zones, entities or right after the map has been loaded?
Well, I use actionscript files for them and I want these files to be instantiated dynamically.
So when a player enters yet another dungeon, let’s say dungeon3a, dungeon3a.xml (containing the map, name of tile sheet, locations of the entities, etc.) will have to be fetched and so script dungeon3a.as as well.
Since I use actionscript files for mapScripts I’m stuck with error 1065 as Zeng and others experience in the following page:
http://www.mikechambers.com/blog/2006/06/22/actionscript-3-get-a-class-reference-by-class-name/
Like Anon, Enrico Foschi, Bernard Farell and Kees van Dorp, I’m a annoyed with the solution of referencing the class by name. This destroys the whole purpose of trying to load classes dynamically.
a) I use Flashdevelop and want to try what Matthias Eichstedt suggests (another commenter in the link above), but how would I do that?
I’ve tried putting in that line of code (modified for my files of course) both in project classpaths and pre-build Command line which doesn’t work.
b) Could creating a seperate project help? And then put the mapscripts in an swc file?
If I would try that, how could I make the mapscripts know about the engine?
Or should even turn what I have into a game engine and create an swc from that?
Although that would double the previous problem.
I’m hoping someone could help me with this.