Alright, so I’m getting a #1009 TypeError (everyone’s favorite, right?) and I’m having a lot of trouble finding the source of the problem. The code I have posted is one part of an OOP. I’m pretty sure that the Level Class is unable to instantiate the playercontainer variable. What you need to know here is that PowerlessContainer extends PlayerContainer. I can upload other Classes if requested, wasn’t sure where the real problem lies
Here’s the Level Class
package
{
import flash.display.MovieClip;
public class Level extends MovieClip
{
public static var playercontainer:PlayerContainer = new PowerlessContainer;
public function Level()
{
addChild(playercontainer);
}
}
}
and here’s the full error:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at Player/directBehavior()
at PlayerContainer/doFrame()