darfux Posted August 17, 2014 Share Posted August 17, 2014 Hi,When I using the Group.removeBetween(startIndex) to remove children from startIndex to the end of the Group, it always throws Uncaught TypeError: Cannot read property 'events' of undefined.It seems that the implemention of default endIndex is bugged? : Group.js#line-1580if (typeof endIndex === 'undefined') { endIndex = this.children.length; } Group.js#line-1594var i = endIndex;while (i >= startIndex){ //The first children[i] is out of bounds? if (!silent && this.children[i].events) { this.children[i].events.onRemovedFromGroup.dispatch(this.children[i], this); } var removed = this.removeChild(this.children[i]); Link to comment Share on other sites More sharing options...
Dumtard Posted August 17, 2014 Share Posted August 17, 2014 Makes sense. Array[0, 1, 2, 3, 4] has length of 5 but index 0..4 so accessing Array[5] would be incorrect. Should probably be this.children.length-1. Link to comment Share on other sites More sharing options...
Recommended Posts