Hi, list. I think there is a bug in the function removeObject. It's suposed to remove all objects if NULL is passed as parameter, but it's not doing this. When an object is removed from this.aObjects array the length will decrease too... thats why the function is not working. I did some changes and now its working:
<br><br>kaMap.prototype.removeObject = function( obj ) {<br> _obj = obj<br> for (var i=this.aObjects.length-1; i>=0; i--) {<br> if (this.aObjects[i] == obj || obj == null) {<br> if (!obj) {<br> obj =
this.aObjects[i];<br> }<br> if (obj.canvas) {<br> obj.canvas.removeChild( obj );<br> obj.canvas = null;<br> }<br> this.aObjects.splice(i,1);<br> obj = null;
<br> <br> if (_obj != null || i == 0) {<br> return true;<br> } <br> }<br> } <br> return false;<br>};<br>