//obj = {moveToX : ...} myObj.prototype.moveTo = function(obj){ if(obj){ for(var k in obj) this[k]=obj[k] this.moveToT = 0; this.moveToStatus = true; this.visible = true; }