Hi !
I have an array used to track shots fired from a cannon, and when they hit the ground they are removed.
I would like to know what is the most efficient way of finding and removing a certain element from an array. I heard that using pop() instead of splice() was faster, is it ?
Also, the big question I have is that the only way I see of actually finding the element in the array is using
Then I would use either splice() or pop() to remove it from the array before deleting the MC. Is there a better way than scanning through the whole array comparing each element to the triggering MC ?Code:for(i=0;i<array.length;i++){ if(array[i] == movieClipToRemove){ //i == movieClip index in the array } }
Thank you guys![]()




Reply With Quote
