# Null reference issue

**URL:** <https://forum.kirupa.com/t/null-reference-issue/288269>\
**Category:** flash\
**Created:** [May 13, 2009, 4:05pm UTC](https://forum.kirupa.com/t/null-reference-issue/288269 "2009-05-13T16:05:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dmennenoh](https://avatars.discourse-cdn.com/v4/letter/d/9dc877/32.png) [@dmennenoh](https://forum.kirupa.com/u/dmennenoh)\
**Post date:** [May 13, 2009, 4:05pm UTC](https://forum.kirupa.com/t/null-reference-issue/288269/1 "2009-05-13T16:05:33Z")

</div>

I have this fixed, but I’m just trying to understand why it does what it does. I have a library movieClip containing 10 frames. Each frame is a different question and its answers, which are multiple choice. To handle the answer clicks I have four transparent shapes covering them - qa, qb, qc, and qd.  
In the associated class I do something like:

gotoAndStop(questionNum);  
qa.addEventListener(MouseEvent.CLICK, qaClicked);

and three more for qb, qc, qd.

All works fine. Except… in frame 6 I have a true / false question, so just qa and qb. So I deleted the qc and qd shapes. This is the only frame / question where there are not four answers.

When I go to question 7 (or any question after 6) then and try adding the four event listeners I get a null object reference for qc, and qd. Even though they are there…

To solve, I just placed qc and qd back in frame 6…

But I’m wondering why I needed to.

Thanks, hope it makes sense.
