I am learning actionscript 3 coding by making a crappy platformer game :)The problem I am facing is passing lots of options to a construct function that will setup the  display object where all of them have default values.I could send the options the normal way, like this:function Box(param1:Number=1, param2:Number=2, param3:Number=3, param4:Number=4){}but this seemed to be parameter pollution, so I made this class:package {    import flash.display.Sprite;    public class Box extends Sprite {        public var color:Number = 0x000000;        public var tileW:Number = 50;        public var tileH:Number = 50;        public var walkable:Boolean = true;        public var speedY:Number = 0;        public var speedX:Number = 0;        function Box(options:Object) {            for(var i:String in options) {                this[i] = options[i];            }            graphics.beginFill(this.color);            graphics.drawRect(0, 0, this.tileW, this.tileH);            graphics.endFill();        }    }}This works, but I have a feeling that I am missing something very basic, that everything I try to write is wrong...
Passing lots of options to a function
actionscript 3