# Navigating through timeline of a MovieClip class after instantiating

**URL:** <https://forum.kirupa.com/t/navigating-through-timeline-of-a-movieclip-class-after-instantiating/310374>\
**Category:** flash\
**Created:** [June 8, 2010, 5:32pm UTC](https://forum.kirupa.com/t/navigating-through-timeline-of-a-movieclip-class-after-instantiating/310374 "2010-06-08T17:32:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sophiez](https://avatars.discourse-cdn.com/v4/letter/s/e19adc/32.png) [@sophiez](https://forum.kirupa.com/u/sophiez)\
**Post date:** [June 8, 2010, 5:32pm UTC](https://forum.kirupa.com/t/navigating-through-timeline-of-a-movieclip-class-after-instantiating/310374/1 "2010-06-08T17:32:39Z")

</div>

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
