# Null object reference

**URL:** <https://forum.kirupa.com/t/null-object-reference/324426>\
**Category:** Uncategorized\
**Created:** [August 20, 2011, 9:45am UTC](https://forum.kirupa.com/t/null-object-reference/324426 "2011-08-20T09:45:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 20, 2011, 9:45am UTC](https://forum.kirupa.com/t/null-object-reference/324426/1 "2011-08-20T09:45:45Z")

</div>

I’m creating a movie clip button and for the out state I have this:

web\_btn.addEventListener(MouseEvent.MOUSE\_OUT, at\_out);  
function at\_out(event:MouseEvent):void {  
web\_btn.gotoAndPlay(30-(web\_btn.currentFrame-11));  
}

It gives me this error when I click the button:

TypeError: Error #1009: Cannot access a property or method of a null object reference.  
at index\_fla::web\_mc\_37/at\_out()

I know the error is in this statement:

web\_btn.gotoAndPlay(30-(web\_btn.currentFrame-11));

But that line of code works fine!

What is it? :eyeup:
