Cannot access a property or method of a null object reference

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:


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.