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.
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
}
}