# Communicating between classes

**URL:** <https://forum.kirupa.com/t/communicating-between-classes/317835>\
**Category:** Uncategorized\
**Created:** [January 4, 2011, 12:11pm UTC](https://forum.kirupa.com/t/communicating-between-classes/317835 "2011-01-04T12:11:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![black\_pearl](https://avatars.discourse-cdn.com/v4/letter/b/aeb1de/32.png) [@black\_pearl](https://forum.kirupa.com/u/black_pearl)\
**Post date:** [January 4, 2011, 12:11pm UTC](https://forum.kirupa.com/t/communicating-between-classes/317835/1 "2011-01-04T12:11:56Z")

</div>

I have two classes. One of the class file has declared an Array. I want to add item to the array from another class on a button class. I don’t know how to do this.

MyArray class

```auto
package{
    public var myArrar:Array
    public class MyArray{
        public function MyArray(){
            
        }
    }
}

```

MyButton class

```auto
package{
    import flash.display.*
    import flash.events.*
    public class MyButton extends MovieClip{
        public function MyButton():void{
            this.addEventListener(MouseEvent.CLICK,clickHandler)
        }
        function clickHandler(e:MouseEvent):void{
            myArrar.push("as3")
        }
    }
}

```

I am getting this error  
1120: Access of undefined property myArrar.
