# Associative array

**URL:** <https://forum.kirupa.com/t/associative-array/238654>\
**Category:** Uncategorized\
**Created:** [September 13, 2007, 5:07pm UTC](https://forum.kirupa.com/t/associative-array/238654 "2007-09-13T17:07:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![hakukaji](https://avatars.discourse-cdn.com/v4/letter/h/43a26b/32.png) [@hakukaji](https://forum.kirupa.com/u/hakukaji)\
**Post date:** [September 13, 2007, 5:07pm UTC](https://forum.kirupa.com/t/associative-array/238654/1 "2007-09-13T17:07:22Z")

</div>

I’m trying to create a private assoc. array property that is populated in the constructor, and I’m loosing my mind trying to figure how to do it. It seems like it should be so simple.

```auto

public class SimpleScrollingEnemy extends Enemy {    
        
        private var _velocity:Number;
        private var _direction:String; 
        private var _boundaries:Object = new Object();
        /**
        *
        */
        public function SimpleScrollingEnemy(s:DisplayObject = null,h:Number = 10,d:String = "left") {            
            super(s,h);
            
            //should i add an initialize method?
            _velocity = 2;
            _direction = d;
                        
            _boundaries.left = 0;
            _boundaries.top = 0;
            _boundaries.right = stage.stageWidth;
            _boundaries.bottom = stage.stageHeight;
            
            trace(_boundaries.right); //NEVER EVEN TRACES! ugh             
        }        
}

```
