# Buttonmode not working!

**URL:** <https://forum.kirupa.com/t/buttonmode-not-working/328351>\
**Category:** Uncategorized\
**Created:** [May 10, 2012, 7:09am UTC](https://forum.kirupa.com/t/buttonmode-not-working/328351 "2012-05-10T07:09:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![DeadlyDude](https://avatars.discourse-cdn.com/v4/letter/d/db5fbb/32.png) [@DeadlyDude](https://forum.kirupa.com/u/DeadlyDude)\
**Post date:** [May 10, 2012, 7:09am UTC](https://forum.kirupa.com/t/buttonmode-not-working/328351/1 "2012-05-10T07:09:23Z")

</div>

I have created an array which stores all the MovieClips which I want to use as button then I am passing that array to other class using setter and trying to enable buttonmode ,but its not working ,its giving error “Cannot access a property or method of a null object reference.”;  
But all other event listeners are working.  
Here is my code

```auto

for(var i:int=0;i<_btnName.length;i++)
	
{
      (_btnName* as MovieClip).buttonMode=true;
       
}

```
