CLICK HERE TO COPY
Actionscript:
var Box:Function = {
constructor : function(color:uint, w:Number, h:Number):void {
this.color = color;
this.s = new Shape();
with(this.s.graphics) beginFill(this.color), drawRect(0,0,w,h);
addChild(this.s);
this.setLoc = function(x:Number, y:Number):void{
this.s.x = [...]