function StandardAbacusColumn(x,starty,endy,blockstop,blocksbottom,blocksheight,colcols,blockcols,abacus,value,isupper,aging,schety){ if (aging === undefined) aging=true; if (schety === undefined) schety=false; this.elements = []; this.colWidthScale = 8/33; this.blockcols = blockcols; this.value = value; this.drawColumn = function(){ //grey: A0A0A0, stroke 6B6B6B var width = this.colWidthScale*abacus.blockWidth; var height = endy-starty; //console.log(width); //console.log(height); //console.log(x); //console.log(starty); var rect = new createjs.Shape(); rect.graphics.beginFill(this.blockcols[0]).drawRect(-1*(width/2),0,width,height); rect.graphics.beginStroke(this.blockcols[1]); rect.graphics.setStrokeStyle(width/8); rect.graphics.moveTo(-1*(width/2),0); rect.graphics.lineTo(-1*(width/2),height); rect.graphics.moveTo((width/2),0); rect.graphics.lineTo((width/2),height); rect.x = x; rect.y = starty; abacus.stage.addChild(rect); } this.updateY = function(){ var bmargin = (abacus.verticalMargin*abacus.blockHeight); var start = starty+(bmargin/2); var incr = abacus.blockHeight+bmargin; for (var i = 0; ii){ this.elements[i].updateValue(true); } else { this.elements[i].updateValue(false); } } start+=incr; } //console.log(this.howManyInUse()); abacus.updateTextItems(); } this.initElements = function(){ this.elements = []; var middlea; var middleb; if (schety==true){ middlea=(blocksheight-blocksbottom)+blocksbottom/2-1; middleb=(blocksheight-blocksbottom)+(blocksbottom/2); } for (var i = 0; i=blocksheight-blocksbottom)){ if (schety==true&&(i==middlea||i==middleb)){ var b = new AbacusBead(x,starty,"#000",abacus,this,i,value); } else { var b = new AbacusBead(x,starty,colcols,abacus,this,i,value); } b.init(); //console.log(b); this.elements.push(b); } else { this.elements.push(null); } } } this.shuntLeft = function(index){ if (this.elements.lastIndexOf(null)index){ console.log("start"); console.log(this.elements); var placeindex = this.elements.lastIndexOf(null)+1; var endindex = this.elements.indexOf(null)-1; var length = endindex-index+1; var movearray = this.elements.splice(index,length); console.log(movearray); //for (var i = 0; i