# \[AS3\]gotoAndPlay not working

**URL:** <https://forum.kirupa.com/t/as3-gotoandplay-not-working/312469>\
**Category:** flash\
**Created:** [August 4, 2010, 8:25am UTC](https://forum.kirupa.com/t/as3-gotoandplay-not-working/312469 "2010-08-04T08:25:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ash\_at\_risk](https://avatars.discourse-cdn.com/v4/letter/a/2bfe46/32.png) [@ash\_at\_risk](https://forum.kirupa.com/u/ash_at_risk)\
**Post date:** [August 4, 2010, 8:25am UTC](https://forum.kirupa.com/t/as3-gotoandplay-not-working/312469/1 "2010-08-04T08:25:31Z")

</div>

hello everybody,  
Plz help my gotoAndPlay function not working, I am getting this runtime error "[COLOR=Red]Error #1009: Cannot access a property or method of a null object reference.[/COLOR]"I understand its meaning, what is the reference that is null here , even keyframe 3 exists.

```php
q1.addEventListener(MouseEvent.CLICK,clik);
q2.addEventListener(MouseEvent.CLICK,clik);
q3.addEventListener(MouseEvent.CLICK,clik);
q4.addEventListener(MouseEvent.CLICK,clik);

function clik(event:MouseEvent)
{ 
    nex.addEventListener(MouseEvent.CLICK, abc);
    function abc(event:MouseEvent)
    {
        if(Number(RBG.selectedData)==1)//RBG is my radiobuttongroup
        {
            mark=mark + num;
        trace("correct answer="+mark);
        
        }
        else 
        { mark=mark-num;
            trace("Incorrect answer="+mark);
        }
        gotoAndPlay(3); 
    }

```
