TypeError: Error #1009: Cannot access a property or method of a null object reference.
I have a class called Main, that extends MovieClip (it is dynamic) to house my global variables, functions etc.
This Main class, has a particular instance variable called tower_ind, I have created an instance of this class called main.
And using this right after: main.tower_ind = 5; trace(main.tower_ind); , appears to work perfectly.
But if I try to access this variable from another class which I create an instance of afterwards, I get the error mentioned at the top of this post.
I access it like this in the class:
var inst:String = "tower_basic1_" + this.root.main.tower_ind;
I have tried root, stage, parent, this.root, this.parent, this.stage etc etc, but no matter what, it still complains…
Although in the future I may be converting to using a public static variable of my tower class to keep hold of the index (should piss this problem right off I hope), but I will still need to get this kind of result working for other things.