function Polygon(){ Tool.call(this); this.polyLines = new Array(); var v1; this.show = function(){ if (mouseClick.rightDown && !this.finished) { this.end(); } //if (this.polyLines.length == 0) { this.v1.show(); } for (var i = 0; i < this.polyLines.length; i++) { this.polyLines[i].show(); } } this.checkChildren = function(){ //this is redundant code, but I don't know how to use a "super()" function for (var i=0; i