Navigating through timeline of a MovieClip class after instantiating

I have a MovieClip symbol that has 2 frames (for now). Depending on how it was initilialized, I want it to gotoAndStop at either frame or 2.

Inside my class definition (Animal.as), I have written this as my constructor:

	var type:String;

	public function Animal(t:String = "") {
		type = t;
                    this.gotoAndStop(type);
	}

and inside my flash file I have labeled frame one and two. I am making sure that my main timeline passes in the correct name. If I do this, then it returns:

Cannot access a property or method of a null object reference.

I have also tried to control it through the timeline, by adding this code in frame one of Animal:

gotoAndStop(this.type); but I don’t think it is able to access the properties within this class, or something, because it keeps flickering between frame 1 and 2 still