Hey guys,
So basically this is what I need to happen…
In my document class “Engine” I need to make my “Game Handler” class which is done in the constructor by using:
var Game:GameHandler = new GameHandler(stage);
As you can see, im passing the stage into it… now in my GameHandler class
it recieves this by:
private var stageRef:Stage
public function GameHandler (stageRef:Stage)
{
this.stageRef = stageRef
addEventListener(Event.ENTER_FRAME, loop);
}
And now I can access the stage by using stageRef in that class, that works fine but the GameHandler class creates another variable which need to be able to access the stage, which will create other classes that need to have access to the stage… I’ve tried:
var Survival:SurvivalMode = new SurvivalMode(stage);
But I get a whole lot of TypeError: 1009’s…
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at com.senocular.utils::KeyObject/construct()
at com.senocular.utils::KeyObject()
at com.main.platformer::Character()
at com.main.platformer::SurvivalMode()
at com.main.platformer::GameHandler/loop()
As you can see im using senoculars key object class which alot of you probably know what it is (adds the isDown functionality that was in AS2)…
I really don’t know what do do… Any help would be greatly appreciated