Hi!
If you do:
var arr:Vector.<int> = new Vector.<int>();
arr.push(1, 2, 3, 4);
for (var i:int = 0; i < arr.length; i++)
{
if (i == 2)
{
arr.splice(2, 1);
}
trace(arr*); // 1, 2, 4
}
The 3 gets skipped, obviously. I know i can avoid this by going backwards in a loop, but that is not safe if 2 elements gets deleted in the same irreation (spelling?). So, I use a dictionary insted. From what I understand this problem is solved by using a dictionary, if you delete 2 items in a dict in the same irreation the looping will not be effected (the deleted items wont be looped ofc).
However, I got a bug where it seems that by removing items in a dict while looping it, the looping gets messed up and some items in the dict will not be looped at all.
My question: Can I remove items in a dictionary while looping without messing up the loop? I tried to test this and it seems it does not effect the looping, but it seems like the looping is effected in the bug that i have.