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

**URL:** <https://forum.kirupa.com/t/cannot-access-a-property-or-method-of-a-null-object-reference/277252>\
**Category:** Uncategorized\
**Created:** [December 9, 2008, 11:37pm UTC](https://forum.kirupa.com/t/cannot-access-a-property-or-method-of-a-null-object-reference/277252 "2008-12-09T23:37:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mrbelv](https://avatars.discourse-cdn.com/v4/letter/m/e8c25b/32.png) [@mrbelv](https://forum.kirupa.com/u/mrbelv)\
**Post date:** [December 9, 2008, 11:37pm UTC](https://forum.kirupa.com/t/cannot-access-a-property-or-method-of-a-null-object-reference/277252/1 "2008-12-09T23:37:37Z")

</div>

This seems like it should be simple.

I’ve inherited a Flash file from a designer that I have to now make dynamic. I’m trying to keep as much of the original straucture as possible - meaning - that there’s a lot of timeline stuff going on in here.

I have a main movie clip called “contentMC”. Inside this clip, the designer has three navigation tabs. When you click one, they have a “gotoAndStop” action to take you to the appropriate frame label. Each one of the tabs is a button.

On the main timeline, I have the following code:

```auto

contentMC.tab1.addEventListener(MouseEvent.MOUSE_UP, firstTab);
 
function firstTab(e:MouseEvent):void {
 contentMC.gotoAndStop("firstTabContent");
}

```

I get the following error:

TypeError: Error #1009: Cannot access a property or method of a null object reference.  
at TVLI\_12\_fla::MainTimeline/firstTab()

And yes, “tab1” is a button, but why this would make any difference whatsoever is beyond me. This is about as basic as it gets. I don’t get the error if I don’t try and do the “gotoAndStop” action.

Any help with this would be greatly appreciated.
